-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Erroneous return code and "test passed" message #118
Comments
Cc @omus |
It is not intended that So go ahead and make the PR |
Ok, in this case the problem would be deeper than I thought, i.e. it would need to be fixed in The way In contrast, my original solution would have been to simply alter the runner code and test with Are you sure |
Oh sorry I misunderstood what you means by unusuable. Its been 6 years since i wrote this code. |
|
Exactly. This was also my original idea and I think this is the much better solution compared to rewriting how flattening works (it's impossible to preserve the original testset structure without creating lots of copies or making certain assumptions). |
We've recently had trouble with
TestReports >= v1.0.0
. Our testing pipelines were erroneously succeeding even though some tests were failing (which was correctly documented in the generated xml). We've successfully tracked this down to the fact that the runner code fromgen_runner_code
insrc/runner.jl
only checks for failed results and determines the exit code after flattening the results.This MWE shows the problem with that:
with the output
I think I know exactly what's happening:
_flatten_results!
is using the original testset "mytestset" to wrap any bare results, replacing the original vector of results, so all results which were already themselves testsets, like "level2testset" in the example, simply disappear from the testset. Instead, they are returned via the resulting flattened vector,fr
in the above case. This is why the xml written by the runner code is correct, but the test withany_problems
fails. This problem doesn't occur if the testset doesn't contain any bare results that need to be wrapped, because the original testset is not modified in this case.This seems to be easy to fix by either testing with
any_problems
before flattening, or usingany(any_problems.(fr))
on the flattened vector instead.But before I make a pull request to implement this, I would like to confirm that this is not just an unintentional side effect of
flatten_results!
. I.e., isflatten_results!
indeed meant to make the original testset unusable, so the problem should be fixed in the runner code (and not in_flatten_results!
itself)?The text was updated successfully, but these errors were encountered: