From a056c33b9865fef36d283687bcd7ad28751d4513 Mon Sep 17 00:00:00 2001 From: Kazuyoshi Kato Date: Thu, 14 Oct 2021 11:10:37 -0700 Subject: [PATCH 1/2] Fix GitHub Actions on Windows Signed-off-by: Kazuyoshi Kato --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3db99dfd..b31e2611 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -25,4 +25,4 @@ jobs: gotestsum_version: 1.7.0 - name: Test - run: gotestsum --format short-verbose -- -race -timeout=20m -coverprofile=coverage.txt -covermode=atomic ./... + run: gotestsum --format short-verbose -- -race -timeout=20m -coverprofile=coverage_txt -covermode=atomic ./... From 1309bcdb648d6a8b688c0a733857edd9f47cb784 Mon Sep 17 00:00:00 2001 From: Kazuyoshi Kato Date: Thu, 14 Oct 2021 11:23:17 -0700 Subject: [PATCH 2/2] Fix TestRuntime_TLSAuthConfigWithLoadedCAPoolAndLoadedCA on Windows Signed-off-by: Kazuyoshi Kato --- client/runtime_test.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/client/runtime_test.go b/client/runtime_test.go index 498459e6..b650bd31 100644 --- a/client/runtime_test.go +++ b/client/runtime_test.go @@ -32,11 +32,12 @@ import ( "crypto/x509" "encoding/pem" + "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/go-openapi/runtime" + goruntime "runtime" ) // task This describes a task. Tasks require a content property to be set. @@ -188,8 +189,14 @@ func TestRuntime_TLSAuthConfigWithLoadedCAPoolAndLoadedCA(t *testing.T) { cert, err := x509.ParseCertificate(block.Bytes) require.NoError(t, err) - pool, err := x509.SystemCertPool() - require.NoError(t, err) + var pool *x509.CertPool + if goruntime.GOOS == "windows" { + // Windows doesn't have the system cert pool. + pool = x509.NewCertPool() + } else { + pool, err = x509.SystemCertPool() + require.NoError(t, err) + } startingCertCount := len(pool.Subjects()) var opts TLSClientOptions