From 2a23efb1c47b8b4d9074aaacc848de6c2c5bee7f Mon Sep 17 00:00:00 2001 From: Scott Osteen Date: Wed, 7 Aug 2024 21:40:17 -0500 Subject: [PATCH 1/2] setup docker container for running tests on windows --- windows_test_env/Dockerfile | 8 ++++++++ windows_test_env/docker-compose.yaml | 10 ++++++++++ 2 files changed, 18 insertions(+) create mode 100644 windows_test_env/Dockerfile create mode 100644 windows_test_env/docker-compose.yaml diff --git a/windows_test_env/Dockerfile b/windows_test_env/Dockerfile new file mode 100644 index 00000000..2bd8a636 --- /dev/null +++ b/windows_test_env/Dockerfile @@ -0,0 +1,8 @@ +# run docker-compose from root dir +FROM golang:latest + +WORKDIR /testspace + +COPY . ./ + +CMD make test; make test-race; diff --git a/windows_test_env/docker-compose.yaml b/windows_test_env/docker-compose.yaml new file mode 100644 index 00000000..ee2a43fe --- /dev/null +++ b/windows_test_env/docker-compose.yaml @@ -0,0 +1,10 @@ +# run from root dir +services: + test: + build: + context: .. + dockerfile: windows_test_env/Dockerfile + container_name: EchoVault_win_test_env + stdin_open: true + tty: true + From 5ea1da8f4e906390c63cdf80fd90d78b8ca7f5a4 Mon Sep 17 00:00:00 2001 From: Scott Osteen Date: Fri, 9 Aug 2024 21:19:03 -0500 Subject: [PATCH 2/2] added makefile command --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 54d16636..a1e2e262 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,9 @@ test-race: env RACE=true OUT=echovault/testdata make build-modules-test && \ CGO_ENABLED=1 go test ./... --race +test-win: + docker-compose -f windows_test_env/docker-compose.yaml up + cover: go tool cover -html=./coverage/coverage.out