Skip to content

Assert stillZero() results in license and NEWS tests - #275

Merged
LiNk-NY merged 2 commits into
develfrom
stillzero-assertions
Dec 3, 2026
Merged

LiNk-NY merged 2 commits into
develfrom
stillzero-assertions

Conversation

@LiNk-NY

@LiNk-NY LiNk-NY commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Three bare stillZero() calls in inst/tinytest/test_BiocCheck.R asserted nothing, because stillZero() returns a logical rather than recording a test. Noted as out of scope in #274.

Changes

  • Wrap the three calls in expect_true(): two after checkLicenseForRestrictiveUse() and one after checkNEWS() with a plain NEWS file.
  • The first license test used "GPL-3.0". That isn't in R's license database, where it is spelled GPL-3, so the check raised an "unknown license" NOTE that went unnoticed. The test now uses "GPL-3". The analyze_licenses section already asserts that "GPL-3.0" gives exactly one NOTE.
  • The checkNEWS() tests now delete the NEWS.md and inst/NEWS.Rd files they create. Otherwise a second run of the file in the same R session finds three NEWS files and fails the new assertion.

tools:::analyze_licenses() gives the same result on R-devel and R 4.6.2: GPL-3.0 is unverified, while GPL-3 and GPL (>= 3) are verified and don't restrict use.

The bare call at inst/tinytest/test_checkDESCRIPTION.R:58 is the body of a multi-line expect_true(), so it is already asserted and was left as is.

Checks

  • inst/tinytest/test_BiocCheck.R passes 169 of 169 on R-devel (2026-12-02 r91021) with Bioc 3.25, including when run twice in one R session.

🤖 Generated with Claude Code

Three bare stillZero() calls in test_BiocCheck.R asserted nothing.
Wrap them in expect_true().

The first used "GPL-3.0", which is not in R's license database (R
spells it "GPL-3"), so checkLicenseForRestrictiveUse() raised an
'unknown license' NOTE that went unnoticed. Test "GPL-3" for no
conditions, and add a test that "GPL-3.0" gives exactly one NOTE.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread inst/tinytest/test_BiocCheck.R Resolved
@claude

claude Bot commented Dec 3, 2026

Copy link
Copy Markdown

Nothing blocking. The three stillZero() calls are now asserted, and the GPL-3 / GPL-3.0 split matches the PR description. One nit, left inline: the label on the new checkCounter() call reads inverted on failure. No exported functions or docs are touched, so there is nothing to document.

@codecov

codecov Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.21%. Comparing base (46a92f4) to head (a628ffd).

Additional details and impacted files
@@           Coverage Diff           @@
##            devel     #275   +/-   ##
=======================================
  Coverage   70.21%   70.21%           
=======================================
  Files          15       15           
  Lines        2793     2793           
=======================================
  Hits         1961     1961           
  Misses        832      832           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

The checkNEWS tests left NEWS.md and inst/NEWS.Rd in the session's
temporary package folder, so a second run of test_BiocCheck.R in the
same R session found three NEWS files and failed the new stillZero()
assertion. Remove them at the end of the section.

Drop the GPL-3.0 test added in the previous commit: the
analyze_licenses section already asserts one NOTE for GPL-3.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@LiNk-NY

LiNk-NY commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

Claude Code reviewed this change at 46f7660 for the author: 4 findings, 2 fixed.

  • inst/tinytest/test_BiocCheck.R:1179: the NEWS tests left NEWS.md and inst/NEWS.Rd in the session's temporary package folder, so a second run of the file in the same R session failed the new stillZero() assertion. Fixed in a628ffd.
  • inst/tinytest/test_BiocCheck.R:225: the new GPL-3.0 test repeated the one in the analyze_licenses section. Fixed in a628ffd by removing it. The PR description still mentions it.
  • R/checks.R:505: checkNEWS() uses a character class rather than alternation in its file pattern and searches recursively, so stray files can match and the file it parses may not be the one news() reads. Left: this was already there and is outside this PR's scope.
  • R/checkDESCRIPTION.R:297: checkLicenseForRestrictiveUse() assumes analyze_licenses() returns exactly one row. Left: this was already there and is outside this PR's scope.

Drafted with Claude Opus 5.5

@LiNk-NY
LiNk-NY merged commit 56333c3 into devel Dec 3, 2026
9 checks passed
@LiNk-NY
LiNk-NY deleted the stillzero-assertions branch December 3, 2026 04:19
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.

1 participant