Skip to content

Commit

Permalink
Update expected value for new output of subtests
Browse files Browse the repository at this point in the history
Which seems to be the output that existed in go1.14.5 and earlier.
  • Loading branch information
dnephin committed Feb 8, 2023
1 parent 751ecb3 commit ae7f0fd
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 47 deletions.
21 changes: 6 additions & 15 deletions cmd/main_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,26 +120,17 @@ func osEnviron() map[string]string {
func expectedFilename(name string) string {
ver := runtime.Version()
switch {
case isPreGo114(ver):
return name + "-go1.13"
case isPreGo120(ver):
return name + "-go1.19"
default:
return name
}
}

// go1.14.6 changed how it prints messages from tests. go1.14.{0-5} used a format
// that was different from both go1.14.6 and previous versions of Go. These tests
// no longer support that format.
func isPreGo114(ver string) bool {
prefix := "go1.1"
if !strings.HasPrefix(ver, prefix) || len(ver) < len(prefix)+1 {
return false
}
switch ver[len(prefix)] {
case '0', '1', '2', '3':
return true
}
return false
// go1.20.0 changed how it prints messages from subtests. It seems the output
// has changed back to match the output from go1.14 and earlier.
func isPreGo120(ver string) bool {
return strings.HasPrefix(ver, "go1.1")
}

var binaryFixture pkgFixtureFile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ FAIL cmd/testdata/e2e/flaky.TestFailsSometimes
PASS cmd/testdata/e2e/flaky.TestFailsOften/subtest_always_passes
=== RUN TestFailsOften/subtest_may_fail
flaky_test.go:68: not this time
--- FAIL: TestFailsOften/subtest_may_fail
--- FAIL: TestFailsOften/subtest_may_fail
FAIL cmd/testdata/e2e/flaky.TestFailsOften/subtest_may_fail
=== RUN TestFailsOften
SEED: 0
Expand All @@ -30,7 +30,7 @@ PASS cmd/testdata/e2e/flaky.TestFailsSometimes (re-run 1)
PASS cmd/testdata/e2e/flaky
=== RUN TestFailsOften/subtest_may_fail
flaky_test.go:68: not this time
--- FAIL: TestFailsOften/subtest_may_fail
--- FAIL: TestFailsOften/subtest_may_fail
FAIL cmd/testdata/e2e/flaky.TestFailsOften/subtest_may_fail (re-run 1)
=== RUN TestFailsOften
SEED: 3
Expand All @@ -42,7 +42,7 @@ DONE 2 runs, 12 tests, 6 failures

=== RUN TestFailsOften/subtest_may_fail
flaky_test.go:68: not this time
--- FAIL: TestFailsOften/subtest_may_fail
--- FAIL: TestFailsOften/subtest_may_fail
FAIL cmd/testdata/e2e/flaky.TestFailsOften/subtest_may_fail (re-run 2)
=== RUN TestFailsOften
SEED: 4
Expand All @@ -61,21 +61,18 @@ SEED: 0

=== FAIL: cmd/testdata/e2e/flaky TestFailsOften/subtest_may_fail
flaky_test.go:68: not this time
--- FAIL: TestFailsOften/subtest_may_fail

=== FAIL: cmd/testdata/e2e/flaky TestFailsOften
SEED: 0

=== FAIL: cmd/testdata/e2e/flaky TestFailsOften/subtest_may_fail (re-run 1)
flaky_test.go:68: not this time
--- FAIL: TestFailsOften/subtest_may_fail

=== FAIL: cmd/testdata/e2e/flaky TestFailsOften (re-run 1)
SEED: 3

=== FAIL: cmd/testdata/e2e/flaky TestFailsOften/subtest_may_fail (re-run 2)
flaky_test.go:68: not this time
--- FAIL: TestFailsOften/subtest_may_fail

=== FAIL: cmd/testdata/e2e/flaky TestFailsOften (re-run 2)
SEED: 4
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
PASS cmd/testdata/e2e/flaky.TestAlwaysPasses
=== RUN TestFailsRarely
SEED: 0
--- FAIL: TestFailsRarely
flaky_test.go:51: not this time
--- FAIL: TestFailsRarely
FAIL cmd/testdata/e2e/flaky.TestFailsRarely
=== RUN TestFailsSometimes
SEED: 0
--- FAIL: TestFailsSometimes
flaky_test.go:58: not this time
--- FAIL: TestFailsSometimes
FAIL cmd/testdata/e2e/flaky.TestFailsSometimes
PASS cmd/testdata/e2e/flaky.TestFailsOften/subtest_always_passes
=== RUN TestFailsOften/subtest_may_fail
flaky_test.go:68: not this time
--- FAIL: TestFailsOften/subtest_may_fail
flaky_test.go:68: not this time
FAIL cmd/testdata/e2e/flaky.TestFailsOften/subtest_may_fail
=== RUN TestFailsOften
SEED: 0
Expand All @@ -29,8 +29,8 @@ PASS cmd/testdata/e2e/flaky
PASS cmd/testdata/e2e/flaky.TestFailsSometimes (re-run 1)
PASS cmd/testdata/e2e/flaky
=== RUN TestFailsOften/subtest_may_fail
flaky_test.go:68: not this time
--- FAIL: TestFailsOften/subtest_may_fail
flaky_test.go:68: not this time
FAIL cmd/testdata/e2e/flaky.TestFailsOften/subtest_may_fail (re-run 1)
=== RUN TestFailsOften
SEED: 3
Expand All @@ -41,8 +41,8 @@ FAIL cmd/testdata/e2e/flaky
DONE 2 runs, 12 tests, 6 failures

=== RUN TestFailsOften/subtest_may_fail
flaky_test.go:68: not this time
--- FAIL: TestFailsOften/subtest_may_fail
flaky_test.go:68: not this time
FAIL cmd/testdata/e2e/flaky.TestFailsOften/subtest_may_fail (re-run 2)
=== RUN TestFailsOften
SEED: 4
Expand All @@ -60,22 +60,22 @@ SEED: 0
flaky_test.go:58: not this time

=== FAIL: cmd/testdata/e2e/flaky TestFailsOften/subtest_may_fail
flaky_test.go:68: not this time
--- FAIL: TestFailsOften/subtest_may_fail
flaky_test.go:68: not this time

=== FAIL: cmd/testdata/e2e/flaky TestFailsOften
SEED: 0

=== FAIL: cmd/testdata/e2e/flaky TestFailsOften/subtest_may_fail (re-run 1)
flaky_test.go:68: not this time
--- FAIL: TestFailsOften/subtest_may_fail
flaky_test.go:68: not this time

=== FAIL: cmd/testdata/e2e/flaky TestFailsOften (re-run 1)
SEED: 3

=== FAIL: cmd/testdata/e2e/flaky TestFailsOften/subtest_may_fail (re-run 2)
flaky_test.go:68: not this time
--- FAIL: TestFailsOften/subtest_may_fail
flaky_test.go:68: not this time

=== FAIL: cmd/testdata/e2e/flaky TestFailsOften (re-run 2)
SEED: 4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ FAIL cmd/testdata/e2e/flaky.TestFailsSometimes
PASS cmd/testdata/e2e/flaky.TestFailsOften/subtest_always_passes
=== RUN TestFailsOften/subtest_may_fail
flaky_test.go:68: not this time
--- FAIL: TestFailsOften/subtest_may_fail
--- FAIL: TestFailsOften/subtest_may_fail
FAIL cmd/testdata/e2e/flaky.TestFailsOften/subtest_may_fail
=== RUN TestFailsOften
SEED: 0
Expand All @@ -30,7 +30,7 @@ PASS cmd/testdata/e2e/flaky.TestFailsSometimes (re-run 1)
PASS cmd/testdata/e2e/flaky
=== RUN TestFailsOften/subtest_may_fail
flaky_test.go:68: not this time
--- FAIL: TestFailsOften/subtest_may_fail
--- FAIL: TestFailsOften/subtest_may_fail
FAIL cmd/testdata/e2e/flaky.TestFailsOften/subtest_may_fail (re-run 1)
=== RUN TestFailsOften
SEED: 3
Expand All @@ -42,7 +42,7 @@ DONE 2 runs, 12 tests, 6 failures

=== RUN TestFailsOften/subtest_may_fail
flaky_test.go:68: not this time
--- FAIL: TestFailsOften/subtest_may_fail
--- FAIL: TestFailsOften/subtest_may_fail
FAIL cmd/testdata/e2e/flaky.TestFailsOften/subtest_may_fail (re-run 2)
=== RUN TestFailsOften
SEED: 4
Expand All @@ -54,7 +54,7 @@ DONE 3 runs, 14 tests, 8 failures

=== RUN TestFailsOften/subtest_may_fail
flaky_test.go:68: not this time
--- FAIL: TestFailsOften/subtest_may_fail
--- FAIL: TestFailsOften/subtest_may_fail
FAIL cmd/testdata/e2e/flaky.TestFailsOften/subtest_may_fail (re-run 3)
=== RUN TestFailsOften
SEED: 5
Expand All @@ -79,28 +79,24 @@ SEED: 0

=== FAIL: cmd/testdata/e2e/flaky TestFailsOften/subtest_may_fail
flaky_test.go:68: not this time
--- FAIL: TestFailsOften/subtest_may_fail

=== FAIL: cmd/testdata/e2e/flaky TestFailsOften
SEED: 0

=== FAIL: cmd/testdata/e2e/flaky TestFailsOften/subtest_may_fail (re-run 1)
flaky_test.go:68: not this time
--- FAIL: TestFailsOften/subtest_may_fail

=== FAIL: cmd/testdata/e2e/flaky TestFailsOften (re-run 1)
SEED: 3

=== FAIL: cmd/testdata/e2e/flaky TestFailsOften/subtest_may_fail (re-run 2)
flaky_test.go:68: not this time
--- FAIL: TestFailsOften/subtest_may_fail

=== FAIL: cmd/testdata/e2e/flaky TestFailsOften (re-run 2)
SEED: 4

=== FAIL: cmd/testdata/e2e/flaky TestFailsOften/subtest_may_fail (re-run 3)
flaky_test.go:68: not this time
--- FAIL: TestFailsOften/subtest_may_fail

=== FAIL: cmd/testdata/e2e/flaky TestFailsOften (re-run 3)
SEED: 5
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
PASS cmd/testdata/e2e/flaky.TestAlwaysPasses
=== RUN TestFailsRarely
SEED: 0
--- FAIL: TestFailsRarely
flaky_test.go:51: not this time
--- FAIL: TestFailsRarely
FAIL cmd/testdata/e2e/flaky.TestFailsRarely
=== RUN TestFailsSometimes
SEED: 0
--- FAIL: TestFailsSometimes
flaky_test.go:58: not this time
--- FAIL: TestFailsSometimes
FAIL cmd/testdata/e2e/flaky.TestFailsSometimes
PASS cmd/testdata/e2e/flaky.TestFailsOften/subtest_always_passes
=== RUN TestFailsOften/subtest_may_fail
flaky_test.go:68: not this time
--- FAIL: TestFailsOften/subtest_may_fail
flaky_test.go:68: not this time
FAIL cmd/testdata/e2e/flaky.TestFailsOften/subtest_may_fail
=== RUN TestFailsOften
SEED: 0
Expand All @@ -29,8 +29,8 @@ PASS cmd/testdata/e2e/flaky
PASS cmd/testdata/e2e/flaky.TestFailsSometimes (re-run 1)
PASS cmd/testdata/e2e/flaky
=== RUN TestFailsOften/subtest_may_fail
flaky_test.go:68: not this time
--- FAIL: TestFailsOften/subtest_may_fail
flaky_test.go:68: not this time
FAIL cmd/testdata/e2e/flaky.TestFailsOften/subtest_may_fail (re-run 1)
=== RUN TestFailsOften
SEED: 3
Expand All @@ -41,8 +41,8 @@ FAIL cmd/testdata/e2e/flaky
DONE 2 runs, 12 tests, 6 failures

=== RUN TestFailsOften/subtest_may_fail
flaky_test.go:68: not this time
--- FAIL: TestFailsOften/subtest_may_fail
flaky_test.go:68: not this time
FAIL cmd/testdata/e2e/flaky.TestFailsOften/subtest_may_fail (re-run 2)
=== RUN TestFailsOften
SEED: 4
Expand All @@ -53,8 +53,8 @@ FAIL cmd/testdata/e2e/flaky
DONE 3 runs, 14 tests, 8 failures

=== RUN TestFailsOften/subtest_may_fail
flaky_test.go:68: not this time
--- FAIL: TestFailsOften/subtest_may_fail
flaky_test.go:68: not this time
FAIL cmd/testdata/e2e/flaky.TestFailsOften/subtest_may_fail (re-run 3)
=== RUN TestFailsOften
SEED: 5
Expand All @@ -78,29 +78,29 @@ SEED: 0
flaky_test.go:58: not this time

=== FAIL: cmd/testdata/e2e/flaky TestFailsOften/subtest_may_fail
flaky_test.go:68: not this time
--- FAIL: TestFailsOften/subtest_may_fail
flaky_test.go:68: not this time

=== FAIL: cmd/testdata/e2e/flaky TestFailsOften
SEED: 0

=== FAIL: cmd/testdata/e2e/flaky TestFailsOften/subtest_may_fail (re-run 1)
flaky_test.go:68: not this time
--- FAIL: TestFailsOften/subtest_may_fail
flaky_test.go:68: not this time

=== FAIL: cmd/testdata/e2e/flaky TestFailsOften (re-run 1)
SEED: 3

=== FAIL: cmd/testdata/e2e/flaky TestFailsOften/subtest_may_fail (re-run 2)
flaky_test.go:68: not this time
--- FAIL: TestFailsOften/subtest_may_fail
flaky_test.go:68: not this time

=== FAIL: cmd/testdata/e2e/flaky TestFailsOften (re-run 2)
SEED: 4

=== FAIL: cmd/testdata/e2e/flaky TestFailsOften/subtest_may_fail (re-run 3)
flaky_test.go:68: not this time
--- FAIL: TestFailsOften/subtest_may_fail
flaky_test.go:68: not this time

=== FAIL: cmd/testdata/e2e/flaky TestFailsOften (re-run 3)
SEED: 5
Expand Down

0 comments on commit ae7f0fd

Please sign in to comment.