Skip to content

Commit

Permalink
Include tests skipped on the JVM in the native-image used for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksandar Gradinac committed Jun 23, 2021
1 parent 4d76611 commit 396f409
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,19 @@ public void testPlanExecutionStarted(TestPlan testPlan) {
this.testPlan = testPlan;
}

@Override
public void executionSkipped(TestIdentifier testIdentifier, String reason) {
printTest(testIdentifier, "SKIPPED: " + reason);
}

@Override
public void executionFinished(TestIdentifier testIdentifier, TestExecutionResult testExecutionResult) {
printTest(testIdentifier, testExecutionResult.getStatus().name());
}

private void printTest(TestIdentifier testIdentifier, String status) {
if (testIdentifier.getParentId().isPresent() && !testIdentifier.isContainer()) {
out.println(LegacyReportingUtils.getClassName(testPlan, testIdentifier) + " > " + testIdentifier.getDisplayName() + " " + testExecutionResult.getStatus().name() + "\n");
out.println(LegacyReportingUtils.getClassName(testPlan, testIdentifier) + " > " + testIdentifier.getDisplayName() + " " + status + "\n");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,17 @@ public class UniqueIdTrackingTestExecutionListener implements TestExecutionListe

private final List<String> uniqueIds = new ArrayList<>();

@Override
public void executionSkipped(TestIdentifier testIdentifier, String reason) {
addTest(testIdentifier);
}

@Override
public void executionFinished(TestIdentifier testIdentifier, TestExecutionResult testExecutionResult) {
addTest(testIdentifier);
}

private void addTest(TestIdentifier testIdentifier) {
if (testIdentifier.isTest()) {
this.uniqueIds.add(testIdentifier.getUniqueId());
}
Expand Down

0 comments on commit 396f409

Please sign in to comment.