Skip to content

Commit 364ce7c

Browse files
stuartwdouglasgsmet
authored andcommitted
Report failures in @BeforeAll
Just report them as individual test failures for now, as it makes the reporting a lot more complex otherwise. (cherry picked from commit 442bd78)
1 parent 88bf0b6 commit 364ce7c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

core/deployment/src/main/java/io/quarkus/deployment/dev/testing/JunitTestRunner.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,23 @@ public void executionFinished(TestIdentifier testIdentifier, TestExecutionResult
324324
for (TestRunListener listener : listeners) {
325325
listener.testComplete(result);
326326
}
327+
} else if (testExecutionResult.getStatus() == TestExecutionResult.Status.FAILED) {
328+
//if a parent fails we fail the children
329+
Set<TestIdentifier> children = testPlan.getChildren(testIdentifier);
330+
for (TestIdentifier child : children) {
331+
UniqueId childId = UniqueId.parse(child.getUniqueId());
332+
result = new TestResult(child.getDisplayName(), testClass.getName(),
333+
childId,
334+
testExecutionResult,
335+
logHandler.captureOutput(), child.isTest(), runId);
336+
results.put(childId, result);
337+
if (child.isTest()) {
338+
for (TestRunListener listener : listeners) {
339+
listener.testStarted(child, testClass.getName());
340+
listener.testComplete(result);
341+
}
342+
}
343+
}
327344
}
328345
}
329346
if (testExecutionResult.getStatus() == TestExecutionResult.Status.FAILED) {

0 commit comments

Comments
 (0)