Skip to content

Commit

Permalink
test: fixup for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdecaf committed Feb 14, 2024
1 parent c342f72 commit c5673f5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Install Docker Desktop
if: runner.os == 'Windows'
run: |
choco install docker-desktop
- name: Switch to Linux Containers
if: runner.os == 'Windows'
# Tips from https://stackoverflow.com/a/57081502
run: |
C:\"Program Files"\Docker\Docker\DockerCli.exe -SwitchLinuxEngine
docker version
- name: Setup
run: make setup

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ all: check
.PHONY: check
check:
ifeq ($(OS),Windows_NT)
@echo "Skipping checks on Windows, currently unsupported."
go test ./...
else
@wget -O lint-project.sh https://raw.githubusercontent.com/moov-io/infra/master/go/lint-project.sh
@chmod +x ./lint-project.sh
Expand Down
5 changes: 4 additions & 1 deletion mock_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"errors"
"io"
"io/fs"
"os"
"strings"
"testing"

Expand Down Expand Up @@ -41,7 +42,9 @@ func TestMockClient(t *testing.T) {
paths, err := client.ListFiles("/")
require.NoError(t, err)
require.Len(t, paths, 1)
require.Equal(t, "/exists.txt", paths[0])

expected := string(os.PathSeparator) + "exists.txt"
require.Equal(t, expected, paths[0])
}

func TestMockClient_ListAndOpenFiles(t *testing.T) {
Expand Down

0 comments on commit c5673f5

Please sign in to comment.