Closed chmaynard closed 1 year ago
On my machine, I receive errors with Bats v1.4.1-v1.7.0. But, both v1.8.0 and v1.9.0 work for me.
What version of Bash are you on? I'm GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)
.
I'm using GNU bash, version 5.2.15(1)-release (aarch64-apple-darwin21.6.0)
and Bats 1.10.0
. I don't think this is a serious issue but perhaps the author of include-test.bats
will weigh in.
The errors do not seem to reproduce with GNU bash, version 5.2.15(1)-release (x86_64-redhat-linux-gnu)
[in Fedora Linux 37 (Server Edition)] & bats 1.0.0-1.10.0, and bats-core/bats-core master
& bash-preexec master
. Bats 1.4.0-1.7.0 produces some errors, but they are from bash-preexec.bats
and unrelated to the present errors from include-test.bats
.
I suspect you are forcibly pre-loading bash-preexec.sh
in all the Bash processes through e.g., BASH_ENV
. The tests from test/include-test.bats
test the loading of bash-preexec.sh
, so they will fail if bash-preexec.sh
is already loaded when the tests start. The reported errors seem reproducible by e.g. setting the path to bash-preexec.sh
in BASH_ENV
:
$ BASH_ENV=~0/bash-preexec.sh bats test/include-test.bats
include-test.bats
✗ should not import if it's already defined
(in test file test/include-test.bats, line 6)
`[ -z $(type -t __bp_install) ]' failed
✓ should import if not defined
✗ bp should stop installation if HISTTIMEFORMAT is readonly
(in test file test/include-test.bats, line 18)
`[ $status -ne 0 ]' failed
3 tests, 2 failures
What are the values of BASH_ENV
and ENV
in your environment?
I suspect you are forcibly pre-loading bash-preexec.sh in all the Bash processes ...
You are correct. Sorry for the false alarm.
Closing this issue.
No problem!