From 8740a96113310d29babbe10a2613ba5069167991 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Wed, 25 Nov 2026 03:06:24 -0800 Subject: [PATCH] ci: spec trace counts runner scenarios as tests A scenario under testops/scenarios/*.yaml is a test definition, so a PR that changes only scenarios (and tests) passes as kind TEST. Production Go next to a scenario still fails TEST, as do a script beside the scenarios and a yaml outside testops/scenarios. Co-Authored-By: Claude Opus 5.5 --- seaweed-block/.github/scripts/spec-trace-check-test.sh | 5 +++++ seaweed-block/.github/scripts/spec-trace-check.sh | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/seaweed-block/.github/scripts/spec-trace-check-test.sh b/seaweed-block/.github/scripts/spec-trace-check-test.sh index c5379d0ff5..0bfc8cac99 100644 --- a/seaweed-block/.github/scripts/spec-trace-check-test.sh +++ b/seaweed-block/.github/scripts/spec-trace-check-test.sh @@ -115,6 +115,11 @@ expect_kind 1 "DOCS: a model under docs/spec" DOCS - - M docs/spec/X.tla expect_kind 1 "DOCS: a non-docs, non-Go file" DOCS - - M deploy/x.env expect_kind 0 "TEST: tests and testdata" TEST - - M core/x/s_test.go A core/x/testdata/in.bin expect_kind 1 "TEST: production Go" TEST - - M core/x/s.go +expect_kind 0 "TEST: a runner scenario only" TEST - - A testops/scenarios/gate.yaml +expect_kind 0 "TEST: a scenario next to tests" TEST - - M testops/scenarios/gate.yaml M core/x/s_test.go +expect_kind 1 "TEST: a scenario next to production Go" TEST - - M testops/scenarios/gate.yaml M core/x/s.go +expect_kind 1 "TEST: a script beside the scenarios" TEST - - A testops/scenarios/run.sh +expect_kind 1 "TEST: a yaml outside testops/scenarios" TEST - - M testops/gate.yaml expect_kind 0 "CI: workflow" CI - - M .github/workflows/w.yml expect_kind 1 "CI: scripts/ is shipped" CI - - A scripts/install.sh expect_kind 1 "DOCS next to another kind" "DOCS FIX INV-X-001" - - M docs/a.md diff --git a/seaweed-block/.github/scripts/spec-trace-check.sh b/seaweed-block/.github/scripts/spec-trace-check.sh index 0021fa1a37..0ff8bf9756 100644 --- a/seaweed-block/.github/scripts/spec-trace-check.sh +++ b/seaweed-block/.github/scripts/spec-trace-check.sh @@ -12,9 +12,10 @@ # no behaviour may use, each checked against what it changes: # DOCS (docs outside docs/spec/, tests, and non-test Go whose tokens are # unchanged: BLOBS holds old/ and new/ for each changed non-test -# Go file, compared by sametokens.go), TEST (only tests, testdata and test -# helpers), CI (only .github/). NONE is not a kind. Known limit: a docs file -# that is go:embed-ed into a binary changes behaviour under DOCS (none today). +# Go file, compared by sametokens.go), TEST (only tests, testdata, test +# helpers and runner scenarios, testops/scenarios/*.yaml), CI (only +# .github/). NONE is not a kind. Known limit: a docs file that is +# go:embed-ed into a binary changes behaviour under DOCS (none today). # - Simplest: (20+ characters) is present when the PR adds, modifies or # deletes non-test Go under core/ or cmd/. # @@ -81,7 +82,8 @@ if [[ -n $mi && $mi != '<'* ]]; then fi fi -is_test() { [[ $1 == *_test.go || $1 == testdata/* || $1 == */testdata/* || $1 == */testutil/* ]]; } +# A runner scenario under testops/scenarios/ is a test definition. +is_test() { [[ $1 == *_test.go || $1 == testdata/* || $1 == */testdata/* || $1 == */testutil/* || $1 == testops/scenarios/*.yaml ]]; } # docs/spec holds the models: changing one is not a docs change. is_doc() { [[ $1 != docs/spec/* ]] && [[ $1 == *.md || $1 == docs/* ]]; } core=0