`covr` does not register `tinysnapshot` tests
#29 opened on Feb 4, 2026
Repository metrics
- Stars
- (18 stars)
- PR merge metrics
- (PR metrics pending)
Description
Summary
covr::package_coverage does not register the coverage of functions run by tinysnapshot via tinytest
Steps to Reproduce
- Set up a minimal package with tinytest testing.
- Add a simple base-r plotting function.
- Add a test of your function using
tinysnapshot. - Run covr::package_coverage.
Expected behavior: Plotting function shown as covered. Actual behavior: Plotting function shown as not covered.
MRE
I've set up such a simple package here: https://github.com/katrinabrock/minimal-r-package/tree/main/inner-pkgs/myinnerpkg
Script to reproduce here: https://github.com/katrinabrock/minimal-r-package/blob/7c54e0bf7937f070ee483d51685bd83ea8566f04/covr-tinysnapshot-incompatibility.R
More Details
Running the test script directly with covr::file_coverage does result in the coverage properly being registered. Based on my tests, things only break when tinytest::run_dir or tinytest::run_package are involved.
I'm not 100% sure that this issue is with tinysnapshot and not with covr or tinytest, but I have to start somewhere. For non-tinysnapshot tests, covr and tinytest seem to work together fine.
In other words,
- tinytest + covr -> coverage reported correctly
- tinysnapshot + covr -> coverage reported correctly
- tinytest + tinysnapshot + covr -> coverage not reported
[ins] r$> sessionInfo()
R version 4.5.0 (2025-04-11)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 24.04.2 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.26.so; LAPACK version 3.12.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=de_DE.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=de_DE.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=de_DE.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=C
time zone: Europe/Berlin
tzcode source: system (glibc)
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] myinnerpkg_1.0 tinysnapshot_0.2.0 tinytest_1.4.1
loaded via a namespace (and not attached):
[1] digest_0.6.39 magrittr_2.0.4 pkgload_1.4.0 fastmap_1.2.0
[5] rprojroot_2.1.1 jsonlite_2.0.0 processx_3.8.6 pkgbuild_1.4.8
[9] sessioninfo_1.2.3 brio_1.1.5 urlchecker_1.0.1 ps_1.9.1
[13] promises_1.3.3 httr_1.4.7 purrr_1.1.0 lazyeval_0.2.2
[17] cli_3.6.5 shiny_1.11.1 rlang_1.1.7 covr_3.6.5
[21] ellipsis_0.3.2 remotes_2.5.0 withr_3.0.2 cachem_1.1.0
[25] devtools_2.4.5 tools_4.5.0 parallel_4.5.0 memoise_2.0.1
[29] httpuv_1.6.16 vctrs_0.6.5 R6_2.6.1 mime_0.13
[33] lifecycle_1.0.5 magick_2.9.0 rsvg_2.7.0 fs_1.6.6
[37] htmlwidgets_1.6.4 usethis_3.1.0 miniUI_0.1.2 pkgconfig_2.0.3
[41] desc_1.4.3 callr_3.7.6 rex_1.2.1 pillar_1.11.1
[45] later_1.4.2 glue_1.8.0 profvis_0.4.0 Rcpp_1.1.1
[49] tibble_3.3.1 xtable_1.8-4 htmltools_0.5.8.1 functionrunner_1.0