You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a test suite fails at the suite level, such as when a @BeforeClass method fails in a test class, BazelJUnitOutputListener logs an empty instead of properly capturing the failure. While Bazel logs the output for each test in the test class with the test result reflecting the test suite failure.
Steps to Reproduce:
Create a JUnit test class with a @BeforeClass method that fails (e.g., throws an exception).
public static class TestSuiteError {
@BeforeClass
public static void setup() {
throw new RuntimeException("test suite error");
}
@Test
public void test1() {
System.out.println("test1");
}
@Test
public void test2() {
System.out.println("test2");
}
}
Check the XML output generated by BazelJUnitOutputListener. The corresponding to this class will be empty.
Expected Behavior:
Each test in the test suite should be logged with same error log as parent test suite. Idenitical to Bazel XmlWriter.
Actual Behavior:
BazelJUnitOutputListener logs an empty .
The text was updated successfully, but these errors were encountered:
…res (#328)
fixes: #327
1. Updated code to propagate the test suite failure to each test case.
2. The test suite failure will be propagated to each child node, even if
the test is not executed.
3. Additionally, this change fixes the bug introduced in #300, which
incorrectly logged the test_suite as a testcase and logged incorrect
values for the "tests" attribute in the <testsuite> node.
Issue
When a test suite fails at the suite level, such as when a @BeforeClass method fails in a test class, BazelJUnitOutputListener logs an empty instead of properly capturing the failure. While Bazel logs the output for each test in the test class with the test result reflecting the test suite failure.
Steps to Reproduce:
Expected Behavior:
Actual Behavior:
The text was updated successfully, but these errors were encountered: