Skip to content

Commit

Permalink
test/system: Silence warning with Bats >= 1.7.0
Browse files Browse the repository at this point in the history
Bats 1.7.0 emits a warning if a command passed to 'run' returns with an
exit code of 127 [1].

This requires Bats >= 1.5.0, which is present in Fedora >=35, and
supports specifying the exit code as an argument to Bats' 'run'
command [2].

However, bats_require_minimum_version can't be used, because it's
only available from Bats 1.7.0, which is new enough that it's absent in
Fedora 35.

[1] Bats commit c6dc2f88361a4f5b
    bats-core/bats-core#547
    https://bats-core.readthedocs.io/en/stable/warnings/BW01.html

[2] bats-core/bats-core#367
    bats-core/bats-core#507
    https://bats-core.readthedocs.io/en/stable/writing-tests.html

[3] Bats commit 71d6b71cebc3d32b
    bats-core/bats-core#556
    https://bats-core.readthedocs.io/en/stable/warnings/BW02.html

containers#1081
  • Loading branch information
debarshiray committed Jul 31, 2022
1 parent ea1f290 commit f58a904
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/system/104-run.bats
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ teardown() {

create_default_container

run $TOOLBOX run $cmd
run -127 $TOOLBOX run $cmd

assert_failure
assert [ $status -eq 127 ]
Expand Down

0 comments on commit f58a904

Please sign in to comment.