AI Tool Usage Notice
This issue was drafted with AI assistance. The findings and CI run references
below have been verified against master.
Describe the bug
The integration-configs-db CI job in .github/workflows/test-build-deploy.yml
re-runs the entire test suites of ./pkg/configs/... and ./pkg/ruler/...
that the test job has already executed. Of all the packages it rebuilds, only
pkg/configs/api exercises a different code path — it swaps the in-memory DB
helper for a real Postgres one via the integration build tag on
pkg/configs/db/dbtest. Every other package in the matrix produces a
bit-for-bit identical binary in both jobs and is run twice for no benefit.
The Makefile target backing the job is:
configs-integration-test:
/bin/bash -c "go test -v -tags 'netgo integration slicelabels' -timeout 10m ./pkg/configs/... ./pkg/ruler/..."
The integration tag only affects pkg/configs/db/dbtest/{unit,integration}.go,
which is imported solely by pkg/configs/api.
To Reproduce
-
Pick any recent master run, e.g. run 28219749406 (sha d74da2e9).
-
Compare the test (amd64) job log against integration-configs-db (amd64).
Both report ok for the same eleven packages:
pkg/configs
pkg/configs/api
pkg/configs/client
pkg/configs/db
pkg/configs/userconfig
pkg/ruler
pkg/ruler/rulespb
pkg/ruler/rulestore
pkg/ruler/rulestore/bucketclient
pkg/ruler/rulestore/configdb
pkg/ruler/rulestore/local
-
The verbose log of integration-configs-db shows the same test functions
Test_Root_OK, Test_PostConfig_CreatesConfig, Test_GetAllConfigs_Empty,
etc. that already ran under the test job — just against Postgres rather
than the in-memory backend.
Expected behavior
Only the Postgres-backed code path of pkg/configs/api (or its e2e equivalent)
should be re-executed in a dedicated job. Every other package should be tested
exactly once.
Environment:
- Infrastructure: GitHub Actions (
ubuntu-24.04, ubuntu-24.04-arm)
- Deployment tool: n/a (CI workflow)
Additional Context
Cost on a typical run (per arch):
pkg/ruler alone: ~32–36s of wall time, duplicated.
- Total redundant work per arch: ~37s; across amd64 + arm64 ≈ ~75s of CI
wall time per push, plus the docker/postgres setup overhead of the
integration-configs-db job itself.
Possible fix:
- Move the Postgres coverage into
./integration/ as a tag-gated e2e test
(e.g. integration_configs_db), let the existing discover-tags →
integration matrix pick it up, and drop the bespoke
integration-configs-db job + configs-integration-test Make target.
This also removes the only place in the repo that conditionally compiles
test code via a //go:build integration tag swap.
it's a small change and consolidates onto
the same pattern every other Docker-dependent test in the repo already uses.
AI Tool Usage Notice
This issue was drafted with AI assistance. The findings and CI run references
below have been verified against master.
Describe the bug
The
integration-configs-dbCI job in.github/workflows/test-build-deploy.ymlre-runs the entire test suites of
./pkg/configs/...and./pkg/ruler/...that the
testjob has already executed. Of all the packages it rebuilds, onlypkg/configs/apiexercises a different code path — it swaps the in-memory DBhelper for a real Postgres one via the
integrationbuild tag onpkg/configs/db/dbtest. Every other package in the matrix produces abit-for-bit identical binary in both jobs and is run twice for no benefit.
The Makefile target backing the job is:
The
integrationtag only affectspkg/configs/db/dbtest/{unit,integration}.go,which is imported solely by
pkg/configs/api.To Reproduce
Pick any recent master run, e.g. run
28219749406(shad74da2e9).Compare the
test (amd64)job log againstintegration-configs-db (amd64).Both report
okfor the same eleven packages:The verbose log of
integration-configs-dbshows the same test functionsTest_Root_OK,Test_PostConfig_CreatesConfig,Test_GetAllConfigs_Empty,etc. that already ran under the
testjob — just against Postgres ratherthan the in-memory backend.
Expected behavior
Only the Postgres-backed code path of
pkg/configs/api(or its e2e equivalent)should be re-executed in a dedicated job. Every other package should be tested
exactly once.
Environment:
ubuntu-24.04,ubuntu-24.04-arm)Additional Context
Cost on a typical run (per arch):
pkg/ruleralone: ~32–36s of wall time, duplicated.wall time per push, plus the docker/postgres setup overhead of the
integration-configs-dbjob itself.Possible fix:
./integration/as a tag-gated e2e test(e.g.
integration_configs_db), let the existingdiscover-tags→integrationmatrix pick it up, and drop the bespokeintegration-configs-dbjob +configs-integration-testMake target.This also removes the only place in the repo that conditionally compiles
test code via a
//go:build integrationtag swap.it's a small change and consolidates onto
the same pattern every other Docker-dependent test in the repo already uses.