Skip to content

Commit 413484d

Browse files
committed
test: fixup for Windows
1 parent c342f72 commit 413484d

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

.github/workflows/go.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,22 @@ jobs:
2323
- name: Check out code into the Go module directory
2424
uses: actions/checkout@v2
2525

26+
- name: Install Docker Desktop
27+
if: runner.os == 'Windows'
28+
run: |
29+
choco install docker-desktop
30+
31+
- name: Switch to Linux Containers
32+
if: runner.os == 'Windows'
33+
# Tips from https://stackoverflow.com/a/57081502
34+
run: |
35+
C:\"Program Files"\Docker\Docker\DockerCli.exe -SwitchLinuxEngine
36+
37+
Stop-Service -Name Docker
38+
Start-Service -Name Docker
39+
40+
docker version
41+
2642
- name: Setup
2743
run: make setup
2844

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ all: check
2020
.PHONY: check
2121
check:
2222
ifeq ($(OS),Windows_NT)
23-
@echo "Skipping checks on Windows, currently unsupported."
23+
go test ./...
2424
else
2525
@wget -O lint-project.sh https://raw.githubusercontent.com/moov-io/infra/master/go/lint-project.sh
2626
@chmod +x ./lint-project.sh

mock_client_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"errors"
99
"io"
1010
"io/fs"
11+
"os"
1112
"strings"
1213
"testing"
1314

@@ -41,7 +42,9 @@ func TestMockClient(t *testing.T) {
4142
paths, err := client.ListFiles("/")
4243
require.NoError(t, err)
4344
require.Len(t, paths, 1)
44-
require.Equal(t, "/exists.txt", paths[0])
45+
46+
expected := string(os.PathSeparator) + "exists.txt"
47+
require.Equal(t, expected, paths[0])
4548
}
4649

4750
func TestMockClient_ListAndOpenFiles(t *testing.T) {

0 commit comments

Comments
 (0)