[WIP] Skip examples or tests that need credentials if not available#484
[WIP] Skip examples or tests that need credentials if not available#484
Conversation
|
There is no issue for this PR |
|
The package is also too big to be sent via |
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
|
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! |
|
CI also has much more skips than expected, something is wrong with my helper and covr caught it! |
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().