Skip to content

Commit

Permalink
Fix error on coverage workflow (#745)
Browse files Browse the repository at this point in the history
# Pull Request

Fixes #746

`{covr}` doesn't have access to the `man` page anywhere in the file
structure.

The symlink of `man` on the `testthat` folder triggers a full copy
during `{covr}`. This is a promising approach, however, I cannot observe
that the tests are being run and needs further investigation.

#### Changes description

-  use `testthat::skip` instead of `stop` when there is a problem
- `TESTING_DEPTH` is not yet set to `5` on this CI, therefore the
shinytest2 tests are not being run.
- Keep symlink to support testing examples during examples in the future
  • Loading branch information
averissimo authored Apr 26, 2024
1 parent ba3ade9 commit 024e388
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/testthat/test-examples.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
# this also requires `devtools::document()` to be run before running the tests

rd_files <- function() {
man_path <- if (testthat::is_checking()) {
man_path <- if (testthat::is_checking() && identical(Sys.getenv("R_COVR"), "true")) {
testthat::test_path("man")
} else if (testthat::is_checking()) {
testthat::test_path("..", "..", "00_pkg_src", testthat::testing_package(), "man")
} else {
testthat::test_path("..", "..", "man")
}

if (!dir.exists(man_path)) {
stop("Cannot find path to `man` directory.")
}
testthat::skip_if_not(dir.exists(man_path), "Cannot find path to `man` directory.")

list.files(
man_path,
Expand Down

0 comments on commit 024e388

Please sign in to comment.