parser/gotest: Handle build errors in test packages with _test suffix

It's possible for test files to declare a package with the "_test"
suffix. If these packages contain build errors, they were not correctly
matched to the package without the "_test" suffix.

Refs #145
This commit is contained in:
Joël Stemmer
2022-09-17 01:05:30 +01:00
parent 81e5aaaaf1
commit 97e0285183
4 changed files with 36 additions and 1 deletions

View File

@ -392,6 +392,26 @@ func TestReportSpecialCases(t *testing.T) {
},
},
},
{
"build error in package with _test suffix",
[]Event{
{Type: "build_output", Name: "package/name_test"},
{Type: "summary", Name: "package/name", Result: "FAIL", Data: "[build failed]"},
},
gtr.Report{
Packages: []gtr.Package{
{
Name: "package/name",
Timestamp: testTimestamp,
BuildError: gtr.Error{
ID: 1,
Name: "package/name_test",
Cause: "[build failed]",
},
},
},
},
},
}
for _, test := range tests {