-
Couldn't load subscription status.
- Fork 450
run: don't change the value of i #727
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
run: don't change the value of i #727
Conversation
aab64d3 to
f648b53
Compare
Instead of using run cmd [ "$status" -ne 0 ] since bats 1.5.0 we can use a simple form: run ! cmd Alas, bats has a bug which makes it change the value of "i" when run is used with any options ([1], [2]). To workaround that, we should not use "i" in any code which uses "run" with options. I know, this is crazy. [1] bats-core/bats-core#726 [2] bats-core/bats-core#727 Signed-off-by: Kir Kolyshkin <[email protected]>
Instead of using run cmd [ "$status" -ne 0 ] since bats 1.5.0 we can use a simple form: run ! cmd Alas, bats has a bug which makes it change the value of "i" when run is used with any options ([1], [2]). To workaround that, we should not use "i" in any code which uses "run" with options. I know, this is crazy. [1] bats-core/bats-core#726 [2] bats-core/bats-core#727 Signed-off-by: Kir Kolyshkin <[email protected]>
|
Adding a test case is useless, of course, since next time someone will change |
Instead of using run cmd [ "$status" -ne 0 ] since bats 1.5.0 we can use a simple form: run ! cmd Alas, bats has a bug which makes it change the value of "i" when run is used with any options ([1], [2]). To workaround that, we should not use "i" in any code which uses "run" with options. I know, this is crazy. [1] bats-core/bats-core#726 [2] bats-core/bats-core#727 Signed-off-by: Kir Kolyshkin <[email protected]>
|
One failure in CI (no idea if related in any way); |
|
It seems the output from mktemp changed (again) in alpine. I fixed the test expecation in bats-core/bats-file@c0f822a |
I came across an interesting bug today. A very simple test code stopped working properly once I changed "run" followed by the $status check to "run !". See bats-core#726 for a repro. The fix is to always declare your variables. Signed-off-by: Kir Kolyshkin <[email protected]>
f648b53 to
502dc47
Compare
|
Thanks for your contribution. |
Instead of using run cmd [ "$status" -ne 0 ] since bats 1.5.0 we can use a simple form: run ! cmd Alas, bats has a bug which makes it change the value of "i" when run is used with any options ([1], [2]). To workaround that, we should not use "i" in any code which uses "run" with options. I know, this is crazy. [1] bats-core/bats-core#726 [2] bats-core/bats-core#727 Signed-off-by: Kir Kolyshkin <[email protected]>
I came across an interesting bug today. A very simple test code stopped working properly once I changed "run" followed by the $status check to "run !".
Fixes: #726 (see for a repro).
The fix is to always declare your variables.