Support non existing XML logs for test result
If a test time out, it does not generate a XML output, so looking for
it would output an error. Ignore those entries.
@@ -163,12 +163,15 @@ class BazelUtils implements Serializable {
def cp_lines = []
events.each { event ->
if("testResult" in event) {
- def uri = URI.create(event.testResult.testActionOutput.find { it.name == "test.xml" }.uri)
+ def log = event.testResult.testActionOutput.find { it.name == "test.xml" }
+ if (log != null) {
+ def uri = URI.create(log.uri)
def relativePath = uri.path.substring(uri.path.indexOf("/testlogs/") + 10)
cp_lines.add("mkdir -p \$(dirname '${test_folder}/${relativePath}')")
cp_lines.add("cp -r '${uri.path}' '${test_folder}/${relativePath}'")
}
}
+ }
return cp_lines.join('\n')
}
