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 Dec 29, 2020
1 parent b752e2b commit 19b829b
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -773,18 +773,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 @@ -813,6 +812,10 @@ public TestAttemptContinuation execute()
}
}

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

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

0 comments on commit 19b829b

Please sign in to comment.