From 743e60a4c969b007e6f7e75c61d82a70c899d359 Mon Sep 17 00:00:00 2001 From: Valters Jansons Date: Thu, 31 Aug 2023 19:14:34 +0300 Subject: [PATCH] Run tests on Go 1.21 (#408) * 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 --------- Co-authored-by: Scott Blum --- .circleci/config.yml | 7 +++++++ tls_settings_test.go | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 70dd72d..28d10ab 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 diff --git a/tls_settings_test.go b/tls_settings_test.go index cef3adf..b12a251 100644 --- a/tls_settings_test.go +++ b/tls_settings_test.go @@ -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) } }