Repository navigation
test: replace pgxmock with real-cluster testserver integration tests - #289
Merged
Merged
Conversation
sravotto
force-pushed
the
sr8/integration
branch
3 times, most recently
from
September 15, 2026 19:32
e0353f5 to
9ad335c
Compare
pgxmock tests asserted exact SQL strings and hand-crafted result sets, so they never validated the embedded SQL/DDL or real transaction semantics against actual CockroachDB. Add internal/testutil, a shared harness built on the already-used cockroach-go/v2/testserver, and convert the store, collector, and admin CLI tests to run against a real cluster. Tests that need a live cluster are gated behind //go:build integration so the default "go test ./..." stays fast and doesn't link testserver; github.com/pashagolub/pgxmock/v3 is fully removed from go.mod/go.sum. CI gains a matching integration-tests job, run as a matrix against latest, 25.4, and 24.3 CockroachDB. testutil.StartCluster resolves CRDB_TEST_SERIES (e.g. "25.4") to the newest non-withdrawn patch in that series via the same release feed testserver itself uses for "latest stable", so CI doesn't need a hardcoded patch version that goes stale. The staticcheck step now also runs with -tags=integration, since production code exercised only from these tests (e.g. server.go's isLeaseHolder/getJob) would otherwise show up as unused. Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
sravotto
force-pushed
the
sr8/integration
branch
from
September 15, 2026 19:42
9ad335c to
5f0a3f8
Compare
sravotto
marked this pull request as ready for review
September 15, 2026 19:46
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
go test ./...stays fast and doesn't link testserver; CI gains a matching integration-tests job, and the staticcheck step now also runs with -tags=integration (production code exercised only from these tests would otherwise show up as unused).