From 8e1ac81e216e61b4d69bd8f1348592a17459ff94 Mon Sep 17 00:00:00 2001 From: Jenny Bryan Date: Thu, 28 Sep 2023 19:38:31 -0700 Subject: [PATCH 1/2] Test housekeeping --- MAINTENANCE.md | 14 ++++++++++++++ tests/testthat.R | 8 ++++++++ tests/testthat/test-check.R | 10 ++++++---- tests/testthat/test-test.R | 2 +- tests/testthat/testVignettes/vignettes/new.Rnw | 4 ++-- .../testthat/testVignettesBuilt/vignettes/new.Rnw | 4 ++-- 6 files changed, 33 insertions(+), 9 deletions(-) diff --git a/MAINTENANCE.md b/MAINTENANCE.md index 9e8aa85a9..267746017 100644 --- a/MAINTENANCE.md +++ b/MAINTENANCE.md @@ -11,3 +11,17 @@ I don't know of any major outstanding issues in devtools itself. The package development cheatsheet likely needs a major overhaul to account for much more functionality in usethis and the current state of devtools. https://github.com/r-lib/devtools/issues/2107 Should devtools be converted to use pak for installation, or should the installation commands be deprecated in devtools and users suggested to use pak directly? + +## R CMD check notes + +devtools has some vintage tests around `.Rnw` vignettes. +It's not clear if it makes sense to keep these, but I (jennybc) am not rushing to remove these tests. +Since I inherited the maintainership of devtools, I have not pursued why 2 of these tests fail locally (they are skipped on GHA). +However, today, I did sort it out and want to record what I did. +In case it comes up in the future, this caused the necessary LaTeX package to be installed: + +``` r +tinytex::parse_install( + text = "! LaTeX Error: File `grfext.sty' not found." +) +``` diff --git a/tests/testthat.R b/tests/testthat.R index 1494911c9..0e95039cd 100644 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -1,3 +1,11 @@ +# This file is part of the standard setup for testthat. +# It is recommended that you do not modify it. +# +# Where should you do additional test configuration? +# Learn more about the roles of various files in: +# * https://r-pkgs.org/testing-design.html#sec-tests-files-overview +# * https://testthat.r-lib.org/articles/special-files.html + library(testthat) library(devtools) diff --git a/tests/testthat/test-check.R b/tests/testthat/test-check.R index 7102bd409..b9542a440 100644 --- a/tests/testthat/test-check.R +++ b/tests/testthat/test-check.R @@ -1,10 +1,12 @@ test_that("can determine when to document", { expect_false(can_document(list())) # TODO: switch to expect_snapshot() - suppressMessages(expect_message( - expect_false(can_document(list(roxygennote = "15.0.00"))), - "doesn't match required" - )) + expect_output( + expect_message( + expect_false(can_document(list(roxygennote = "15.0.00"))), + "doesn't match required" + ) + ) expect_true(can_document(list(roxygennote = packageVersion("roxygen2")))) }) diff --git a/tests/testthat/test-test.R b/tests/testthat/test-test.R index 8ebf00036..69973ac47 100644 --- a/tests/testthat/test-test.R +++ b/tests/testthat/test-test.R @@ -39,7 +39,7 @@ test_that("TESTTHAT_PKG environment variable is set", { filter = "envvar", stop_on_failure = TRUE ) - test_active_file( + test_test_active_file( test_path("testTest/tests/testthat/test-envvar.R"), stop_on_failure = TRUE ) diff --git a/tests/testthat/testVignettes/vignettes/new.Rnw b/tests/testthat/testVignettes/vignettes/new.Rnw index 41d5cdab6..4f839c6c5 100644 --- a/tests/testthat/testVignettes/vignettes/new.Rnw +++ b/tests/testthat/testVignettes/vignettes/new.Rnw @@ -1,5 +1,5 @@ -\documentclass[oneside]{article} +\documentclass{article} \begin{document} Test -\end{document} \ No newline at end of file +\end{document} diff --git a/tests/testthat/testVignettesBuilt/vignettes/new.Rnw b/tests/testthat/testVignettesBuilt/vignettes/new.Rnw index ba3324c98..049fbcb0c 100644 --- a/tests/testthat/testVignettesBuilt/vignettes/new.Rnw +++ b/tests/testthat/testVignettesBuilt/vignettes/new.Rnw @@ -1,6 +1,6 @@ %\VignetteIndexEntry{New} -\documentclass[oneside]{article} +\documentclass{article} \begin{document} <<>>= @@ -8,4 +8,4 @@ library(testVignettesBuilt) function_with_unusual_name() @ -\end{document} \ No newline at end of file +\end{document} From be1fc3115fb326a734bdcc42d96ed33f0c561104 Mon Sep 17 00:00:00 2001 From: Jenny Bryan Date: Thu, 28 Sep 2023 19:38:45 -0700 Subject: [PATCH 2/2] Re-document() --- man/load_all.Rd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/load_all.Rd b/man/load_all.Rd index 04be84337..8221cfd77 100644 --- a/man/load_all.Rd +++ b/man/load_all.Rd @@ -61,7 +61,7 @@ for more details. the correct times. \item If you use \pkg{testthat}, will load all test helpers so you can access them interactively. devtools sets the \code{DEVTOOLS_LOAD} -environment variable to \code{"true"} to let you check whether the +environment variable to the package name to let you check whether the helpers are run during package loading. }