Skip to content

ci: run the database tests at release time, not on every push - #516

Merged
EVWorth merged 1 commit into
mainfrom
ci/db-tests-at-release
Aug 29, 2026
Merged

EVWorth merged 1 commit into
mainfrom
ci/db-tests-at-release

Conversation

@EVWorth

@EVWorth EVWorth commented Aug 29, 2026

Copy link
Copy Markdown
Owner

Every Rust CI run started two database containers and rebuilt the workspace under coverage instrumentation. Measured on the last run of that job (4m20s total):

Step Time
Initialize containers (both DBs, incl. pulls) 30s
checkout + toolchain + cache 53s
Seed both databases 1s
Install cargo-tarpaulin 0.2s (cached)
Run tests under tarpaulin 3m24s

What changed

The 59 tests needing a live server are #[ignore]d, so cargo test passes on a bare checkout with no Docker — which it did not before this change. PR CI runs unit tests only, with no service containers and no coverage instrumentation.

They run instead in a new integration-db job in release.yml, which build depends on, so a database regression blocks the release rather than shipping in it. Coverage moved there too, since it needs the same containers.

mas-sqlite's integration tests stay on the PR path — they're in-memory and need no server.

The trade-off

An #[ignore]d test is a quiet test. A regression now surfaces when a release is cut rather than at the merge that caused it. That was the explicit call; the mitigation is make test-integration, documented in the README and the Makefile as the thing to run before touching the query executor, connection manager or admin service.

Verification

  • make test-rust — 65 passed, 59 ignored, no Docker running
  • make test-integration — 59 passed against MySQL 8 + MariaDB 11
  • Both workflow files parse; the new upload-artifact pin matches the v7.0.1 SHA used elsewhere in the repo

🤖 Generated with Claude Code

Every Rust CI run started two database containers and rebuilt the workspace
under coverage instrumentation, for a job whose measured cost was 30s of
container startup and 3m24s of instrumented test run. That is a lot to pay on
every push to every branch.

The 59 tests that need a live server are marked #[ignore], so `cargo test`
now passes on a bare checkout with no Docker at all — which it did not
before. Ordinary CI runs the unit tests only, with no service containers.

They run instead as a new `integration-db` job in the release workflow, which
`build` depends on: a database regression blocks the release rather than
shipping in it. Coverage moves there too, since it needs the same containers.

The trade-off is deliberate and worth stating: an #[ignore]d test is a quiet
test. A regression here surfaces when a release is cut rather than at the
merge that caused it, so `make test-integration` is the thing to run locally
before touching the query executor, connection manager or admin service.
README and the Makefile say so.

Co-Authored-By: Claude Opus 5 <[email protected]>
@EVWorth
EVWorth merged commit 6ba5832 into main Aug 29, 2026
9 checks passed
@EVWorth
EVWorth deleted the ci/db-tests-at-release branch August 29, 2026 00:23
EVWorth added a commit that referenced this pull request Aug 29, 2026
…ord (#526)

The frontend never receives credentials, so on edit it sends them back
absent, and the command layer fills them in from the store. It did that with
`if let Ok(stored)`, which treats every failure the same way: a keyring that
is locked, sandboxed or momentarily unavailable looked exactly like "this
profile has no stored password". The field stayed empty, and `save()` reads an
empty password as "the user cleared it" and calls `delete_password`. The user
edits a profile name, sees a success toast, and the credential is gone.

`ConnectionStore::get_existing` now returns `Option`, so the two outcomes have
different types and the call site has to decide. A profile that does not exist
is `None` — a new profile, where empty really is the intent. Anything else is
an error, and the save is refused with a message saying that nothing was
written and the stored password is untouched. `test_connection` had the same
pattern, where the cost was a false "Access denied" sending the user off to
debug credentials that were fine.

Also completes #277. Enforcement landed in #522; the other half of that issue
is a connection marked read-only being indistinguishable from any other until
the executor refuses something. Read-only connections now carry a lock in
their tab.

Two things found while testing:

The mock specifiers in ConnectionTabs.test.tsx resolve relative to the test
file, not the component, so `../../stores/connectionStore` pointed at
`src/components/stores/…`, which does not exist. None of that file's mocks
were ever applied — the tests ran against the real stores and asserted only
things that held either way. Fixed, which is what let the new tests render a
tab at all.

Three ConnectionStore tests were swept up by the blanket #[ignore] in #516.
They touch only the store and an in-memory keyring, so they are back on the
ordinary test path where they belong; CI has no database services, so a green
Test Rust job is the proof they need none.

Refs #274, #277
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.

1 participant