Skip to content

Handle _R_CHECK_DEPENDS_ONLY_ correctly for other.Rraw to work in -occasional CI#7832

Open
MichaelChirico wants to merge 7 commits into
fix-latvian-testsfrom
occasional-fix
Open

Handle _R_CHECK_DEPENDS_ONLY_ correctly for other.Rraw to work in -occasional CI#7832
MichaelChirico wants to merge 7 commits into
fix-latvian-testsfrom
occasional-fix

Conversation

@MichaelChirico

@MichaelChirico MichaelChirico commented Jul 23, 2026

Copy link
Copy Markdown
Member

** NB: currently targeting #7837 **

This should resolve the main issue with other.Rraw failing broadly.

This GHA-only fix was diagnosed and fixed by Gemini (to be precise: any change written by Gemini is kept pristine and annotated in the commit message). That diagnosis (lightly edited) follows:


Setting _R_CHECK_DEPENDS_ONLY_: false in .github/workflows/R-CMD-check-occasional.yaml overrides a default behavior of --as-cran in R CMD check that hides optional packages from the test suite:

1. Default Behavior of --as-cran in R CMD check

Under --as-cran, R automatically enables _R_CHECK_DEPENDS_ONLY_=true:

check_args = c("--no-manual", "--as-cran")

When active, R creates a restricted, temporary library (.libPaths()) during the check containing only the packages explicitly listed in DESCRIPTION (Depends, Imports, Suggests, and Enhances), plus base/recommended R packages. Any other packages installed on the system are hidden from the search path during test execution.

2. Why This Broke other.Rraw in CI

In step 82 of R-CMD-check-occasional.yaml, the workflow installs "fully optional packages" (other_pkgs such as caret, dplyr, ggplot2, sf, vctrs, etc.) so they can be tested for interoperability in inst/tests/other.Rraw. These optional packages are intentionally not listed in data.table's DESCRIPTION file.

Because they are omitted from DESCRIPTION, --as-cran stripped them from .libPaths() during check execution. Even though the step successfully installed all 19 optional packages and set TEST_DATA_TABLE_WITH_OTHER_PACKAGES=TRUE, inside R CMD check, other.Rraw could not find them and aborted across all CI runners with:

test.data.table('other.Rraw') failed to attach required package(s): caret, DBI, dplyr, gdata, ggplot2, hexbin, knitr, nanotime, nlme, plyr, RSQLite, sf, vctrs.

3. Effect of the Change

By explicitly setting _R_CHECK_DEPENDS_ONLY_: false, we prevent R CMD check from isolating the check library strictly to DESCRIPTION dependencies. This allows other.Rraw to see and attach the optional packages installed in the runner library during the check.

@MichaelChirico MichaelChirico changed the title Handle _R_CHECK_DEPENDS_ONLY_ correctly for other.Rraw Handle _R_CHECK_DEPENDS_ONLY_ correctly for other.Rraw to work in -occasional CI Jul 23, 2026
@MichaelChirico
MichaelChirico changed the base branch from master to other-attach-order July 23, 2026 22:52
@MichaelChirico
MichaelChirico force-pushed the occasional-fix branch 3 times, most recently from dcbf1f9 to 0dec4cc Compare July 23, 2026 23:17
@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
  • HEAD=occasional-fix much faster for as.data.table.array improved in #7019
  • HEAD=occasional-fix much faster for transform improved in #5493
    Comparison Plot

Generated via commit d04e4a2

Download link for the artifact containing the test results: ↓ atime-results.zip

Task Duration
R setup and installing dependencies 2 minutes and 53 seconds
Installing different package versions 1 minutes and 10 seconds
Running and plotting the test cases 7 minutes and 34 seconds

@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.01%. Comparing base (f93fce1) to head (ab2efd5).

Additional details and impacted files
@@                 Coverage Diff                 @@
##           test-err-show-diff    #7832   +/-   ##
===================================================
  Coverage               99.01%   99.01%           
===================================================
  Files                      88       88           
  Lines                   17234    17234           
===================================================
  Hits                    17065    17065           
  Misses                    169      169           

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

@MichaelChirico
MichaelChirico changed the base branch from other-attach-order to test-err-show-diff July 24, 2026 13:58
@MichaelChirico
MichaelChirico force-pushed the occasional-fix branch 2 times, most recently from 44d6f05 to 8917b16 Compare July 24, 2026 14:21
@MichaelChirico
MichaelChirico force-pushed the test-err-show-diff branch 2 times, most recently from 6f23983 to f93fce1 Compare July 24, 2026 16:48
@MichaelChirico
MichaelChirico force-pushed the occasional-fix branch 4 times, most recently from c6a3e01 to ab2efd5 Compare July 24, 2026 22:35
@MichaelChirico
MichaelChirico changed the base branch from test-err-show-diff to fix-latvian-tests July 26, 2026 17:04
@MichaelChirico
MichaelChirico force-pushed the fix-latvian-tests branch 2 times, most recently from 995819c to d56f300 Compare July 26, 2026 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant