Skip to content

test(self-tests): refuse a fake script with an env shebang - #84

Merged
brunogbv merged 2 commits into
mainfrom
test/no-env-shebang-fakes
Oct 10, 2026
Merged

brunogbv merged 2 commits into
mainfrom
test/no-env-shebang-fakes

Conversation

@brunogbv

@brunogbv brunogbv commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Summary — The flake's self-tests run in the Nix build sandbox, which has no /usr/bin/env, so a fake written with #!/usr/bin/env passes locally and fails only in CI; it broke #61 and #81 on the same day. tests/self-tests.sh now fails on any #!/usr/bin/env below a file's first line in scripts/, plugins/ and tests/, and checks itself on a red and a green fixture each run.

Closes #83

MIP none — not MIP-scoped
Tested ⬜ gates · ⬜ e2e · ⬜ live · ⬜ ci-only — docs_lint — (+1 earlier notes in the commits)
Cost $1.33 · diff-size estimate (cost-split --estimate-commit) (8ad8e1a)
$0.15 · diff-size estimate (one paragraph) (f258b80)

What changed

  • test(self-tests): refuse a fake script with an env shebang (8ad8e1a)
  • docs(development): fakes start with #!$BASH, and why (f258b80)

brunogbv and others added 2 commits October 10, 2026 04:55
The flake's self-tests run in the Nix build sandbox, which has no /usr/bin/env, so a fake written
with #!/usr/bin/env passes locally and fails only in CI; it broke #61 and #81 on the same day.
tests/self-tests.sh now fails on any #!/usr/bin/env below a file's first line in scripts/,
plugins/ and tests/, and checks itself on a red and a green fixture each run.

Closes #83

Tested: tests/self-tests.sh green on main with #81's fakes; a planted #81-style fake in scripts/temps.sh fails it naming the line, removed it passes; the fixture check red/green; shellcheck (warning+); docs_lint
Cost: ~$1.33 · diff-size estimate (cost-split --estimate-commit)
Co-Authored-By: Claude <noreply@anthropic.com>
Part of #83: the self-test section names the convention tests/self-tests.sh now enforces.

Tested: docs_lint
Cost: ~$0.15 · diff-size estimate (one paragraph)
Co-Authored-By: Claude <noreply@anthropic.com>
@brunogbv
brunogbv merged commit 1a9bb51 into main Oct 10, 2026
7 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.

self-tests: fail on a fake script with #!/usr/bin/env, which the Nix sandbox lacks

1 participant