fix(11-07): let the Phase 10.1 gate accept the Phase 12 pending goldens
- 11-06 records TestBroadcastGoldens/created and /updated and reports them as skipped until Phase 12; the 10.1 detector refused any skip, so check-phase10.1.sh --all failed on the fonoteka.go suite - the detector now accepts exactly those skips when their output carries 'pending: Phase 12' (the same rule check-phase11.sh enforces); the self-test proves a pending skip passes and one without the text fails
This commit is contained in:
@@ -19,6 +19,11 @@ REVIEW="$PHASE_DIR/10.1-SECURITY-REVIEW.md"
|
||||
VALIDATION="$PHASE_DIR/10.1-VALIDATION.md"
|
||||
APP_PLUGINS=(./plugins/golem15/fonoteka/... ./plugins/golem15/user/...)
|
||||
KNOWN_APP_FAILURES=""
|
||||
# Phase 11 (11-06) records the created/updated broadcast goldens from PHP and
|
||||
# reports them as skipped until Phase 12 asserts them; check-phase11.sh
|
||||
# requires exactly these skips with this text.
|
||||
APP_PENDING_SKIPS="TestBroadcastGoldens/created TestBroadcastGoldens/updated"
|
||||
APP_PENDING_TEXT="pending: Phase 12"
|
||||
|
||||
usage() {
|
||||
cat >&2 <<'EOF'
|
||||
@@ -47,6 +52,9 @@ import json, os, sys
|
||||
path = sys.argv[1]
|
||||
allow = set(os.environ.get("PHASE101_ALLOW", "").split())
|
||||
require = set(os.environ.get("PHASE101_REQUIRE", "").split())
|
||||
expect_skip = set(os.environ.get("PHASE101_EXPECT_SKIP", "").split())
|
||||
skip_text = os.environ.get("PHASE101_SKIP_TEXT", "")
|
||||
skip_output = {}
|
||||
passed = set()
|
||||
failed_tests = {}
|
||||
failed_pkgs = []
|
||||
@@ -66,7 +74,13 @@ with open(path, encoding="utf-8", errors="replace") as fh:
|
||||
pkg = ev.get("Package") or ""
|
||||
if action == "build-fail":
|
||||
build_failed = True
|
||||
if action == "output" and test in expect_skip:
|
||||
skip_output.setdefault(test, []).append(ev.get("Output") or "")
|
||||
if action == "skip" and test:
|
||||
# A later phase's documented pending test (for example the Phase
|
||||
# 12 broadcast goldens) may skip, but only with its pending text.
|
||||
if test in expect_skip and skip_text and any(skip_text in o for o in skip_output.get(test, [])):
|
||||
continue
|
||||
print(f"refuse: skipped {pkg} {test}", file=sys.stderr)
|
||||
sys.exit(2)
|
||||
if action == "fail":
|
||||
@@ -203,6 +217,13 @@ run_self_test() {
|
||||
expect_detect fail 1 '{"Action":"pass","Package":"p","Test":"TestA"}
|
||||
{"Action":"fail","Package":"p","Test":"TestPhase101Actions"}'
|
||||
expect_detect skip 2 '{"Action":"skip","Package":"p","Test":"TestPhase101AlbumsExtension"}'
|
||||
PHASE101_EXPECT_SKIP="TestG/created" PHASE101_SKIP_TEXT="pending: Phase 12" expect_detect pending-skip 0 \
|
||||
'{"Action":"output","Package":"p","Test":"TestG/created","Output":"pending: Phase 12 asserts it\n"}
|
||||
{"Action":"skip","Package":"p","Test":"TestG/created"}
|
||||
{"Action":"pass","Package":"p","Test":"TestG"}'
|
||||
PHASE101_EXPECT_SKIP="TestG/created" PHASE101_SKIP_TEXT="pending: Phase 12" expect_detect pending-skip-without-text 2 \
|
||||
'{"Action":"skip","Package":"p","Test":"TestG/created"}
|
||||
{"Action":"pass","Package":"p","Test":"TestG"}'
|
||||
expect_detect zero 3 '{"Action":"pass","Package":"git.golem15.com/golem15/summercms/modules/cabana"}'
|
||||
expect_detect nonjson 4 '{"Action":"pass",'
|
||||
expect_detect build 1 '{"Action":"build-fail","ImportPath":"p"}
|
||||
@@ -313,7 +334,8 @@ run_go() {
|
||||
(cd "$ROOT" && go vet ./...)
|
||||
phase101_go "$ROOT" ./...
|
||||
(cd "$APP" && go vet ./... "${APP_PLUGINS[@]}")
|
||||
PHASE101_ALLOW="$KNOWN_APP_FAILURES" phase101_go "$APP" ./... "${APP_PLUGINS[@]}"
|
||||
PHASE101_ALLOW="$KNOWN_APP_FAILURES" PHASE101_EXPECT_SKIP="$APP_PENDING_SKIPS" PHASE101_SKIP_TEXT="$APP_PENDING_TEXT" \
|
||||
phase101_go "$APP" ./... "${APP_PLUGINS[@]}"
|
||||
echo "phase10.1 go passed"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user