Skip to content

The acceptance scripts only run on macOS #398

Description

@akiomik

Split out of #396, which fixed the bugs that stopped scripts/acceptance from
working at all. Two things it deliberately left, both outside that diff.

sed -i '' is BSD-only

scripts/acceptance/test.sh truncates its output with

sed -i '' -e "/^Found /d" $TEMP_PATH/mado.txt > /dev/null

GNU sed takes the suffix attached to the flag (-i.bak), so the standalone
'' is read as an input filename and each call fails with
sed: can't read : No such file or directory. #396 made dash -n pass on the
file, but that is only the parser; the script still cannot run on Linux.

Worth deciding rather than patching: either commit to macOS and say so in the
script, or make it portable — a temporary file and mv, or perl -i -pe,
avoids the BSD/GNU split entirely.

While there, the > /dev/null on those three lines does nothing: -i writes
to the file, and the errors that do appear go to stderr.

Quoting

shellcheck reports SC2086 and friends across
scripts/acceptance/*.sh and scripts/benchmarks/*.sh — 32 findings after
#396. None misbehaves today, because no fixture filename contains a space or a
glob character, and find output is word-split by the for loop regardless,
so quoting alone would not make that loop robust.

This is the mechanical half deferred from #396, and it should land with
whatever linter enforces it rather than before. Whether that linter is
shellcheck is part of #397.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ciChanges to our CI configuration files and scripts

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions