-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
devtools::test() and R CMD check ok but covr throws error #420
Comments
The discrepancy comes because when covr runs the tests using Unfortunately there isn't an easy way to ensure this option is set in covr itself, however you could set it yourself in your |
This resolves an issue concerning test expectations containing quotes - 'covr' was failing, when 'R CMD check' was fine, see r-lib/covr#420.
Thanks, setting |
@jimhester I know this is a closed issue, but this really is the canonical place (both the package and the issue) for this statement/request: please reconsider.
For some unclear reason, the default on windows is My frustration aside, I have a few proposals:
Okay, perhaps number three is a bridge too far. Number one might be applicable to other Other options:
Though I still think number one is the most-direct and painless without introducing breaking changes. It seems mostly to be harmless option-adding for the purposeful side-effect of documenting a weird situation. Thank you! (I was initially going to post the results from |
R CMD check sets this environment variable when running tests, but tools::testInstalledPackage does not. Covr aims to be as consistent as possible with R CMD check, so we should set it as well. Fixes #420
Hi @r2evans, covr now sets the environment variable so this file will be sourced just like in R CMD check, this should make covr equivalent to running the tests in R CMD check in this respect. Unfortunately we can only aim to be as compatible as possible with R CMD check, we cannot change R's defaults, so doing anything else is out of scope. |
Thanks @jimhester |
Use the github version of covr (3.5.1.9003) to try to fix https://github.com/leekgroup/recount/runs/3286906239?check_suite_focus=true#step:26:27 (covr 3.5.1) r-lib/covr@ddbfbec implements a fix to r-lib/covr#420 which maybe explains this issue Using the Bioconductor devel docker I cannot reproduce the error on the GHA run using the same docker. That's when executing the test code manually, not with covr (I'm still in the process of running R CMD check + covr there).
My package lagged' passes
devtools::test()
,R CMD check
, and builds successfully on TravisCI. However for some reason Coveralls was not getting coverage updates from Travis. It turned out that it was the 'covr' run after the build that was failing in the following line at the end of my.travis.yml
More specifically, running the coverage tests locally I got:
It is the quotes that cause the problem, but surprisingly for me, changing the quotes to dots in the expected regex didn't work:
It looks like there is a discrepancy between 'covr' and devtools here. I know that the above is not a 'minimal' reprex but it seems to convey the issue. The offending line above, now commented out is at the end of the file (see
GeoBosh/lagged
).I resolved the issue by cutting off the regex just before the first quote but the expectation becomes less expressive this way.
The text was updated successfully, but these errors were encountered: