Skip to content

Test parse error reporting for R, Rd, and vignette files - #274

Merged
LiNk-NY merged 1 commit into
develfrom
parse-error-tests
Dec 3, 2026
Merged

LiNk-NY merged 1 commit into
develfrom
parse-error-tests

Conversation

@LiNk-NY

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

Copy link
Copy Markdown
Contributor

Follow-up to the review on #270.

Changes

  • .parseError() now builds the empty parse data frame explicitly (.emptyParseData()) instead of relying on getParseData(parse(text = "")). That call does return a 0-row, 9-column data frame on current R, so this is hardening, not a bug fix.
  • Tests for each branch of .parseError():
    • Rd: the reported ERROR names man/broken.Rd and notes that line numbers refer to the extracted examples. The empty result has the same columns as getParseData().
    • .R: the message names broken.R, with no line-number note. The broken file is dropped from the parsed code, and a good file in the same package is kept.
    • Vignette: the message notes that line numbers refer to the tangled R code, and the file is dropped.
  • checkVigSessionInfo() and checkVigEvalAllFalse() skip an unparseable vignette without raising any condition.

Review point (1) on #270 said the existing test could pass if the file was dropped for any reason. The checkCounter() call already asserted exactly one ERROR, but the new tests also check the message text.

Checks

  • inst/tinytest/test_BiocCheck.R passes 166 of 166 on R-devel (2026-12-02 r91021) with Bioc 3.25.

Not in this PR: at inst/tinytest/test_BiocCheck.R:216, a bare stillZero() after checkLicenseForRestrictiveUse("GPL-3.0") asserts nothing. That check actually raises a NOTE ("License 'GPL-3.0' unknown"). The bare calls at lines 220 and 1116 are also no-ops. These are best handled separately.

🤖 Generated with Claude Code

Follow-up to the review on #270.

- Build the empty parse data frame explicitly instead of relying on
  getParseData(parse(text = "")).
- Assert that the reported error names the source file, for Rd, R and
  vignette files, and that only Rd and vignette messages note that line
  numbers refer to extracted or tangled code.
- Check that checkVigSessionInfo() and checkVigEvalAllFalse() skip an
  unparseable vignette without raising conditions.

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

claude Bot commented Dec 3, 2026

Copy link
Copy Markdown

I found nothing worth raising. .emptyParseData() has the same nine columns as getParseData(), and the new tests assert that match. checkCounter() zeroes the counters, so the stillZero() call in the vignette test is meaningful. The change adds no exported functions, so there are no man/ or NAMESPACE updates to check. I did not run the test suite.

@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 (bab59ed) to head (36d7f18).
⚠️ Report is 1 commits behind head on devel.

Additional details and impacted files
@@            Coverage Diff             @@
##            devel     #274      +/-   ##
==========================================
+ Coverage   70.07%   70.21%   +0.13%     
==========================================
  Files          15       15              
  Lines        2787     2793       +6     
==========================================
+ Hits         1953     1961       +8     
+ Misses        834      832       -2     

☔ 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.

@LiNk-NY
LiNk-NY merged commit 27c9f42 into devel Dec 3, 2026
7 checks passed
@LiNk-NY
LiNk-NY deleted the parse-error-tests branch December 3, 2026 03:12
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