Skip to content

Commit

Permalink
Merge pull request #220 from kzys/fix-windows
Browse files Browse the repository at this point in the history
Fix GitHub Actions on Windows
  • Loading branch information
casualjim committed Oct 15, 2021
2 parents 5758e1a + 1309bcd commit a8a7229
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Expand Up @@ -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 ./...
13 changes: 10 additions & 3 deletions client/runtime_test.go
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a8a7229

Please sign in to comment.