test(docsite): command word with global flags

- the docs checker finds the command behind -v, -q, -qn, --env X, --env=X
- gate: bonfire and docsite names in the go stage, docsite in the race run
This commit is contained in:
Jakub Zych
2026-10-21 19:22:00 +02:00
parent eeeee59ead
commit fd5286884e
2 changed files with 62 additions and 3 deletions

View File

@@ -85,6 +85,21 @@ BONFIRE_TESTS=(
# Plan 02.
TestListTracerSmoke TestHelpSmoke TestListJSONSmoke TestErrorRenderSmoke
TestWidgetMatrixSmoke
# Plan 04: global options, duplicates, Call (SC-2, D-13).
TestPeekGlobals TestGlobalsArgs TestGlobalFlagsAgree
TestReservedFlags TestDuplicateNames TestCallNoGlobalsHook
# Plan 04: goldens for list, help and errors (D-13, D-14, D-16, D-18).
TestListGolden TestListAllGolden TestListJSONGolden TestListStyledGolden
TestHelpGolden TestHelpPassthroughGolden TestHelpEqualsHelpFlag
TestErrorGolden TestExitCodes TestReportedSilent TestErrorScrubbed
TestWrongDirectoryHint TestCheckDocs TestVersionHeader
# Plan 04: widgets, live views and prompts (D-03, D-27, D-28).
TestWidgetMatrix TestLiveModels TestPromptsNoInteraction
TestSecretWithNoInteraction TestConfirmProceed TestPrintAbove
)
DOCSITE_TESTS=(
# Plan 04: the docs checker reads past the global options.
TestCommandWord TestCommandWordGlobals
)
CONGA_TESTS=(
# Plan 01.
@@ -316,17 +331,18 @@ run_go() {
go_named "$ROOT" ./modules/diary -short "${DIARY_TESTS[@]}"
go_named "$ROOT" ./modules/sunscreen -short "${SUNSCREEN_TESTS[@]}"
go_named "$ROOT" ./modules/bonfire -short "${BONFIRE_TESTS[@]}"
go_named "$ROOT" ./internal/docsite -short "${DOCSITE_TESTS[@]}"
go_named "$ROOT" ./modules/conga -short "${CONGA_TESTS[@]}"
go_named "$ROOT" ./modules/lagoon -short "${LAGOON_TESTS[@]}"
go_named "$ROOT" ./modules/surf -short "${SURF_TESTS[@]}"
go_named "$ROOT" ./cmd/summer -short "${SUMMER_TESTS[@]}"
local out
if ! out="$(cd "$ROOT" && go test -count=1 -race -short ./modules/diary/... ./modules/sunscreen/... ./modules/bonfire/... 2>&1)"; then
if ! out="$(cd "$ROOT" && go test -count=1 -race -short ./modules/diary/... ./modules/sunscreen/... ./modules/bonfire/... ./internal/docsite/... 2>&1)"; then
printf '%s\n' "$out" | tail -n 60 >&2
echo "refuse: go test -race -short of diary, sunscreen and bonfire" >&2
echo "refuse: go test -race -short of diary, sunscreen, bonfire and docsite" >&2
return 1
fi
echo "race: modules/diary, modules/sunscreen, modules/bonfire"
echo "race: modules/diary, modules/sunscreen, modules/bonfire, internal/docsite"
echo "phase19.8 go passed"
}