Skip to content

Load xml2 for JunitReporter under _R_CHECK_SUGGESTS_ONLY_ - #40

Merged
lwaldron merged 2 commits into
mainfrom
fix-junit-xml2-libpath
Nov 5, 2026
Merged

lwaldron merged 2 commits into
mainfrom
fix-junit-xml2-libpath

Conversation

@lwaldron

@lwaldron lwaldron commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to #39, which wrote no junit.xml in practice (seen in waldronlab/bugphyzz#278, where a failing test should have been uploaded).

The Bioconductor container sets _R_CHECK_SUGGESTS_ONLY_=true, so R CMD check runs the tests with a library of only the package's declared dependencies. xml2, which JunitReporter needs, is usually not among them, and the guard added in #39 then skipped the hook.

The hook now loads the xml2 namespace from the library the workflow installed it in, passed as TESTTHAT_JUNIT_XML2_LIB, without adding that library to .libPaths(), so undeclared dependencies are still exposed. ADR 0014 is updated to match.

Tested in bioconductor/bioconductor_docker:devel through rcmdcheck, using the step scripts extracted from this workflow:

  • serial package with a failing test: junit.xml with 4 testcases and 1 failure, check output unchanged
  • Config/testthat/parallel: true: same
  • .libPaths() in the tests unchanged, and an undeclared site package (DT) still invisible
  • xml2 not loadable: no junit.xml, check unchanged

🤖 Generated with Claude Code

Co-authored-by: Claude Code <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Maintainer validation is still needed for the R CMD check startup and library-isolation assumptions, external Codecov upload behavior, and the potential for globally loading xml2 to mask undeclared dependencies.

No open issues 🎉

What changed in this PR

This pull request updates the Codecov Test Analytics integration so JunitReporter can load xml2 during Bioconductor checks using _R_CHECK_SUGGESTS_ONLY_, while retaining the existing reporter fallback.

Changes:

  • Passes the workflow-installed xml2 library to the test process.
  • Loads xml2 without modifying .libPaths().
  • Documents the workaround and fallback behavior in ADR 0014.
  • Requires follow-up for the moderate concern that globally loading xml2 may expose it and its imported namespaces to package tests, weakening undeclared-dependency checking.
File Summary
.github/​workflows/​bioccheck.yml Configures xml2 loading for JUnit reporting and passes its installation library into R CMD check; the global namespace loading behavior has an unresolved dependency-isolation concern.
docs/​adr/​0014-codecov-test-analytics.md Documents the _R_CHECK_SUGGESTS_ONLY_ workaround, library-loading behavior, and fallback when xml2 is unavailable.

Review effort: Lite

Co-authored-by: Claude Code <noreply@anthropic.com>
@lwaldron
lwaldron merged commit d77d800 into main Nov 5, 2026
1 check passed
@lwaldron
lwaldron deleted the fix-junit-xml2-libpath branch November 5, 2026 17:45
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