Skip to content

Commit a24b123

Browse files
authored
Merge pull request #170 from sdowell/gotest-parsing
fix: properly parse resume prefix for gotest 1.20
2 parents 506f012 + 8a66d8a commit a24b123

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

parser/gotest/gotest.go

+3
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ func (p *Parser) parseLine(line string) (events []Event) {
191191
return p.pauseTest(strings.TrimSpace(line[10:]))
192192
} else if strings.HasPrefix(line, "=== CONT ") {
193193
return p.contTest(strings.TrimSpace(line[9:]))
194+
} else if strings.HasPrefix(line, "=== NAME ") {
195+
// for compatibility with gotest 1.20+ https://go-review.git.corp.google.com/c/go/+/443596
196+
return p.contTest(strings.TrimSpace(line[9:]))
194197
} else if matches := regexEndTest.FindStringSubmatch(line); len(matches) == 5 {
195198
return p.endTest(line, matches[1], matches[2], matches[3], matches[4])
196199
} else if matches := regexStatus.FindStringSubmatch(line); len(matches) == 2 {

parser/gotest/gotest_test.go

+4
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ var parseLineTests = []parseLineTest{
4444
"=== CONT TestOne",
4545
[]Event{{Type: "cont_test", Name: "TestOne"}},
4646
},
47+
{
48+
"=== NAME TestOne",
49+
[]Event{{Type: "cont_test", Name: "TestOne"}},
50+
},
4751
{
4852
"--- PASS: TestOne (12.34 seconds)",
4953
[]Event{{Type: "end_test", Name: "TestOne", Result: "PASS", Duration: 12_340 * time.Millisecond}},

0 commit comments

Comments
 (0)