Skip to content

Commit

Permalink
Merge pull request #304 from gotestyourself/go1.20
Browse files Browse the repository at this point in the history
Use go 1.20 in CI
  • Loading branch information
dnephin authored Feb 8, 2023
2 parents 875f294 + 4787e5d commit 031d3c8
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 64 deletions.
29 changes: 12 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,25 @@ workflows:
ci:
jobs:
- go/test:
name: test-go-1.16
gotestsum-format: testname
executor:
name: go/golang
tag: 1.16-alpine

- go/test:
name: test-go-1.17
name: test-go-1.18
gotestsum-format: testname
executor:
name: go/golang
tag: 1.17-alpine
tag: 1.18-alpine

- go/test:
name: test-go-1.18
name: test-go-1.19
gotestsum-format: testname
executor:
name: go/golang
tag: 1.18-alpine
tag: 1.19-alpine

- go/test:
name: test-go-1.19
name: test-go-1.20
gotestsum-format: testname
executor:
name: go/golang
tag: 1.19-alpine
tag: 1.20-alpine

- go/test:
name: test-windows
Expand Down Expand Up @@ -92,7 +85,7 @@ jobs:
default: false
executor:
name: go/golang
tag: 1.19-alpine
tag: 1.20-alpine
steps:
- go/install: {package: git}
- go/install-ssh
Expand All @@ -117,7 +110,9 @@ jobs:
destination: dist

run:
executor: go/golang
executor:
name: go/golang
tag: 1.20-alpine
steps:
- go/install: {package: git}
- go/install-ssh
Expand All @@ -131,7 +126,7 @@ jobs:
lint:
executor:
name: go/golang
tag: 1.19-alpine
tag: 1.20-alpine
steps:
- checkout
- run: go mod download
Expand All @@ -141,7 +136,7 @@ jobs:
mkdir -p /go/bin
download=https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh
wget -O- -q "$download" | sh -s -- -b /go/bin/ v1.48.0
wget -O- -q "$download" | sh -s -- -b /go/bin/ v1.51.1
- run:
name: Lint
command: |
Expand Down
2 changes: 2 additions & 0 deletions .project/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ issues:
exclude-rules:
- linters: [revive]
text: 'should have comment .*or be unexported'
- linters: [revive]
text: 'package-comments: should have a package comment'
- linters: [stylecheck]
text: 'ST1000: at least one file in a package should have a package comment'
- linters: [errcheck]
Expand Down
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 031d3c8

Please sign in to comment.