Open PatrickRWright opened 3 months ago
This sounds reasonable to me!
I do anticipate that there will be other packages where changing this envvar will cause their coverage to fail. I'm imagining specifically situations where packages use skip_on_cran()
to disable tests that run outside their own CI/CD processes - maybe requiring authenticated database access using secrets only available on CI, or packages not available on CRAN.
There are more appropriate ways of handling these situations (skip_on_ci()
, skip_if()
, specifying AdditionalRepositories
), but skip_on_cran()
can often be the most obvious path forward in such cases so it sometimes gets used as a catch-all.
I would say we should try to run tests as inclusively as possible, but then fall back to cran-style tests if there are issues.
Some package test files will include
testthat::skip_on_cran()
. A use case I am aware of is to reduce runtime when deploying to CRAN and thus prevent package rejection. In the context of test coverage this means that tests are likely functional but omitted on CRAN only for technical reasons.In the current setup, packages may return artificially low scores with respect to code coverage.
Here's a related SO thread for some additional context:
https://stackoverflow.com/questions/76153396/how-to-include-tests-with-skip-on-cran-when-calling-covrpackage-coverage
Example (22.84% vs. 95.18%): This needs some minutes to complete.