-
Couldn't load subscription status.
- Fork 450
Fix for tests reading from stdin #227
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
Conversation
|
Alternative would be e.g. redirecting /dev/null do stdin for the test commands, see e.g. https://stackoverflow.com/questions/13800225/shell-script-while-read-line-loop-stops-after-the-first-line But I think this solution is better as it only relies on "simply" bashisms like iterating over a previously filled array. It also avoids an issue if the path to the test file contains a TAB |
c5d200d to
003f3d4
Compare
|
Thanks @Flamefire, this LGTM. Agreed on "simply Bashisms". Anybody else from @bats-core/bats-core or @cyphar want to have a look? |
|
LGTM from me. Thanks @Flamefire! |
Can happen e.g. when test code reads stdin which consumes remaining tests and was silently ignored (OK returned) This now makes the test run fail if not all tests were executed
Use an array to iterate over to avoid using stdin for test orchestration Fixes bats-core#197
Move to bats folder as it is a single test Extracting into an own command file required to use `bash -c`
|
Awesome! Fast and clean. Cheers @Flamefire : ] I'll keep on with your changes in other PRs, sorry it's a bit slow -- we'll get there 🙏 |
As discussed in #197 the PR #172 introduced a change which broke the test runner when the test consumed stdin (containing remaining tests) by
Iterating over the
all_testsarray previously created and split at the last TAB found. By construction of the test lines this should work in all cases (test function names cannot contain a TAB)count number of executed tests and fail if it doesn't match number of tests that were scheduled
show number of not-run tests in the pretty-printer summary by counting passed tests
I have reviewed the Contributor Guidelines.
I have reviewed the Code of Conduct and agree to abide by it