Repository navigation
test(config): run the auto-purchase-stamp and ladder-arming Postgres tests in CI - #1532
Conversation
…tests in CI These tests skipped unless a dedicated *_TEST_DATABASE_URL was set, which CI never does. They now use a fresh container database, and the env-gate guard covers them. Part of #202 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Shared migrated database setup and gate coverage internal/config/store_postgres_auto_purchase_stamps_integration_test.go, internal/config/store_postgres_ladder_arming_integration_test.go, internal/config/ri_exchange_reservation_integration_gate_test.go |
The auto-purchase stamps and ladder arming tests use the shared database helper instead of dedicated database URLs and direct pool and migration setup. The environment-gate guard checks both test files. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Other
Possibly related PRs
- LeanerCloud/cloud-commitments-platform#1402: It selects and runs integration-tagged tests; this PR removes environment-variable skips from three integration tests.
Suggested reviewers: iamjsd
Merge Risk: 
Minimal · up to 01fbd
-
The tests now use migrated test databases instead of dedicated URLs. No merge-blocking risk was identified.
Pre-merge checks: 
5
-
Full details: Title check
-
Explanation
The title "test(config): run the auto-purchase-stamp and ladder-arming Postgres tests in CI" matches the main change. The PR converts three Postgres integration tests in internal/config from env-var-gated skips to fresh databases from testhelpers.RequireMigratedDatabase, so they run without dedicated database URLs. It also adds the two test files to the parse-only guard. The title does not mention the guard, but it names the tests whose behavior changed. The title is specific and uses conventional commit format.
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 4 functions across 3 files.
-
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
|
Independent review 2 (claude-fleet, cold): APPROVE 01fbda9 Scope: the change is test-only. Three integration tests in two internal/config files move from an env-var DSN plus t.Skip to testhelpers.RequireMigratedDatabase, and both files are added to the existing env-gate AST guard. Base is 53f60c2. Findings:
Attacked:
Verified locally (GOTOOLCHAIN=go1.26.10; AUTO_PURCHASE_STAMPS_TEST_DATABASE_URL and LADDER_ARMING_TEST_DATABASE_URL unset; heavy runs under the lock):
Reviewed by an independent agent with no author context (second reviewer). Review only: nothing was pushed, and the GitHub review state is unchanged. |
|
VERDICT: APPROVE 01fbda9 Findings:
No blocking findings. Attacked:
|
|
Local verification at
|
Part of #202. This PR doesn't close it: part 1, the container-flake retry, stays open as "measure first". First numbers are below.
Problem: three Postgres integration tests in
internal/configread a dedicated database URL from an env var andt.Skipwhen it's unset. CI never sets these vars, so the tests never ran there, which is a false green:TestPostgresStoreDB_AutoPurchaseStamps_FreshMigrateAndRIWritePreserveTestPostgresStoreDB_StepCapStoredEqualsCompared(both instore_postgres_auto_purchase_stamps_integration_test.go,AUTO_PURCHASE_STAMPS_TEST_DATABASE_URL)TestPostgresStoreDB_LadderArming(store_postgres_ladder_arming_integration_test.go,LADDER_ARMING_TEST_DATABASE_URL)Change:
testhelpers.RequireMigratedDatabase, the same way test(ri-exchange): run the daily-cap reservation Postgres tests in CI #1088 moved the RI-exchange reservation tests. The env read, the skip and the dedicated-database prefix checks are gone, and so is the now-redundantRunMigrationscall, since the database arrives migrated. Every assertion is unchanged, including the "a fresh migrate leaves the switches OFF" checks.ri_exchange_reservation_integration_gate_test.go. It fails on anyos.Getenv,os.LookupEnvorSkipcall in a listed file, so an env gate can't come back unnoticed.Local (macOS, Docker Postgres via testcontainers):
go test -race -tags integration -count=1 -vpasses all three tests with no SKIP lines.os.Getenv("X")back into the ladder file fails the guard, with and without the tag.go vet(with and without-tags integration) andgofmtare clean.SKIP=hadolint,actionlint,zizmor,cfn-lint, because those hooks' Python and Docker environments can't be built locally. They don't apply to Go test files, and CI runs them.Part 1 (measure first): none of the last 25 failed
CI - Build & Testruns (2026-10-25 to 2026-10-26) failed on a container start, readiness or Docker-daemon error. That's two days of data, so it's a first sample, not a reason to close part 1.🤖 Generated with Claude Code
Summary by CodeRabbit