bash_unit
bash_unit copied to clipboard
[BUG] `install` fails on GH Action
Hi @pgrange
Installation on GH Action macOS fails (see this line) which shows
https://github.com/pgrange/bash_unit/blob/30b59189a4d50dde86c6b107f5015f28ff188666/install.sh#L5
Seems something got wrong but we can't see due of silent curl
Hi @dalisoft ,
Indeed, curl was way too silent in the install script. Sorry for the inconvenience. I've changed the option so that, hopefully, you can figure out what's happening in this CI.
See 3c1bdb0 on main branch.
I think you only have to restart the job and see what happens. Let me know if that helps. Cheers,
Hi @pgrange and thank you for fix.
Seems itβs my fault not bash_unit as i am used bash_unit with bash -eu flag which causes fail on GH Actions macOs runner but locally works fine.
we can keep this opened, i will debug this once i finish my project release-me
I am able to reproduce the bug and this is really not bashcov bug, an OS itself because it fails if one of immune tools are missing.
In the case of this bug, shuf was case.
bash -eux ./bash_unit
release-me on ξ master [$] via π³ ubuntu-vm is π¦ v0.9.2 via π₯ v1.1.12 via β¬’ v20.13.1 via π v3.3.2
β― env $(cat .env.test) bash -eux ./bash_unit tests/**/*.test.sh
+ VERSION=v2.3.1
++ printf '\033'
+ ESCAPE=$'\E'
+ NOCOLOR=''
+ RED=''
+ GREEN=''
+ YELLOW=''
+ BLUE=''
++ type -P cat
+ CAT=/bin/cat
++ type -P sed
+ SED=/usr/bin/sed
++ type -P grep
+ GREP=/usr/bin/grep
++ type -P rm
+ RM=/bin/rm
++ type -P shuf
++ exit 1
+ SHUF=
If i will change
https://github.com/pgrange/bash_unit/blob/3c1bdb074b01b7f779cff5fec525df1ef61a354d/bash_unit#L32-L36
lines to
CAT="$(type -P cat || exit 0)"
SED="$(type -P sed || exit 0)"
GREP="$(type -P grep || exit 0)"
RM="$(type -P rm || exit 0)"
SHUF="$(type -P shuf || exit 0)"
It runs and passes all tests
Hi @dalisoft,
shuf is needed to run tests in a random order (See -r option of bash_unit). It is part of the core-utils package on Debian or Ubuntu and so always present. But, indeed, it is not installed on OS X, hence the error you observe.
I've switch from shuf to using sort -R instead as this is available both on Linux and OS X systems. This should solve this issue.
Cheers,
Thank you @pgrange