Skip to content

test(ci): make a missing pyyaml a skip, not a failure - #2058

Merged
Smana merged 1 commit into
mainfrom
fix/notify-test-pyyaml-skip
Sep 17, 2026
Merged

Smana merged 1 commit into
mainfrom
fix/notify-test-pyyaml-skip

Conversation

@Smana

@Smana Smana commented Sep 17, 2026

Copy link
Copy Markdown
Owner

🔍 test

📝 Summary

scripts/test-ci-notify-main-broken.sh (#2057) printed SKIP and exited 1 when pyyaml
was missing. Harmless today — the suite runs in the links job, which installs pyyaml one
step earlier — but wrong as soon as anything else decides where it runs, and something is
about to: the scripts/ restructure on worktree-scripts-restructure replaces CI's
hand-maintained test list with discovery over scripts/ci/tests/, and its plan moves
scripts/test-*.sh (20 files, now 21) into that directory.

Under scripts/ci/tests/run.sh a non-zero exit reports FAIL, so an absent optional
dependency would have turned CI red.

🎯 Changes

  • Missing pyyaml exits 0 with a loud SKIP line
  • Adds the # requires: python3 header that runner reads
  • Records the residual gap where it fails

🗂️ Files

File Type Summary
scripts/test-ci-notify-main-broken.sh modified Guard exits 0; requires header
Why the header alone cannot fix this

run.sh tests a # requires: entry with command -v. pyyaml is a python module, not a
binary
— command -v python3 succeeds on a machine that lacks it. So the header covers
the interpreter and the in-script guard covers the module. Both are needed.

Known gap, for whoever lands the restructure

exit 0 makes a skipped run indistinguishable from a passed one in run.sh's summary
— the exact conflation its own header comment warns against:

A skip is printed, never silent. "It didn't run" and "it passed" are the two outcomes a
CI log must never conflate.

Closing that needs a skip exit code the runner understands — 77 is the usual spelling —
and that belongs in run.sh, not in each suite. This PR picks the lesser of the two
wrong answers and says so at the point of failure, rather than leaving a suite that
reddens CI over an optional dependency.

Verification

Three paths, all fresh:

# normal run
PASS  heredoc terminator at column 0 (line 16)
PASS  the run block is syntactically valid bash
PASS  workflow-env-fresh -> issue create
PASS  workflow-env-existing -> issue comment
PASS  gh-repo-removed -> failed as expected
exit: 0

# python3 present, `import yaml` failing
SKIP  test-ci-notify-main-broken: python3 pyyaml not installed, nothing was verified
exit: 0

# GH_REPO removed from ci.yaml — the regression must still be caught
mutant exit: 1

shellcheck clean.

🏷️ Labels

Tests, configuration changes

The guard printed SKIP and exited 1. Today that is harmless -- the suite runs
in the `links` job, which installs pyyaml one step earlier -- but it is wrong
the moment anything else decides where the suite runs, and something is about
to: the scripts restructure replaces CI's hand-maintained test list with
discovery over `scripts/ci/tests/`, and `scripts/test-*.sh` is in its move
list.

Under that runner a non-zero exit reports FAIL, so an absent optional
dependency would have reddened CI. Exiting 0 with a loud SKIP line is the
behaviour the environment actually warrants.

Also adds the `# requires: python3` header the runner reads. It cannot express
the real dependency -- the header is tested with `command -v`, and pyyaml is a
python module, so `command -v python3` succeeds without it -- so the header
covers the interpreter and the in-script guard covers the module.

Known gap, recorded in the script at the point of failure: exit 0 makes a
skipped run indistinguishable from a passed one in that runner's summary, which
is the conflation its own header comment warns against. Closing it needs a skip
exit code the runner understands (77 is the usual spelling); that belongs in
the runner rather than here.

Verified: normal run passes, the skip path exits 0 against a python3 whose
`import yaml` fails, and removing GH_REPO from ci.yaml still fails the suite.
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Rendered manifest diff — this PR vs main (desired state)

No changes to the rendered desired state. ✅

@Smana
Smana merged commit 188f18c into main Sep 17, 2026
11 checks passed
@Smana
Smana deleted the fix/notify-test-pyyaml-skip branch September 17, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant