Skip to content

Commit 4ced1f8

Browse files
committed
test: fixup for Windows
1 parent c342f72 commit 4ced1f8

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

.github/workflows/go.yml

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

26+
- name: Switch Docker daemon mode to Linux
27+
if: runner.os == 'Windows'
28+
# Tips from https://stackoverflow.com/a/57081502
29+
# Install-Module -Name DockerMsftProvider -Force
30+
# Install-Package -Name docker -ProviderName DockerMsftProvider -Force
31+
#
32+
# FRom https://learn.microsoft.com/en-us/virtualization/windowscontainers/quick-start/set-up-environment?tabs=dockerce#windows-server-1
33+
# Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/Windows-Containers/Main/helpful_tools/Install-DockerCE/install-docker-ce.ps1" -o install-docker-ce.ps1
34+
# .\install-docker-ce.ps1
35+
run: |
36+
choco install docker-cli
37+
38+
where docker.exe
39+
where DockerCli.exe
40+
41+
docker -help
42+
DockerCli -help
43+
44+
C:\"Program Files"\Docker\Docker\DockerCli.exe -SwitchDaemon
45+
2646
- name: Setup
2747
run: make setup
2848

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)