Skip to content

test: run the offline tests on CRAN and r-universe - #245

Merged
samuelbharti merged 1 commit into
masterfrom
test/offline-tests-on-cran
Oct 10, 2026
Merged

samuelbharti merged 1 commit into
masterfrom
test/offline-tests-on-cran

Conversation

@samuelbharti

@samuelbharti samuelbharti commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Closes #221.

tests/test-all.R ran the suite only when NOT_CRAN was "true". CRAN and r-universe leave it unset, so a passing check there had not run a single test.

The gate is gone. Each of the 15 test files that call NCBI now starts with skip_on_cran(), as does the one live test in test_link_byid.r. test_httr.r counts as live because it opens a connection through a fake proxy. Four files need no network and now run everywhere: test_errors.r, test_link_errors.r, test_api_key.r and test_helper_ncbi.r, along with the offline test in test_link_byid.r. One offline test sat in test_summary.r, which now skips on CRAN as a whole, and it moved to test_errors.r.

testthat 3.2.2 fails on a skip placed outside a test, a bug fixed in 3.2.3. DESCRIPTION now asks for testthat 3.2.3 or later.

CI still runs the whole suite, because devtools::check() and the r-lib GitHub Actions set NOT_CRAN. The PR template now tells contributors to start a test file that calls NCBI with skip_on_cran().

Checked with R CMD check, NOT_CRAN unset and the network blocked: Status OK, [ FAIL 0 | WARN 0 | SKIP 16 | PASS 94 ]. Every one of the 16 skips gives "On CRAN" as its reason, so no test tried to reach NCBI.

tests/test-all.R ran the suite only when NOT_CRAN was "true". CRAN and
r-universe leave it unset, so a passing check there had not run a single
test.

The gate is gone. Each of the 15 test files that call NCBI now starts
with skip_on_cran(), as does the one live test in test_link_byid.r.
test_httr.r counts as live because it opens a connection through a fake
proxy. Four files need no network and now run everywhere: test_errors.r,
test_link_errors.r, test_api_key.r and test_helper_ncbi.r, along with
the offline test in test_link_byid.r. One offline test sat in
test_summary.r, which now skips on CRAN as a whole, and it moved to
test_errors.r.

testthat 3.2.2 fails on a skip placed outside a test, a bug fixed in
3.2.3. DESCRIPTION now asks for testthat 3.2.3 or later.

CI still runs the whole suite, because devtools::check() and the r-lib
GitHub Actions set NOT_CRAN. The PR template now tells contributors to
start a test file that calls NCBI with skip_on_cran().
@samuelbharti
samuelbharti force-pushed the test/offline-tests-on-cran branch from 0cfef1d to 4cc2a81 Compare October 10, 2026 13:30
@samuelbharti
samuelbharti merged commit 968c6f1 into master Oct 10, 2026
9 checks passed
@samuelbharti
samuelbharti deleted the test/offline-tests-on-cran branch October 10, 2026 13:35
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.

The whole test suite sits behind one NOT_CRAN gate, so CRAN and r-universe run no tests

1 participant