Thanks to visit codestin.com
Credit goes to GitHub.com

Skip to content

[WIP] Skip examples or tests that need credentials if not available#484

Draft
PietrH wants to merge 6 commits intoopencpufrom
pass-win-devel
Draft

[WIP] Skip examples or tests that need credentials if not available#484
PietrH wants to merge 6 commits intoopencpufrom
pass-win-devel

Conversation

@PietrH
Copy link
Member

@PietrH PietrH commented Feb 12, 2026

Some examples or tests need credentials to be stored in order to run. This is no big deal but will break CRAN submission or using devtools::check_win_release(). This PR gets this out of the way.

I add two helpers, one to check if credentials are set, this is used for conditional examples and for the other function: a testthat skip helper that skips a test if no credentials are set.

It should be easy to adapt these helpers to keyring later on. They may need no modification whatsoever.

Possible followup: Some tests are already skipped if there is no local database connection, in fact, these should also be skipped if there are no credentials set. I suppose I could repeat the skip or call it from within skip_if_not_localdb().

@PietrH PietrH self-assigned this Feb 12, 2026
@PietrH PietrH changed the base branch from main to opencpu February 12, 2026 14:34
@PietrH
Copy link
Member Author

PietrH commented Feb 12, 2026

There is no issue for this PR

@PietrH
Copy link
Member Author

PietrH commented Feb 12, 2026

The package is also too big to be sent via devtools::check_win_release(), i removed the fixtures, built the package locally and uploaded via the webform; I'm not sure if it worked.

@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.67%. Comparing base (dc52950) to head (50efc9b).
⚠️ Report is 1 commits behind head on opencpu.

Additional details and impacted files
@@             Coverage Diff             @@
##           opencpu     #484      +/-   ##
===========================================
+ Coverage    85.65%   85.67%   +0.01%     
===========================================
  Files           26       26              
  Lines          746      747       +1     
===========================================
+ Hits           639      640       +1     
  Misses         107      107              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@PietrH
Copy link
Member Author

PietrH commented Feb 12, 2026

This seems to have a very negative effect on package coverage, does covr somehow skip these tests as well? It should have access to credentials since it worked just fine before!

@PietrH
Copy link
Member Author

PietrH commented Feb 12, 2026

CI also has much more skips than expected, something is wrong with my helper and covr caught it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant