From 29ae88d67948f0f2471782ad819e592006925ce8 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Wed, 11 Oct 2023 21:36:53 +0200 Subject: [PATCH 1/3] Updates for testthat 3.2.0 --- CITATION.cff | 8 +- DESCRIPTION | 2 +- codemeta.json | 4 +- tests/testthat/_snaps/ggcoefstats.md | 2 +- .../ggcoefstats/nas-in-numeric-columns.svg | 140 ------------------ tests/testthat/_snaps/utils.md | 2 +- tests/testthat/helper-state.R | 13 ++ tests/testthat/test-ggcoefstats.R | 26 +--- 8 files changed, 23 insertions(+), 174 deletions(-) delete mode 100644 tests/testthat/_snaps/ggcoefstats/nas-in-numeric-columns.svg create mode 100644 tests/testthat/helper-state.R diff --git a/CITATION.cff b/CITATION.cff index 9bff8cf41..c7499e10c 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -109,7 +109,7 @@ references: abstract: 'datawizard: Easy Data Wrangling and Statistical Transformations' notes: Imports url: https://easystats.github.io/datawizard/ - repository: https://CRAN.R-project.org/package=datawizard + repository: https://easystats.r-universe.dev authors: - family-names: Patil given-names: Indrajeet @@ -447,8 +447,8 @@ references: given-names: Indrajeet email: patilindrajeet.science@gmail.com orcid: https://orcid.org/0000-0003-1995-6531 - year: '2023' version: '>= 1.5.2.9000' + year: '2023' - type: software title: tidyr abstract: 'tidyr: Tidy Messy Data' @@ -696,7 +696,7 @@ references: given-names: Hadley email: hadley@posit.co year: '2023' - version: '>= 3.1.10' + version: '>= 3.2.0' - type: software title: tibble abstract: 'tibble: Simple Data Frames' @@ -748,7 +748,7 @@ references: given-names: Jim - family-names: Henry given-names: Lionel - email: lionel@rstudio.com + email: lionel@posit.co - family-names: Müller given-names: Kirill email: krlmlr+r@mailbox.org diff --git a/DESCRIPTION b/DESCRIPTION index a15165c31..8690e8cec 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -65,7 +65,7 @@ Suggests: psych, rmarkdown, survival, - testthat (>= 3.1.10), + testthat (>= 3.2.0), tibble, vdiffr (>= 1.0.7), withr, diff --git a/codemeta.json b/codemeta.json index 15444dd50..1dd22df06 100644 --- a/codemeta.json +++ b/codemeta.json @@ -220,7 +220,7 @@ "@type": "SoftwareApplication", "identifier": "testthat", "name": "testthat", - "version": ">= 3.1.10", + "version": ">= 3.2.0", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -525,7 +525,7 @@ }, "SystemRequirements": null }, - "fileSize": "9422.075KB", + "fileSize": "9388.713KB", "citation": [ { "@type": "ScholarlyArticle", diff --git a/tests/testthat/_snaps/ggcoefstats.md b/tests/testthat/_snaps/ggcoefstats.md index fe508cca8..b4720ddb3 100644 --- a/tests/testthat/_snaps/ggcoefstats.md +++ b/tests/testthat/_snaps/ggcoefstats.md @@ -2,7 +2,7 @@ The tidy data frame *must* contain 'estimate' column. -# edge cases +# works when CIs unavailable Elements in `term` column must be unique. diff --git a/tests/testthat/_snaps/ggcoefstats/nas-in-numeric-columns.svg b/tests/testthat/_snaps/ggcoefstats/nas-in-numeric-columns.svg deleted file mode 100644 index ae36fd104..000000000 --- a/tests/testthat/_snaps/ggcoefstats/nas-in-numeric-columns.svg +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -β - -= -251.41 -, - -t -( -174 -) -= -36.84 -, - -p -= -4.37e-84 - -β - -= -10.47 -, - -t -( -174 -) -= -6.77 -, - -p -= -1.88e-10 - - -(Intercept) -Days -SD (Intercept) -SD (Days) -Cor (Intercept~Days) -SD (Observations) - - - - - - - - - -0 -100 -200 -estimate -term -A -I -C -= -1756 -, - -B -I -C -= -1775 - - diff --git a/tests/testthat/_snaps/utils.md b/tests/testthat/_snaps/utils.md index bec5eb611..61fa670d9 100644 --- a/tests/testthat/_snaps/utils.md +++ b/tests/testthat/_snaps/utils.md @@ -20,7 +20,7 @@ Code .is_palette_sufficient("RColorBrewer", "Dark2", 20L) - Message + Message Number of labels is greater than default palette color count. * Select another color `palette` (and/or `package`). Output diff --git a/tests/testthat/helper-state.R b/tests/testthat/helper-state.R new file mode 100644 index 000000000..d1f98912c --- /dev/null +++ b/tests/testthat/helper-state.R @@ -0,0 +1,13 @@ +testthat::set_state_inspector(function() { + list( + attached = search(), + connections = nrow(showConnections()), + cwd = getwd(), + envvars = Sys.getenv(), + libpaths = .libPaths(), + locale = Sys.getlocale(), + options = .Options, + packages = .packages(all.available = TRUE), + NULL + ) +}) diff --git a/tests/testthat/test-ggcoefstats.R b/tests/testthat/test-ggcoefstats.R index 1ec7d8c84..bebd572ba 100644 --- a/tests/testthat/test-ggcoefstats.R +++ b/tests/testthat/test-ggcoefstats.R @@ -131,31 +131,7 @@ test_that( # edge cases ------------------------------------- test_that( - desc = "missing values in numeric columns", - code = { - skip_if_not_installed("lme4") - skip_on_os(c("windows", "linux", "solaris")) - - withr::local_package("lme4") - m_lmer <- ggcoefstats( - lme4::lmer(Reaction ~ Days + (Days | Subject), - data = lme4::sleepstudy - ) - ) - - expect_s3_class(m_lmer, "ggplot") - - skip_on_os("mac", c("i386", "x86_64")) - set.seed(123) - expect_doppelganger( - title = "NAs in numeric columns", - fig = m_lmer - ) - } -) - -test_that( - desc = "edge cases", + desc = "works when CIs unavailable", code = { set.seed(123) df_base <- tidy_model_parameters(stats::lm(wt ~ am * cyl, mtcars)) From bb2734530e205d809fbd07142af5176195464f40 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Wed, 11 Oct 2023 21:56:01 +0200 Subject: [PATCH 2/3] upgrade to latest version of deps --- .github/workflows/R-CMD-check-devel.yaml | 1 + .github/workflows/R-CMD-check-hard.yaml | 1 + .github/workflows/R-CMD-check-strict.yaml | 1 + .github/workflows/R-CMD-check.yaml | 1 + .github/workflows/check-all-examples.yaml | 1 + .github/workflows/check-link-rot.yaml | 1 + .github/workflows/check-random-test-order.yaml | 1 + .github/workflows/check-readme.yaml | 1 + .github/workflows/check-spelling.yaml | 1 + .github/workflows/check-test-warnings.yaml | 1 + .github/workflows/check-vignette-warnings.yaml | 1 + .github/workflows/html-5-check.yaml | 1 + .github/workflows/lint-changed-files.yaml | 2 ++ .github/workflows/lint.yaml | 1 + .github/workflows/pkgdown-no-suggests.yaml | 1 + .github/workflows/pkgdown.yaml | 1 + .github/workflows/styler.yaml | 1 + .github/workflows/test-coverage-examples.yaml | 1 + .github/workflows/test-coverage.yaml | 1 + 19 files changed, 20 insertions(+) diff --git a/.github/workflows/R-CMD-check-devel.yaml b/.github/workflows/R-CMD-check-devel.yaml index c743ddb47..f929f88ef 100644 --- a/.github/workflows/R-CMD-check-devel.yaml +++ b/.github/workflows/R-CMD-check-devel.yaml @@ -31,6 +31,7 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: pak-version: devel + upgrade: 'TRUE' needs: check cache: false extra-packages: | diff --git a/.github/workflows/R-CMD-check-hard.yaml b/.github/workflows/R-CMD-check-hard.yaml index d85fc6434..1c6e26cbc 100644 --- a/.github/workflows/R-CMD-check-hard.yaml +++ b/.github/workflows/R-CMD-check-hard.yaml @@ -36,6 +36,7 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: pak-version: devel + upgrade: 'TRUE' dependencies: '"hard"' cache: false extra-packages: | diff --git a/.github/workflows/R-CMD-check-strict.yaml b/.github/workflows/R-CMD-check-strict.yaml index 9a1a707a8..941aba516 100644 --- a/.github/workflows/R-CMD-check-strict.yaml +++ b/.github/workflows/R-CMD-check-strict.yaml @@ -50,6 +50,7 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: pak-version: devel + upgrade: 'TRUE' needs: check extra-packages: | any::rcmdcheck diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index cd217c11a..0e06f9f77 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -52,6 +52,7 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: pak-version: devel + upgrade: 'TRUE' extra-packages: | any::rcmdcheck needs: check diff --git a/.github/workflows/check-all-examples.yaml b/.github/workflows/check-all-examples.yaml index 1abe1f719..ba24579e9 100644 --- a/.github/workflows/check-all-examples.yaml +++ b/.github/workflows/check-all-examples.yaml @@ -36,6 +36,7 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: pak-version: devel + upgrade: 'TRUE' extra-packages: | any::devtools local::. diff --git a/.github/workflows/check-link-rot.yaml b/.github/workflows/check-link-rot.yaml index 80c14c184..229bf63aa 100644 --- a/.github/workflows/check-link-rot.yaml +++ b/.github/workflows/check-link-rot.yaml @@ -31,6 +31,7 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: pak-version: devel + upgrade: 'TRUE' dependencies: '"hard"' extra-packages: | any::rcmdcheck diff --git a/.github/workflows/check-random-test-order.yaml b/.github/workflows/check-random-test-order.yaml index 70b68ff0d..c8bccdc88 100644 --- a/.github/workflows/check-random-test-order.yaml +++ b/.github/workflows/check-random-test-order.yaml @@ -24,6 +24,7 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: pak-version: devel + upgrade: 'TRUE' extra-packages: | local::. needs: check diff --git a/.github/workflows/check-readme.yaml b/.github/workflows/check-readme.yaml index 6ed5585da..1365cb943 100644 --- a/.github/workflows/check-readme.yaml +++ b/.github/workflows/check-readme.yaml @@ -40,6 +40,7 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: pak-version: devel + upgrade: 'TRUE' extra-packages: | deps::. any::ggstatsplot diff --git a/.github/workflows/check-spelling.yaml b/.github/workflows/check-spelling.yaml index 5b1ad61b1..562c88356 100644 --- a/.github/workflows/check-spelling.yaml +++ b/.github/workflows/check-spelling.yaml @@ -30,6 +30,7 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: pak-version: devel + upgrade: 'TRUE' dependencies: '"hard"' extra-packages: | any::rcmdcheck diff --git a/.github/workflows/check-test-warnings.yaml b/.github/workflows/check-test-warnings.yaml index 76e058592..8dc3c858e 100644 --- a/.github/workflows/check-test-warnings.yaml +++ b/.github/workflows/check-test-warnings.yaml @@ -24,6 +24,7 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: pak-version: devel + upgrade: 'TRUE' extra-packages: | local::. any::devtools diff --git a/.github/workflows/check-vignette-warnings.yaml b/.github/workflows/check-vignette-warnings.yaml index d6bf0954e..0bee20d83 100644 --- a/.github/workflows/check-vignette-warnings.yaml +++ b/.github/workflows/check-vignette-warnings.yaml @@ -28,6 +28,7 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: pak-version: devel + upgrade: 'TRUE' extra-packages: | local::. needs: check diff --git a/.github/workflows/html-5-check.yaml b/.github/workflows/html-5-check.yaml index 8dc89709e..36acbd807 100644 --- a/.github/workflows/html-5-check.yaml +++ b/.github/workflows/html-5-check.yaml @@ -25,6 +25,7 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: pak-version: devel + upgrade: 'TRUE' extra-packages: | any::rcmdcheck any::V8 diff --git a/.github/workflows/lint-changed-files.yaml b/.github/workflows/lint-changed-files.yaml index 216c12138..f5503c236 100644 --- a/.github/workflows/lint-changed-files.yaml +++ b/.github/workflows/lint-changed-files.yaml @@ -20,6 +20,8 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: + pak-version: devel + upgrade: 'TRUE' extra-packages: | any::gh r-lib/lintr diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 8b3287d67..6ee48e52c 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -27,6 +27,7 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: pak-version: devel + upgrade: 'TRUE' extra-packages: | r-lib/lintr local::. diff --git a/.github/workflows/pkgdown-no-suggests.yaml b/.github/workflows/pkgdown-no-suggests.yaml index 12ea24c10..c910c134a 100644 --- a/.github/workflows/pkgdown-no-suggests.yaml +++ b/.github/workflows/pkgdown-no-suggests.yaml @@ -34,6 +34,7 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: pak-version: devel + upgrade: 'TRUE' dependencies: '"hard"' cache: false extra-packages: | diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 026d7950a..423459519 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -34,6 +34,7 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: pak-version: devel + upgrade: 'TRUE' extra-packages: | r-lib/pkgdown r-lib/vdiffr diff --git a/.github/workflows/styler.yaml b/.github/workflows/styler.yaml index 47adf36ac..6b7574db0 100644 --- a/.github/workflows/styler.yaml +++ b/.github/workflows/styler.yaml @@ -24,6 +24,7 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: pak-version: devel + upgrade: 'TRUE' dependencies: '"hard"' extra-packages: | local::. diff --git a/.github/workflows/test-coverage-examples.yaml b/.github/workflows/test-coverage-examples.yaml index 7c8dd08bb..357c64d0d 100644 --- a/.github/workflows/test-coverage-examples.yaml +++ b/.github/workflows/test-coverage-examples.yaml @@ -25,6 +25,7 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: pak-version: devel + upgrade: 'TRUE' extra-packages: | any::covr local::. diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 733d809e7..ccd32f20f 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -24,6 +24,7 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: pak-version: devel + upgrade: 'TRUE' extra-packages: | any::covr needs: coverage From 5a9e971750cdcd29dbabb460a8eb186077cceb08 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Wed, 11 Oct 2023 22:04:16 +0200 Subject: [PATCH 3/3] no need for devel vdiffr anymore --- DESCRIPTION | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 8690e8cec..79d5fdc3b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -84,6 +84,4 @@ Roxygen: list( RoxygenNote: 7.2.3.9000 Config/testthat/edition: 3 Config/testthat/parallel: true -Config/Needs/check: - anthonynorth/roxyglobals, - r-lib/vdiffr +Config/Needs/check: anthonynorth/roxyglobals