Skip to content

ci: Restore database backend runs via the generic matrix env field - #2486

Merged
krlmlr merged 5 commits into
mainfrom
claude/gha-env-var-setup-ej3a28
Jul 27, 2026
Merged

ci: Restore database backend runs via the generic matrix env field#2486
krlmlr merged 5 commits into
mainfrom
claude/gha-env-var-setup-ej3a28

Conversation

@krlmlr

@krlmlr krlmlr commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Sync .github/workflows/R-CMD-check.yaml and
.github/workflows/versions-matrix/action.R from cynkratemplate
(cynkra/cynkratemplate#95):
the rcc-full job now applies the generic env field
of test matrix entries to $GITHUB_ENV itself,
before the custom actions run,
because composite actions cannot read the matrix context.

Silent breakage this uncovers and fixes

The backend matrix entries carried a bare test_src field,
and the custom before-install action tried to read it via
${{ matrix.config.test-src }}
which resolves to an empty string inside a composite action.
The job logs prove it
(run 30139102985, "SQL Server with covr", env of every step: DM_TEST_SRC: empty).

As a result:

  • DM_TEST_SRC was never set,
    tests/testthat/helper-src.R fell back to the df source,
    and the six "… with covr" jobs
    tested plain data frames instead of their advertised backends —
    green, but misleading.
  • None of the server provisioning in the custom after-install action
    (ankane/setup-postgres / setup-mariadb / setup-mysql / setup-sqlserver,
    keyed on env.DM_TEST_SRC) ever ran.

Fix

  • Backend entries now pass DM_TEST_SRC through the generic env field,
    so the after-install action provisions the matching server again
    and the tests really run against SQL Server, Postgres, MariaDB,
    MySQL, DuckDB, and SQLite.
  • The entries also set SKIP_UPDATE_SNAPSHOTS=true
    (multi-line env values are now supported by the template),
    keeping the snapshot updater from running the suite a second time
    against the backend and accepting backend-specific snapshots.
    The instrumented-validation entry sets the flag directly, too.
  • The custom before-install action loses the env input,
    the apply boilerplate, the broken DM_TEST_SRC step,
    and the DM_VALIDATE-triggered snapshot opt-out —
    all covered by the workflow and the matrix now.

duckdb 1.5.5 storage message

duckdb 1.5.5 announces its extensions-and-secrets location
on driver creation unless the location was chosen explicitly;
on this PR's first CI run the snapshot updater captured that message
(with its session-specific temporary path) into _snaps/dm_sql.md,
and the check step then failed on the path mismatch.
The snapshot is restored to its pre-pollution state here;
the announcement itself is prevented on main by #2487
(~/.duckdb plus DUCKDB_R_HOME in the custom before-install action,
merged into this branch),
so the interim message suppression in the test helpers
has been dropped again.

Heads-up

The six backend jobs have been inert for months;
re-enabling them may surface real drift
(driver installs, backend-specific test failures) in the nightly runs.
That would be true signal, not a regression from this PR.
Note that the nightly run on main currently already has
four unrelated failing jobs (macOS 4.5/4.6, ubuntu-26.04 devel, arm devel).

🤖 Generated with Claude Code

https://claude.ai/code/session_0136C9bRMjBGkUrtLdkYNmAg

Sync .github/workflows/R-CMD-check.yaml and
.github/workflows/versions-matrix/action.R from cynkratemplate
(cynkra/cynkratemplate#95).
The rcc-full job now applies the generic "env" field
of test matrix entries to $GITHUB_ENV itself,
before the custom actions run,
because composite actions cannot read the matrix context.

This fixes a silent breakage:
the backend matrix entries carried a bare "test_src" field,
and the custom before-install action tried to read it via
`${{ matrix.config.test-src }}` —
which resolves to an empty string inside a composite action,
as visible in the job logs (`DM_TEST_SRC:` empty).
As a result, DM_TEST_SRC was never set,
tests/testthat/helper-src.R fell back to the "df" source,
and the six "... with covr" jobs
tested plain data frames instead of their advertised backends,
skipping the server provisioning in the custom after-install action.

The backend entries now pass DM_TEST_SRC through the "env" field,
so the after-install action provisions the matching server again
and the tests really run against SQL Server, Postgres, MariaDB,
MySQL, DuckDB, and SQLite.
The entries also set SKIP_UPDATE_SNAPSHOTS=true,
keeping the snapshot updater from running the test suite
a second time against the backend
and accepting backend-specific snapshots;
the instrumented-validation entry sets the flag directly, too.

The custom before-install action loses the "env" input,
the apply boilerplate, the broken DM_TEST_SRC step,
and the DM_VALIDATE-triggered snapshot opt-out,
all of which are now covered by the workflow and the matrix.
krlmlr and others added 4 commits July 27, 2026 18:42
duckdb 1.5.5 (on the binary repositories since today)
announces its extensions-and-secrets location
whenever a driver is created without an explicit choice,
with a session-specific temporary path.
The snapshot updater captured that message and path
into tests/testthat/_snaps/dm_sql.md,
and the subsequent check step failed
because its own session used a different path.

Suppress the message by its condition class
("duckdb_storage_location") in the two test helpers
that create duckdb connections,
and restore the snapshot to its pre-pollution state.
Since #2487 the custom before-install action creates ~/.duckdb
and points DUCKDB_R_HOME at it,
which counts as an explicit storage choice,
so duckdb announces nothing on driver creation
and the test helpers no longer need to muffle
the "duckdb_storage_location" message.
Restore the bare connections.
@krlmlr
krlmlr merged commit a2d21d0 into main Jul 27, 2026
6 checks passed
@krlmlr
krlmlr deleted the claude/gha-env-var-setup-ej3a28 branch July 27, 2026 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants