Skip to content
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

covr not working with renv #571

Open
JT-39 opened this issue Jun 12, 2024 · 1 comment
Open

covr not working with renv #571

JT-39 opened this issue Jun 12, 2024 · 1 comment

Comments

@JT-39
Copy link

JT-39 commented Jun 12, 2024

When running covr::package_coverage() in the project where I have my package, the function runs fine and produces the output one would expect (code coverage scores for all the functions).

However, after initialising {renv} and creating a renv.lock file and renv/ folder, the covr package fails. This is the code and output I get:

> covr::package_coverage()
Error: Failure in `C:/Users/jtufts/AppData/Local/Temp/RtmpKqr5sO/R_LIBS176043926f2c/dfeR/dfeR-tests/testthat.Rout.fail`
ELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(testthat)
> library(dfeR)
Error in loadNamespace(x) : there is no package called 'covr'
> 
> test_check("dfeR")
Error in loadNamespace(x) : there is no package called 'desc'
Calls: test_check ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Error in loadNamespace(x) : there is no package called 'covr'
Calls: <Anonymous> ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart

This is also fails in the GitHub Actions I have setup which runs covr::codecov, with the same errors.

Is this a bug?

P.S. I have tried adding covr and desc to the renv.lock file (& to Imports in DESCRIPTION) but the same error occurs

@radbasa
Copy link
Contributor

radbasa commented Jun 24, 2024

Because you initialized renv, you may have to reinstall all your package dependecies under renv. That includes covr.

Note: packages don't really work well with renv.

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

No branches or pull requests

2 participants