test: complete Forgejo workflow-name matrix
All checks were successful
CI / test (pull_request) Successful in 3m48s
CI / release-exercise (pull_request) Successful in 26s
CI / self-guards (pull_request) Successful in 21s
CI / action-exercise (pull_request) Successful in 19s
CI / docs-sync-exercise (pull_request) Successful in 20s
labels / labels (pull_request) Successful in 22s
Refs guard / refs-not-closing (pull_request) Successful in 20s

This commit is contained in:
codex-bot-andresmgsl 2026-08-25 08:53:52 +00:00
parent 4bdb80bf80
commit 54a9334363
2 changed files with 23 additions and 4 deletions

View file

@ -695,6 +695,8 @@ pr_view_stub() {
FAKE_STATUS='{"state":"failure","statuses":[
{"context":"labels / labels (pull_request)","status":"success","created_at":"2026-08-02T10:00:00Z","updated_at":"2026-08-02T10:00:00Z"},
{"context":"labels / labels (pull_request)","status":"failure","created_at":"2026-08-02T09:00:00Z","updated_at":"2026-08-02T09:00:00Z"},
{"context":"CI / test (pull_request)","status":"success","created_at":"2026-08-02T10:00:00Z","updated_at":"2026-08-02T10:00:00Z"},
{"context":"Refs guard / refs-not-closing (pull_request)","status":"success","created_at":"2026-08-02T10:00:00Z","updated_at":"2026-08-02T10:00:00Z"},
{"context":"codecov","status":"success","created_at":"2026-08-02T10:00:00Z","updated_at":"2026-08-02T10:00:00Z"}]}'
FAKE_PR='{"head":{"sha":"abc"},"base":{"sha":"base"},"merge_base":"ancestor","draft":false,"mergeable":true}'
pr_view_stub
@ -704,9 +706,16 @@ check "pr_view maps createdAt" 0 "" \
check "pr_view maps completedAt" 0 "" \
grep -q '"completedAt":' <<<"$view_json"
check "pr_view derives workflowName from the first context separator" 0 "" \
jq -e 'any(.statusCheckRollup[];
.context == "labels / labels (pull_request)" and .workflowName == "labels")' \
>/dev/null <<<"$view_json"
jq -e '[.statusCheckRollup[]
| select(.context == "labels / labels (pull_request)"
or .context == "CI / test (pull_request)"
or .context == "Refs guard / refs-not-closing (pull_request)")
| [.workflowName, .context]]
| unique == [
["CI", "CI / test (pull_request)"],
["Refs guard", "Refs guard / refs-not-closing (pull_request)"],
["labels", "labels / labels (pull_request)"]
]' >/dev/null <<<"$view_json"
check "pr_view leaves workflowName empty when the context has no separator" 0 "" \
jq -e 'any(.statusCheckRollup[];
.context == "codecov" and .workflowName == "")' >/dev/null <<<"$view_json"

View file

@ -632,7 +632,17 @@ expect "Forgejo StatusContexts retain a genuine foreign FAILURE" FAILURE \
forgejo_bare_red='{"state":"failure","statuses":[
{"context":"codecov","status":"failure","created_at":"2026-08-23T18:32:00Z","updated_at":"2026-08-23T18:32:00Z"}]}'
expect "a bare Forgejo context is never guessed to be the self workflow" FAILURE \
expect "a bare Forgejo context survives a named self-workflow exclusion" FAILURE \
"$(forgejo_rollup "$forgejo_bare_red" | checks_state)"
forgejo_nested_name='{"state":"failure","statuses":[
{"context":"labels / nested / check","status":"failure","created_at":"2026-08-23T18:32:00Z","updated_at":"2026-08-23T18:32:00Z"}]}'
SELF_WORKFLOW="labels / nested"
expect "a Forgejo workflow name containing a separator is never guessed" FAILURE \
"$(forgejo_rollup "$forgejo_nested_name" | checks_state)"
SELF_WORKFLOW=""
expect "a bare Forgejo context also survives an empty self-workflow exclusion" FAILURE \
"$(forgejo_rollup "$forgejo_bare_red" | checks_state)"
# ...and an empty self filters NOTHING: outside Actions no workflow name is
# ambient, and the exclusion must never drop entries on a guess — the same