Run the test suites on every push - #14
Merged
Merged
Conversation
There was no CI here — no workflow file, nothing ran the suites automatically. They take four seconds and need no network (four stub curl, the rest only use --dry-run, which skips preflight), so there was nothing standing in the way. That matters more than usual in this repository: the script is downloaded by tag from customer pipelines and vendored into the action, so a broken main becomes a release and a release becomes what those pipelines fetch. The suites run twice: on ubuntu-latest with current bash, and on macos-latest against /bin/bash, which is still 3.2.57. The CLI targets 3.2 deliberately and current bash quietly accepts syntax 3.2 rejects, so a contributor on Linux cannot see that break. Each suite gets its own log group and one failure does not hide the others. Four repository checks beyond the suites, each one something that had to be noticed by hand before: - --version agrees with the VERSION constant. - No config/examples/*.config comes back; those were KEY=VALUE files the parser rejected, and the extension is what suggested the format. - Every fenced block in README.md and docs/*.md is what it claims to be: yaml parses, bash survives bash -n. Verified against the previous revision of the README, where it catches the two blocks that showed CLI output while tagged bash. - Only the double-brace placeholder appears; a single-brace one is taken literally and yields a path nobody has. Link checking is a separate advisory job, because a dead link is a real defect but an upstream hiccup must not turn main red. Adding the workflow surfaced something immediately: a CI checkout leaves the tree on a detached HEAD, and there the file-tag auto-detection produces nothing, so six of the twelve invocation tests stopped before doing any work. The workflow puts the checkout on a branch, and the git-context behaviour is now asserted on purpose in tests/test-git-context.sh instead of depending on how a runner happens to check out: detected on a branch, refused with an explicit message on a detached HEAD, and satisfied by passing the tag explicitly. That file also records the asymmetry it exposed — no repository at all falls back to a default tag, while a repository on a detached HEAD falls back to nothing, because the fallback chain assumes the first command fails where it actually succeeds and prints an empty string. Left as it stands; changing it changes CLI behaviour. Suites: 234 assertions across eight files, no failures. Fixing what the new checks found in docs/DEVELOPMENT.md: `git clone <repository-url>` is not valid shell, and the directory it then entered was never the repository name; three examples used the single-brace placeholder; the --timeout illustration is a fragment rather than a script. Also documented the CI and the offline property of the suites, and added the status badge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There was no CI in this repository — no workflow file, nothing ran the suites automatically. They take four seconds and need no network (four stub
curl, the rest only use--dry-run, which skips preflight), so nothing stood in the way.It matters more than usual here: the script is downloaded by tag from customer pipelines and vendored into the action, so a broken
mainbecomes a release, and a release becomes what those pipelines fetch.suites— the same tests, twicemacos-latest/bin/bash, still 3.2.57ubuntu-latestThe macOS leg is not decoration: the CLI targets bash 3.2 deliberately, and current bash quietly accepts syntax 3.2 rejects — a contributor on Linux cannot see that break. Each suite gets its own log group, and one failure does not mask the rest.
checks— four things that used to need a human--versionagrees with theVERSIONconstant.config/examples/*.configcomes back — those wereKEY=VALUEfiles the parser rejected.README.mdanddocs/*.mdis what it claims to be:yamlparses,bashsurvivesbash -n. Output samples belong intext.The guards were verified against the broken state, not just the fixed one:
tests/turns the step red and names itWhat adding CI found on its first run
A CI checkout leaves the tree on a detached HEAD, and there the file-tag auto-detection produces nothing — six of the twelve invocation tests stopped before doing any work.
The workflow puts the checkout on a branch, and the behaviour itself is now asserted deliberately in
tests/test-git-context.shrather than left to whichever checkout style a runner uses:--file-tag-name→ completesThat file also records an asymmetry it exposed: no repository at all falls back to a default tag, while a repository on a detached HEAD falls back to nothing. The chain is
which assumes the first command fails on a detached HEAD. It does not — it prints an empty string and exits 0, so neither fallback is reached. Left exactly as it stands and asserted, because changing it changes CLI behaviour and belongs in its own change.
Verification
linksis a separate advisory job: a dead link is a real defect, but an upstream hiccup must not turnmainredAlso fixes what the new checks immediately found in
docs/DEVELOPMENT.md, which nothing had ever validated:git clone <repository-url>is not valid shell, the directory it then entered was never the repository name, three examples used the single-brace placeholder, and the--timeoutillustration is a fragment rather than a script.