diff --git a/.github/workflows/test-package-vigilant.yaml b/.github/workflows/test-package-vigilant.yaml index 414385293..b73062cc9 100644 --- a/.github/workflows/test-package-vigilant.yaml +++ b/.github/workflows/test-package-vigilant.yaml @@ -22,7 +22,9 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: local::. + extra-packages: | + local::. + any::purrr - name: Run Tests run: | @@ -35,5 +37,11 @@ jobs: warnPartialMatchDollar = TRUE ) if (Sys.getenv("_R_CHECK_FORCE_SUGGESTS_", "") == "") Sys.setenv("_R_CHECK_FORCE_SUGGESTS_" = "false") - testthat::test_dir("tests") + pkgload::load_all() + test_script_paths <- testthat::find_test_scripts("tests/testthat") + test_with_warning_as_error <- function(path) { + withr::local_options(list(warn = 2L)) + testthat::test_file(path, stop_on_failure = TRUE, stop_on_warning = TRUE) + } + purrr::walk(test_script_paths, test_with_warning_as_error) shell: Rscript {0} diff --git a/DESCRIPTION b/DESCRIPTION index 87ec42de2..c1768ba04 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -53,6 +53,7 @@ VignetteBuilder: Config/Needs/website: tidyverse/tidytemplate Config/Needs/development: pkgload, cli, testthat, patrick Config/testthat/edition: 3 +Config/testthat/parallel: true Encoding: UTF-8 Roxygen: list(markdown = TRUE) RoxygenNote: 7.3.2