Skip to content

Commit

Permalink
handling case when there are no tests in testable summary (via #37)
Browse files Browse the repository at this point in the history
  • Loading branch information
timbaev authored Oct 5, 2022
1 parent 033ebe9 commit c03f1b1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/main/java/io/eroshenkoam/xcresults/export/ExportCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,14 @@ private void runUnsafe() throws Exception {
for (JsonNode summary : testRef.get(SUMMARIES).get(VALUES)) {
for (JsonNode testableSummary : summary.get(TESTABLE_SUMMARIES).get(VALUES)) {
final ExportMeta testMeta = getTestMeta(meta, testableSummary);
for (JsonNode test : testableSummary.get(TESTS).get(VALUES)) {
getTestSummaries(test).forEach(testSummary -> {
testSummaries.put(testSummary, testMeta);
});
if (testableSummary.has(TESTS) && testableSummary.get(TESTS).has(VALUES)) {
for (JsonNode test : testableSummary.get(TESTS).get(VALUES)) {
getTestSummaries(test).forEach(testSummary -> {
testSummaries.put(testSummary, testMeta);
});
}
} else {
System.out.printf("No tests found for '%s'%n", testableSummary.get("name").get(VALUE));
}
}
}
Expand Down

0 comments on commit c03f1b1

Please sign in to comment.