Skip to content

Commit

Permalink
Run tests on Go 1.21 (#408)
Browse files Browse the repository at this point in the history
* Run tests on Go 1.21

For the most part, there are no breaking changes.

However, the expired certificate is now showing "expired certificate"
although previously it showed a simpler "bad certificate" which was
hard-coded into the TLS settings test scenario.

* Simplify condition for certificate error

Instead of two `expired certificate` and `bad certificate` comparisons, we can just check for `certificate` in error output. This satisfies us when checking there is something wrong with the certificate.

Co-authored-by: Scott Blum <dragonsinth@gmail.com>

---------

Co-authored-by: Scott Blum <dragonsinth@gmail.com>
  • Loading branch information
sigv and dragonsinth committed Aug 31, 2023
1 parent b7a5d3b commit 743e60a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,16 @@ jobs:
- image: cimg/go:1.20
steps: *simple_job_steps

build-1-21:
working_directory: ~/repo
docker:
- image: cimg/go:1.21
steps: *simple_job_steps

workflows:
pr-build-test:
jobs:
- build-1-18
- build-1-19
- build-1-20
- build-1-21
2 changes: 1 addition & 1 deletion tls_settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ func TestBrokenTLS_ClientHasExpiredCert(t *testing.T) {
e.Close()
t.Fatal("expecting TLS failure setting up server and client")
}
if !strings.Contains(err.Error(), "bad certificate") {
if !strings.Contains(err.Error(), "certificate") {
t.Fatalf("expecting TLS certificate error, got: %v", err)
}
}
Expand Down

0 comments on commit 743e60a

Please sign in to comment.