mirror of
https://github.com/jstemmer/go-junit-report.git
synced 2025-07-05 21:42:53 -05:00
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:
@ -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 {
|
||||
|
Reference in New Issue
Block a user