-
Couldn't load subscription status.
- Fork 450
Verbose output for faster troubleshooting of test problems #488
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
Verbose output for faster troubleshooting of test problems #488
Conversation
they would fail in the dockerized CI tests
Detecting the differing behavior seems not worth it, right now
to avoid --trace output from helper libraries
They will generate trace output too, so we need to use an extra FD to avoid altering the substution result. Redirecting the trace FD into BATS_OUT allows for interleaving of commands and their output.
|
@martin-schulze-vireso Good opportunity to switch to a proper branch :) |
|
This branch was already on master, could you just hard reset to the branch bats-core/trace_and_more? |
d5bcf7e to
758698f
Compare
|
Found another issue using the code: It looks as if it's setting the wrong path but I'm not entirely sure. |
|
The path strikes me as rather odd. Why is it in the .git folder? Also, I don't see how this is related to the trace output. I assume the test passes without |
If I try in the official CI, I see Different path, but same issue. Maybe some sort of ENV problem. The bats submodule is checked out to commit 758698f If I switch to 1.4.1 it works just fine. I'll keep playing around with it too and see if I can get more precise on what is actually wrong/happening. |
|
Turns out it had to do with the use of I'm not seeing where in the changes this could have started being an issue though. I'm ok keeping it changed for now. |
b11b65d to
758698f
Compare
|
I think I found a fix for that issue with |
0309012 to
387fdfe
Compare
|
It's perfect! Works great now! ❤️ 🎉 |
a5660f0 to
cce9e74
Compare
Note that file descriptors 3 and 4 are reserved by Bats. The former is used for adding custom text to the Test Anything Protocol (or TAP) stream [1] and the latter for tracing. [1] https://bats-core.readthedocs.io/en/stable/writing-tests.html#file-descriptor-3-read-this-if-bats-hangs https://bats-core.readthedocs.io/en/stable/writing-tests.html#printing-to-the-terminal [2] Bats commit 635700cd2282b754 bats-core/bats-core#467 bats-core/bats-core#488 containers#1066
Note that file descriptors 3 and 4 are reserved by Bats. The former is used for adding custom text to the Test Anything Protocol (or TAP) stream [1] and the latter for tracing [2]. [1] https://bats-core.readthedocs.io/en/stable/writing-tests.html#file-descriptor-3-read-this-if-bats-hangs https://bats-core.readthedocs.io/en/stable/writing-tests.html#printing-to-the-terminal [2] Bats commit 635700cd2282b754 bats-core/bats-core#467 bats-core/bats-core#488 containers#1066
Note that file descriptors 3 and 4 are reserved by Bats. The former is used for adding custom text to the Test Anything Protocol (or TAP) stream [1] and the latter for tracing [2]. [1] https://bats-core.readthedocs.io/en/stable/writing-tests.html#file-descriptor-3-read-this-if-bats-hangs https://bats-core.readthedocs.io/en/stable/writing-tests.html#printing-to-the-terminal [2] Bats commit 635700cd2282b754 bats-core/bats-core#467 bats-core/bats-core#488 containers#1066
Note that file descriptors 3 and 4 are reserved by Bats. The former is used for adding custom text to the Test Anything Protocol (or TAP) stream [1] and the latter for tracing [2]. [1] https://bats-core.readthedocs.io/en/stable/writing-tests.html#file-descriptor-3-read-this-if-bats-hangs https://bats-core.readthedocs.io/en/stable/writing-tests.html#printing-to-the-terminal [2] Bats commit 635700cd2282b754 bats-core/bats-core#467 bats-core/bats-core#488 containers#1066
Original PR: #467
bats --trace(or via $BATS_TRACE_LEVEL=1 env var, this name might be subject to change): print executed commandsbats --print-output-on-failure(or via $BATS_PRINT_OUTPUT_ON_FAILURE env var): print the value of "$output" when a test failsbats --show-output-of-succeeding-tests(or via $BATS_SHOW_OUTPUT_OF_SUCCEEDING_TESTS env var)bats --verbose-run(or via $BATS_VERBOSE_RUN env var): make run print $output by defaultbats --gather-test-outputs-in <dir>(or via$BATS_GATHER_TEST_OUTPUTS_IN=D<dir>, but then you have to ensure the directory exists): put output of each test (even succeeding!) into the given folder as files of the format<test number in suite>-<test description>.log