Skip to content

tests: fix free /review URL test drift via a review_url output#123

Merged
reuvenharrison merged 4 commits into
mainfrom
fix/entrypoint-drift
May 23, 2026
Merged

tests: fix free /review URL test drift via a review_url output#123
reuvenharrison merged 4 commits into
mainfrom
fix/entrypoint-drift

Conversation

@reuvenharrison
Copy link
Copy Markdown
Contributor

@reuvenharrison reuvenharrison commented May 23, 2026

The free-review URL tests had drifted: near-identical copies across the breaking/changelog/pr-comment workflows, a bash-only workaround in changelog, and fragile entrypoint stubbing that ran under the runner's dash instead of the production shell. This makes them consistent and faithful.

Tests (the drift)

  • Add a review_url output to the breaking and changelog actions (the free /review link they already emit as a ::notice::) so a test can assert on it directly. Annotations and step logs can't be read by a later step; only declared outputs cross the step boundary.
  • Rewrite the breaking/changelog free-review URL tests to run the real action via uses: and check steps.*.outputs.review_url. They now run on the production platform (Alpine/busybox ash), with no stub / docker run / bash workaround.
  • The strip tests use base: HEAD:specs/base.yaml, adding the first CI coverage of real git-ref resolution (the recommended base form).
  • pr-comment's tests are left as-is: it needs PR context, and 4 of them assert on exit codes / ARG_MAX behavior, so direct invocation under dash is the correct strict-POSIX gate. (ARG_MAX is kernel-level, so in-container adds nothing for those.)

Entrypoint cleanup (minor, while here)

  • write_output: breaking matched to the local version used by changelog/diff.
  • base_sha comment: changelog now carries the full rationale instead of "see breaking" (and an em-dash removed).
  • set -o pipefail: removed from changelog/diff. The entrypoints are #!/bin/sh; pipefail is non-POSIX and bought nothing here (every pipeline is in an if condition or ends in the command whose failure already propagates). All four are now set -e only.

Test plan

  • All four workflows green
  • breaking/changelog URL tests pass (validates real git-ref resolution and that test1->test3 is a change)
  • Existing uses: tests unaffected by the entrypoint changes

Add a `review_url` output to the breaking action (the free /review link
it already emits as a notice) so tests can assert on it directly.

Rewrite the two free-review URL tests to run the real action via `uses:`
and check the output, instead of invoking the entrypoint on the runner
under dash. They now run on the production platform (Alpine/busybox ash)
with no shell-compat workarounds, and the strip test exercises real
git-ref resolution (HEAD:specs/base.yaml), which had no CI coverage.

Also align entrypoint drift: write_output now matches changelog/diff,
add set -o pipefail (consistent with changelog/diff; safe now that every
breaking test runs in-container), and drop an em-dash from a comment.
The review_url echo was between `breaking<<$delimiter` and its closing
delimiter, so it got folded into the `breaking` output value (breaking
the existing output-comparison tests) and never became its own output
(so the URL tests saw it empty). Move it after the block closes.
Mirror the breaking change: add a review_url output (written after the
multiline changelog block closes) and rewrite the two free-review URL
tests to run the real action via uses: + assert on the output, dropping
the bash/dash workaround. Also expands the base_sha comment to match
breaking's (drift cleanup).
The entrypoints are #!/bin/sh. pipefail is not POSIX (the runner's dash
rejects it), and it bought nothing here: every pipeline is either inside
an if-condition or ends in the command whose failure already propagates.
Standardize all four on `set -e` only, which also makes them runnable
directly under the runner's dash.
@reuvenharrison reuvenharrison changed the title breaking: review_url output; test free /review URL via it (drift cleanup) actions: fix entrypoint drift; test free /review URL via a review_url output May 23, 2026
@reuvenharrison reuvenharrison changed the title actions: fix entrypoint drift; test free /review URL via a review_url output tests: fix free /review URL test drift via a review_url output May 23, 2026
@reuvenharrison reuvenharrison merged commit 9778fd2 into main May 23, 2026
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant