Skip to content

Test upkeep - #135

Open
hadley wants to merge 1 commit into
ThinkR-open:mainfrom
hadley:quiet-tests
Open

Test upkeep#135
hadley wants to merge 1 commit into
ThinkR-open:mainfrom
hadley:quiet-tests

Conversation

@hadley

@hadley hadley commented Aug 4, 2026

Copy link
Copy Markdown
  • Convert to testthat 3e
  • Switch to parallel testing (~170s -> ~60s)
  • Don't change global state in helpers.R
  • Add new local_ helpers to quiet all output
  • Add add = TRUE to bare on.exit() calls

I made this because checkhelper fails with the latest version of roxygen2 (just released) to CRAN and I found it very hard to figure out the problem. Hopefully this will help you diagnose it.

* Convert to testthat 3e
* Switch to parallel testing (~170s -> ~60s)
* Don't change global state in `helpers.R`
* Add new `local_` helpers to quiet all output
* Add `add = TRUE` to bare `on.exit()` calls
@VincentGuyader

Copy link
Copy Markdown
Member

thanks a lot

VincentGuyader added a commit that referenced this pull request Aug 8, 2026
The archival trigger is not Fedora specific. CRAN reports ERROR on the four
r-devel Linux flavors (debian and fedora, clang and gcc), on
r-patched-linux-x86_64, on r-release-windows-x86_64 and on
r-oldrel-windows-x86_64, that is on every flavor that has already picked up
roxygen2 8.x. cran-comments.md and NEWS.md both claimed the failure was
limited to the r-devel Fedora flavors.

After the win-builder fix, the first assertion of test-roxygen2-8x-compat.R
could no longer fail for the reason it exists: both roxygen2 lines satisfy
`any(has_fields(c("RoxygenNote", "Config/roxygen2/version")))`, so the guard
verified nothing on any flavor. A new test writes the post-8.x DESCRIPTION
shape by hand (RoxygenNote deleted, Config/roxygen2/version set) and asserts
find_missing_tags() still classifies the fixture, which exercises the exact
broken state everywhere instead of only where the scaffolding toolchain
happens to migrate. The existing test now also asserts that a migrated
DESCRIPTION carries the new field alone.

Config/testthat/parallel arrived with #135 and was not disclosed in this
branch's housekeeping list. It buys nothing on CRAN, where testthat caps at
two workers, and adds a flakiness surface while the package sits under an
archival deadline. Measured cost of running serially: 324s against 233s.
Config/testthat/edition 3, also new with #135, is kept: the rewrites from
`out <- expect_message(f())` to `expect_message(out <- f())` that it requires
are correct and necessary, since edition 3 returns the condition rather than
the value.

Also guard create_example_pkg()'s own example with the same requireNamespace()
pair as the three examples this branch unwrapped from \dontrun{}, move the
CONTRIBUTING.md roxygen2 floor from the stale `> 7.1.2` to `>= 7.3.0` to match
Imports and test-requirements.R, and teach .Rbuildignore to drop *.stackdump:
a Git Bash crash file landing at the repository root is shipped by R CMD build
and raises a "Non-standard file/directory found at top level" NOTE.

Verified on the result: R CMD check --as-cran is Status OK with 0 failures,
601 passing assertions and 8 skips, run once under roxygen2 7.3.3 and once
under roxygen2 8.1.0 in an isolated library.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants