-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Empty report when beforeAll is failing #2537
Comments
Very good point, we should also included failed containers. |
@dubilyer Are you sure those tests fail in a Lines 106 to 119 in 17d3b44
|
I have a quite complex project, and didn't manage to create a simple
reproducer yet, but I'll share my understanding.
All tests in a class are parametrized. So we have the following structure
(as I remember it :) :
[ test-engine]
|
---- [.../test-class]
|
-----[.../test-class/test-method]
|
----[.../test-class/test-method/invocation1]
----[.../test-class/test-method/invocation2]
-----[.../test-class/test-method]
|
----[.../test-class/test-method/invocation1]
----[.../test-class/test-method/invocation2]
When beforeAll is failing, we have a failed test-class; and skipped(? not
sure, can check) tests method. And it's not even start invocations.
So we have an empty list in writeXmlReport method because the stream has
been filtered by TestIdentifier::isTest. So nothing is written even if we
have something inside XmlReportData.
If we have non-parameterized tests, everything works as expected.
|
Prior to this commit, failing containers were only reported in case they contained at least one test. However, for example for a parameterized Jupiter tests and an exception in a `@BeforeAll` method, that led to failures being silently swallowed. Now, in addition to tests, leaf nodes of the test tree are always included in the XML report, even if they are containers, not tests. Fixes #2537.
Prior to this commit, failing containers were only reported in case they contained at least one test. However, for example for a parameterized Jupiter tests and an exception in a `@BeforeAll` method, that led to failures being silently swallowed. Now, in addition to tests, leaf nodes of the test tree are always included in the XML report, even if they are containers, not tests. Moreover, failures on the container level that occurred after their children had been executed were not reported, e.g. when an exception was thrown from a Jupiter `@AfterAll` method. Now such failures cause the contained tests to be reported as failed. Fixes #2537.
Prior to this commit, failing containers were only reported in case they contained at least one test. However, for example for a parameterized Jupiter tests and an exception in a `@BeforeAll` method, that led to failures being silently swallowed. Now, in addition to tests, leaf nodes of the test tree are always included in the XML report, even if they are containers, not tests. Moreover, failures on the container level that occurred after their children had been executed were not reported, e.g. when an exception was thrown from a Jupiter `@AfterAll` method. Now such failures cause the contained tests to be reported as failed. Fixes #2537.
I think I figured it out. 🙂 @dubilyer Do you have time to verify my change with your project against the latest 5.7.1-SNAPSHOT version from https://oss.sonatype.org/content/repositories/snapshots/? |
I will check and update. Thanks a lot! |
Prior to this commit, failing containers were only reported in case they contained at least one test. However, for example for a parameterized Jupiter tests and an exception in a `@BeforeAll` method, that led to failures being silently swallowed. Now, in addition to tests, leaf nodes of the test tree are always included in the XML report, even if they are containers, not tests. Moreover, failures on the container level that occurred after their children had been executed were not reported, e.g. when an exception was thrown from a Jupiter `@AfterAll` method. Now such failures cause the contained tests to be reported as failed. Fixes junit-team#2537.
Cannot get a platform dependency with this version. |
For platform, it would be 1.7.1-SNAPSHOT. However, we've released 1.7.1/5.7.1 in the meantime. |
Issue resolved! Thanks a lot. Waiting for release version :) |
@dubilyer, it has already been released: https://github.com/junit-team/junit5/releases/tag/r5.7.1 |
Prior to this commit, failing containers were only reported in case they contained at least one test. However, for example for a parameterized Jupiter tests and an exception in a `@BeforeAll` method, that led to failures being silently swallowed. Now, in addition to tests, leaf nodes of the test tree are always included in the XML report, even if they are containers, not tests. Moreover, failures on the container level that occurred after their children had been executed were not reported, e.g. when an exception was thrown from a Jupiter `@AfterAll` method. Now such failures cause the contained tests to be reported as failed. Fixes junit-team#2537.
Steps to reproduce
Because we have:
in XmlReportWriter
and all skipped tests are containers (isTest() = false), we have a completely clean xml report with no way to understand, that beforeAll failed and tests were skipped.
Junit version is 5.5.1, platform 1.7.1
The text was updated successfully, but these errors were encountered: