Skip to content

Commit ea91d8e

Browse files
committed
Check in more locations for 'testAttemptDurationMillis'
The location of this value in the bazel JSON structure can change based on whether or not a test was sharded.
1 parent 96a94ad commit ea91d8e

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

app/cdash/xml_handlers/BazelJSON_handler.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,12 @@ public function ParseLine($line)
545545
}
546546

547547
$test_name = $json_array['id']['testResult']['label'];
548-
$test_time = $json_array['testResult']['testAttemptDurationMillis'] / 1000.0;
548+
$test_time = 0;
549+
if (array_key_exists('testAttemptDurationMillis', $json_array['testResult'])) {
550+
$test_time = $json_array['testResult']['testAttemptDurationMillis'] / 1000.0;
551+
} elseif (array_key_exists('testAttemptDurationMillis', $json_array['id']['testResult'])) {
552+
$test_time = $json_array['id']['testResult']['testAttemptDurationMillis'] / 1000.0;
553+
}
549554

550555
if (array_key_exists('shard', $json_array['id']['testResult'])) {
551556
// This test uses shards, so a Test with this name

0 commit comments

Comments
 (0)