fix(pkg-r): skip tests that assume Suggests packages are installed - #317
Merged
Merged
Conversation
CRAN's r-devel-linux-x86_64-fedora-clang flavor has RSQLite but not
duckdb installed, which caused the test suite to ERROR:
- 92 errors: tests requesting engine = "duckdb" (explicitly or via the
local_data_frame_source() fixture default) hard-failed in
check_installed("duckdb"), including one variant where the
non-interactive check surfaced as "menu() cannot be used
non-interactively"
- 4 failures: tests using the default engine silently fell back to
SQLite and then failed DuckDB-specific expectations
skip_if_no_dataframe_engine() only skipped when *neither* engine was
installed, so it never fired on that machine, and it had no way to
express "this test requires a specific engine". It is now engine-aware:
- with engine = NULL, keep the old any-engine semantics (mirroring how
DataFrameSource resolves a default engine)
- with a specific engine, skip unless that engine's package is
installed, so tests no longer silently degrade to another engine
local_data_frame_source() and local_recording_data_frame_source() now
call it with their requested engine, and local_querychat() skips for
plain data.frame inputs, so fixture-based tests skip automatically.
Tests that construct DataFrameSource or QueryChat directly gained
skip_if_no_dataframe_engine() guards (6 describe blocks and 3
test_that() blocks in test-QueryChat.R, 2 describe blocks in
test-QueryChatSystemPrompt.R, plus 3 explicit skip_if_not_installed
("duckdb") calls in DuckDB-asserting tests).
Audited all Suggests packages by running the full suite with every
Suggests dependency (except the testthat/withr harness and later,
which is a hard dependency of shiny) shadowed by broken stubs. That
surfaced 46 additional tests failing on "no compatible database
engine" with both engines absent, all fixed by the guards above.
Verified by simulating the CRAN condition (FAIL 0, SKIP 98, PASS
716 for the duckdb-only case), a full Suggests blackout (FAIL 0,
SKIP 199, PASS 1198), and with everything installed (FAIL 0, SKIP 0,
PASS 2195, twice).
gadenbuie
force-pushed
the
fix/cran-failures-2026-09
branch
from
September 29, 2026 21:37
7108ffc to
7a56f67
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.
Summary
CRAN's
r-devel-linux-x86_64-fedora-clangcheck errored becauseduckdb(a Suggests dependency) isn't installed on that machine: 92 test errors fromcheck_installed("duckdb")plus 4 failures where tests silently fell back to SQLite and then failed DuckDB-specific expectations.skip_if_no_dataframe_engine()is now engine-aware: with an explicit engine it skips unless that engine's package is installed; withNULLit keeps the old any-engine semantics. Previously it only skipped when neither duckdb nor RSQLite was installed, so it never fired when RSQLite masked the missing duckdb.local_data_frame_source(),local_recording_data_frame_source(), andlocal_querychat()(for data.frame inputs) now skip automatically.DataFrameSource/QueryChatdirectly gained guards: 8 describe blocks + 3test_that()blocks, plus 3 explicitskip_if_not_installed("duckdb")in DuckDB-asserting tests.Audited all Suggests packages by running the full suite with each Suggests dependency (except the testthat/withr harness and
later, a hard dependency of shiny) shadowed by broken stubs — the worst-case scenario CRAN could present. That surfaced 46 additional tests failing when both duckdb and RSQLite are absent, all fixed by the guards above.