r-lib / covr

Test coverage reports for R
https://covr.r-lib.org
Other
335 stars 115 forks source link

covr::package_coverage fails to find package when running examples and `install_path` is used. #517

Open MLopez-Ibanez opened 2 years ago

MLopez-Ibanez commented 2 years ago
 covr::package_coverage(type="all", quiet=FALSE, clean=FALSE, install_path="tmp-covr")
* installing *source* package ‘irace’ ...
** using non-staged installation
** libs
gcc -I"/opt/R/4.2.1/lib/R/include" -DNDEBUG   -I/usr/local/include   -fpic  -g -O2  -O0 --coverage -c iracebin/irace.c -o iracebin/irace.o
gcc  -g -O2  -O0 --coverage iracebin/irace.o -o iracebin/irace
gcc -I"/opt/R/4.2.1/lib/R/include" -DNDEBUG   -I/usr/local/include   -fpic  -g -O2  -O0 --coverage -c iracebin/ablation.c -o iracebin/ablation.o
gcc  -g -O2  -O0 --coverage iracebin/ablation.o -o iracebin/ablation
installing via 'install.libs.R' to /home/runner/work/irace/irace/tmp-covr/irace
** R
** inst
** tests
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
  converting help for package ‘irace’
    ablation                                example
    ablation_cmdline                        example
    buildCommandLine                        example
    getFinalElites                          example
    irace-package                           example
    irace                                   example
    irace.cmdline                           example
    path_rel2abs                            example
    plotAblation                            example
    printParameters                         example
    psRace                                  example
    readParameters                          example
    read_pcs_file                           example
    scenario_update_paths                   example
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (irace)
Testing examples for package ‘irace’
Error in find.package(package, lib.loc) : 
  there is no package called ‘irace’
Calls: <Anonymous> ... <Anonymous> -> .createExdotR -> Rd_db -> find.package
Execution halted
jimhester commented 2 years ago

This seems to only be true if you are running examples, e.g. if you use type = "tests" or type = "vignettes" it works as expected.

Definitely still an issue, just a reduction in the scope.