Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions pkg/cmd/bazci/githubpost/githubpost.go
Original file line number Diff line number Diff line change
Expand Up @@ -536,12 +536,28 @@ func listFailuresFromTestXML(
fmt.Printf("couldn't parse time %s as float64: %+v\n", testCase.Time, err)
}
}
event := testEvent{
Action: "fail",
Package: pkg,
Test: testCase.Name,
Output: result.Contents,
Elapsed: elapsed,
var event testEvent
if pkg == testCase.Name {
// Test case or suite name is potentially irregular and does not
// match the expected format. Test binary may not have successfully
// executed or encountered some other error. We will make a special
// testEvent for this case.
// See unit tests for an example. See #159708 for more details.
log.Printf("encountered xml with non fully qualified test failure(s) %s and test suite(s) %s", pkg, testCase.Name)
event = testEvent{
Package: pkg,
Test: testCase.Name,
Output: fmt.Sprintf("Test binary potentially failed to execute because of bazel test timeout,"+
" init() issue, or some other error. Content: %s", result.Contents),
}
} else {
event = testEvent{
Action: "fail",
Package: pkg,
Test: testCase.Name,
Output: result.Contents,
Elapsed: elapsed,
}
}
failures[key] = append(failures[key], event)
}
Expand Down
9 changes: 9 additions & 0 deletions pkg/cmd/bazci/githubpost/githubpost_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,15 @@ func TestListFailuresFromTestXML(t *testing.T) {
mention: []string{"@cockroachdb/unowned"},
}},
},
{
fileName: "test-error-142.xml", // #159708 case
expPkg: "pkg/sql/opt/testutils/testcat/testcat_test_/testcat_test",
expIssues: []issue{{
testName: "pkg",
title: "pkg/sql/opt/testutils/testcat/testcat_test_/testcat_test: pkg failed",
message: `Test binary potentially failed to execute because of bazel test timeout, init() issue, or some other error.`,
}},
},
}

for _, c := range testCases {
Expand Down
8 changes: 8 additions & 0 deletions pkg/cmd/bazci/githubpost/testdata/test-error-142.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<testsuites>
<testsuite errors="1" failures="0" skipped="0" tests="1" time="0"
name="pkg/sql/opt/testutils/testcat/testcat_test_/testcat_test" timestamp="">
<testcase name="pkg/sql/opt/testutils/testcat/testcat_test_/testcat_test" time="60">
<error message="exited with error code 142" />
</testcase>
</testsuite>
</testsuites>