-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
test failures not detected when using nested test cases #98
Comments
What should the semantics be here? I agree that this is not great, but it's not clear what we want to happen. |
In the example above a check failed, yet the summary line indicates that there were zero failures and the exit code from the raco test program is 0, indicating success. What I would like to happen instead is:
Alternatively, nested test cases should trigger a compilation or runtime error, as it is an easy mistake to write nested test cases, and their behavior is surprising, at least. |
(Reposted from #136 to keep discussion in one place) This does seem related to "nested" test cases but there's more to it. Some observations using the example in the description [in #136 ]:
Personally, I didn't even know that Note that even though the check doesn't count as failed in the summary, it does still count as one test. Having
On point 2, I think I'd lean towards coalescing |
For what is worth, I wrote my own test runner package, al2-test-runner, which does not have the problem I reported here, so I am no longer affected by this issue. My package also does not have a problem with the issue reported in #136 either. If I understand correctly, the In case you want to use |
Realistically we can't change Honestly my take is that test suites were a mistake and shouldn't have existed. My preference would be to move all of the test suite related functionality into a separate section of the docs with "Legacy API" in the heading. |
Deprecate |
Why is FWIW, it's the only facility that allows "setup" and "teardown", which are really useful. If it's to be deprecated, there should be something else to replace it that implements these features. |
Would something like this be possible?
|
The problem that I reported in this issue is a problem with #lang racket
(require rackunit rackunit/gui)
(define ts1
(test-suite
"ts1 test-suite"
(test-case "outer test case"
(test-case "inner test case"
(check = 1 0)))))
(module+ test
(test/gui ts1)) There may be other problems with rackunit, which I don't fully understand, and perhaps there a are good reasons for removing However, I think that the suggestions made by @countvajhula and @jackfirth will not directly address the issue I reported and perhaps proposals to remove |
It seems that "check" failures inside a nested test suite is not considered a "test" failure: when running the code below, note the
(check = 0 1)
, the failure is reported to the console, but the test passes:When running the code with `raco test sample.rkt", I get:
So the check is failing, but the result shows that the test passed and the "raco test" process returns 0 (success).
The text was updated successfully, but these errors were encountered: