Skip to content

Commit

Permalink
Merge pull request #170 from sdowell/gotest-parsing
Browse files Browse the repository at this point in the history
fix: properly parse resume prefix for gotest 1.20
  • Loading branch information
jstemmer authored Oct 18, 2023
2 parents 506f012 + 8a66d8a commit a24b123
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions parser/gotest/gotest.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ func (p *Parser) parseLine(line string) (events []Event) {
return p.pauseTest(strings.TrimSpace(line[10:]))
} else if strings.HasPrefix(line, "=== CONT ") {
return p.contTest(strings.TrimSpace(line[9:]))
} else if strings.HasPrefix(line, "=== NAME ") {
// for compatibility with gotest 1.20+ https://go-review.git.corp.google.com/c/go/+/443596
return p.contTest(strings.TrimSpace(line[9:]))
} else if matches := regexEndTest.FindStringSubmatch(line); len(matches) == 5 {
return p.endTest(line, matches[1], matches[2], matches[3], matches[4])
} else if matches := regexStatus.FindStringSubmatch(line); len(matches) == 2 {
Expand Down
4 changes: 4 additions & 0 deletions parser/gotest/gotest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ var parseLineTests = []parseLineTest{
"=== CONT TestOne",
[]Event{{Type: "cont_test", Name: "TestOne"}},
},
{
"=== NAME TestOne",
[]Event{{Type: "cont_test", Name: "TestOne"}},
},
{
"--- PASS: TestOne (12.34 seconds)",
[]Event{{Type: "end_test", Name: "TestOne", Result: "PASS", Duration: 12_340 * time.Millisecond}},
Expand Down

0 comments on commit a24b123

Please sign in to comment.