From fc094b109464bf9fa5a3f85d25cae8b03165f858 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Fri, 17 Nov 2023 08:19:14 +0100 Subject: [PATCH 1/4] Check if parallel testing reduces check time in CI Related to #2295 --- DESCRIPTION | 1 + 1 file changed, 1 insertion(+) diff --git a/DESCRIPTION b/DESCRIPTION index 5bda22901..c59c92c91 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -54,6 +54,7 @@ VignetteBuilder: knitr Config/Needs/website: tidyverse/tidytemplate Config/testthat/edition: 3 +Config/testthat/parallel: true Encoding: UTF-8 Roxygen: list(markdown = TRUE) RoxygenNote: 7.2.3 From e9b2bdc209d23abdf787ca5661d4fc994a1fea19 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Sun, 26 May 2024 09:46:22 +0200 Subject: [PATCH 2/4] make vigilant workflow parallel-compatible --- .github/workflows/test-package-vigilant.yaml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-package-vigilant.yaml b/.github/workflows/test-package-vigilant.yaml index d7c7c7047..87c54519b 100644 --- a/.github/workflows/test-package-vigilant.yaml +++ b/.github/workflows/test-package-vigilant.yaml @@ -22,12 +22,18 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: local::. + extra-packages: | + local::. + any::purrr - name: Run Tests run: | - ## -------------------------------------------------------------------- - options(crayon.enabled = TRUE, warn = 2L) - if (Sys.getenv("_R_CHECK_FORCE_SUGGESTS_", "") == "") Sys.setenv("_R_CHECK_FORCE_SUGGESTS_" = "false") - testthat::test_dir("tests") + options(crayon.enabled = TRUE) + pkgload::load_all() + test_script_paths <- testthat::find_test_scripts("tests/testthat") + test_with_warning_as_error <- function(...) { + withr::local_options(list(warn = 2L)) + testthat::test_file(...) + } + purrr::walk(test_script_paths, test_with_warning_as_error) shell: Rscript {0} From cc273e645663d7b2f92a393ebfe136a82662dc94 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Sun, 26 May 2024 11:28:56 +0200 Subject: [PATCH 3/4] Update test-package-vigilant.yaml --- .github/workflows/test-package-vigilant.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-package-vigilant.yaml b/.github/workflows/test-package-vigilant.yaml index 87c54519b..f440986a9 100644 --- a/.github/workflows/test-package-vigilant.yaml +++ b/.github/workflows/test-package-vigilant.yaml @@ -31,9 +31,9 @@ jobs: options(crayon.enabled = TRUE) pkgload::load_all() test_script_paths <- testthat::find_test_scripts("tests/testthat") - test_with_warning_as_error <- function(...) { + test_with_warning_as_error <- function(path) { withr::local_options(list(warn = 2L)) - testthat::test_file(...) + 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} From 063e5527e406e09640de082e03df5a269d78d5b1 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Tue, 3 Dec 2024 08:55:06 +0100 Subject: [PATCH 4/4] retain options on main --- .github/workflows/test-package-vigilant.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-package-vigilant.yaml b/.github/workflows/test-package-vigilant.yaml index f440986a9..b73062cc9 100644 --- a/.github/workflows/test-package-vigilant.yaml +++ b/.github/workflows/test-package-vigilant.yaml @@ -28,7 +28,15 @@ jobs: - name: Run Tests run: | - options(crayon.enabled = TRUE) + ## -------------------------------------------------------------------- + options( + crayon.enabled = TRUE, + warn = 2L, + warnPartialMatchArgs = TRUE, + warnPartialMatchAttr = TRUE, + warnPartialMatchDollar = TRUE + ) + if (Sys.getenv("_R_CHECK_FORCE_SUGGESTS_", "") == "") Sys.setenv("_R_CHECK_FORCE_SUGGESTS_" = "false") pkgload::load_all() test_script_paths <- testthat::find_test_scripts("tests/testthat") test_with_warning_as_error <- function(path) {