Skip to content

Commit

Permalink
Mark test.xml omitted if it wasn't generated
Browse files Browse the repository at this point in the history
  • Loading branch information
coeuvre committed Jun 15, 2021
1 parent 6c2b9d1 commit 97139ce
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -774,18 +774,17 @@ public TestAttemptContinuation execute()
}


MetadataHandler metadataHandler = actionExecutionContext.getMetadataHandler();

Path xmlOutputPath = resolvedPaths.getXmlOutputPath();
boolean testXmlExists = xmlOutputPath.exists();
if (!testXmlExists) {
MetadataHandler metadataHandler = actionExecutionContext.getMetadataHandler();
if (metadataHandler != null) {
if (!testXmlExists && metadataHandler != null) {
try {
// Check whether test.xml exists. If not, an IOException will be thrown.
metadataHandler.getMetadata(testAction.getTestXml());
testXmlExists = true;
} catch (IOException ignored) {
}
}
}

// If the test did not create a test.xml, and --experimental_split_xml_generation is enabled,
Expand Down Expand Up @@ -814,6 +813,10 @@ public TestAttemptContinuation execute()
}
}

if (!testXmlExists && metadataHandler != null) {
metadataHandler.markOmitted(testAction.getTestXml());
}

TestCase details = parseTestResult(xmlOutputPath);
if (details != null) {
testResultDataBuilder.setTestCase(details);
Expand Down

0 comments on commit 97139ce

Please sign in to comment.