-
Couldn't load subscription status.
- Fork 1.4k
feat(zio-test): include duration in JUnit test reports #4972
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
feat(zio-test): include duration in JUnit test reports #4972
Conversation
|
I think this use case is already addressed by the |
0251609 to
526daf1
Compare
|
Thanks, I still have a problem though, the duration of a failing test is reported as 0. (I rebased on master so my branch already includes this fix: #4988). The
|
|
@MichalPawlicki No that line of code only runs if the suite can't be created at all (e.g. the suite of tests was supposed to be generated based on contents from a file and couldn't be loaded). The time of failing tests is being reported correctly in tests with SBT so I would look in the implementation of the JUnit runner itself. |
|
So basically, this seems to work. When I break a random test, annotate it with <testcase classname="zio.test.TestAspectSpec" name="around evaluates tests inside context of Managed" time="0.208">
<failure message="No Exception or message provided"/>
</testcase>I'm just having problems with making it work in |
526daf1 to
71668e7
Compare
|
I spent some time debugging it, but I can't get the assertion in (Note: this is not an issue with JUnit runner, but with JUnit test reports generated by default by sbt). Any idea what else might be wrong? Would it be an option to merge the change in |
|
@MichalPawlicki That's fine. |
71668e7 to
4ca23b6
Compare
|
@adamgfraser this is ready for review. 🙂 In the end, I added a test, but just for a passing spec. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! 🙏
Include durations of individual tests in JUnit reports generated by sbt. Addresses #4803.
This is still WIP and I'd like to get some feedback before I move forward. Basically, my idea is to:
durationfield toTestSuccessandTestFailure.ZTest#applyand pass the duration toTestSuccess/TestFailure.ZTestEvent#from, pass the duration toZTestEvent.A couple of questions about this approach:
TestSuccessandTestFailurethe right places to store duration?assertioninZTest#applyproduces expected results, but maybe there's a better place to do it?