From 72f912359230a5f0d7769e9f2f36bbbf6e218d53 Mon Sep 17 00:00:00 2001 From: Mykhailo Roit <88772563+Mykhailo-Roit@users.noreply.github.com> Date: Fri, 3 Apr 2026 23:01:07 +0300 Subject: [PATCH] Add test-in-docker target to Makefile (#659) * Add test-in-docker target to Makefile Add a target to run tests in Docker for non-Linux environments. * Add GOVERSION variable to Makefile * fix: update test-in-docker command to use user permissions * Fix docker command syntax in Makefile --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2bf202b..3989d45 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,8 @@ # Go parameters GOCMD=go +GOVERSION=1.25 MODULENAME=github.com/h44z/wg-portal -GOFILES:=$(shell go list ./... | grep -v /vendor/) +GOFILES=$(shell go list ./... | grep -v /vendor/) BUILDDIR=dist BINARIES=$(subst cmd/,,$(wildcard cmd/*)) IMAGE=h44z/wg-portal @@ -51,6 +52,11 @@ format: .PHONY: test test: test-vet test-race +#> test-in-docker: Run tests in Docker (for non-Linux environments e.g. MacOS) +.PHONY: test-in-docker +test-in-docker: + docker run --rm -u $(shell id -u):$(shell id -g) -e HOME=/tmp -v $(PWD):/app -w /app golang:$(GOVERSION) make test + #< test-vet: Static code analysis .PHONY: test-vet test-vet: build-dependencies