Loading
Draft: ci(metrics): run the S03-B spec tests on spec edits (#1718 stack: 2/2)
Summary
- Problem:
internal/metrics/spec_test.go(added in !3524 (merged)) readsdocs/specs/S03-b-metrics.md. Its threeTestSpec*tests fail when the### Databasetable, the instrumenter prose, or thenamebudget row of the spec stops matching the code. CI runs these tests only ingo_unittestsandtest:race. Both jobs skip an MR that changes only files underdocs/or.mdfiles (.changes-non-docs), and both jobs always run onmain. - Impact: A docs-only MR that edits the S03-B spec can merge with a green pipeline and then fail
go_unittestsonmain. After that, every non-docs MR fails its merged-results pipeline until somebody corrects the spec. Users see nothing. - Change: This MR adds the job
test:spec-tablesto.gitlab-ci.yml, aftertest:race. The job runsgo test -count=1 -run '^TestSpec' ./internal/metrics/on MR and branch-push pipelines whendocs/specs/S03-b-metrics.mdor.gitlab-ci.ymlchanges. It has no rule for the default branch or for tags, becausego_unittestsruns these tests there. - Downsides: MRs that change the spec or
.gitlab-ci.ymlrun one more job. If a later rename removes theTestSpecprefix,-run '^TestSpec'selects no test, and the job passes with no check.
Checklist
- Ran it: n/a for the service, because this MR changes only CI configuration.
On this branch,
go test -count=1 -v -run '^TestSpec' ./internal/metrics/passes and runs the threeTestSpec*tests.glab ci lintdid not run. Thechanges:list includes.gitlab-ci.yml, so the pipeline of this MR is the first run of the job. - Interfaces and data: None. The change is CI configuration only.
- Failure: If the spec stops matching the code, the job fails, and the test output names the spec file and the missing item. The MR pipeline shows the failure before the spec edit merges.
- Rollout: n/a. No service code, schema or configuration changes.
- Hot path: n/a. No request path changes.
- Database: n/a. No migration or query changes.
- Security: n/a. No input, route, permission or audited action changes.
- ADRs: None. The review research for this finding found no ADR, spec or plan that settles which CI job runs a Go test that reads a spec.
- E2E: None. The change adds no service behavior, so no scenario row changes.
- Simplicity: A wider
.changes-non-docsfilter was rejected, because it runs the full unit-test suite on every docs-only MR. A move of the check into ago runchecker with its own job (thelint:e2e-catalog-syncshape) was rejected, because it changes what !3524 (merged) delivers and still needs a CI job. A scoped job runs the existing tests with no move.
Merge order
This MR is the second MR in a stack with !3524 (merged).
It targets the branch of !3524 (merged) and merges after !3524 (merged).
It is a separate MR because AGENTS.md keeps changes to CI gate configuration in their own MR.
Related to #1718 (closed)
This is a bot message