Repository navigation
test: run the offline tests on CRAN and r-universe - #245
Merged
Merged
Conversation
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
force-pushed
the
test/offline-tests-on-cran
branch
from
October 10, 2026 13:30
0cfef1d to
4cc2a81
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #221.
tests/test-all.Rran the suite only whenNOT_CRANwas"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 intest_link_byid.r.test_httr.rcounts 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.randtest_helper_ncbi.r, along with the offline test intest_link_byid.r. One offline test sat intest_summary.r, which now skips on CRAN as a whole, and it moved totest_errors.r.testthat 3.2.2 fails on a skip placed outside a test, a bug fixed in 3.2.3.
DESCRIPTIONnow asks for testthat 3.2.3 or later.CI still runs the whole suite, because
devtools::check()and the r-lib GitHub Actions setNOT_CRAN. The PR template now tells contributors to start a test file that calls NCBI withskip_on_cran().Checked with
R CMD check,NOT_CRANunset 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.