diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index afb0d820..204f5a9e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -104,7 +104,7 @@ jobs: - name: Test run: | - make test COVERAGEDIR=${{ env.DESTDIR }} + make test COVERAGEDIR=${{ env.DESTDIR }} TEST_TAGS=skip_secretservice_tests shell: bash - name: Upload coverage diff --git a/Dockerfile b/Dockerfile index 12ac212b..37eee6ec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -87,7 +87,7 @@ RUN --mount=type=bind,target=. \ mkdir /out xx-go --wrap - make test COVERAGEDIR=/out + make test COVERAGEDIR=/out TEST_TAGS=skip_secretservice_tests EOT FROM scratch AS test-coverage diff --git a/Makefile b/Makefile index 9868445d..c622245d 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ GO_LDFLAGS = -s -w -X ${GO_PKG}/credentials.Version=${VERSION} -X ${GO_PKG}/cred BUILDX_CMD ?= docker buildx DESTDIR ?= ./bin/build COVERAGEDIR ?= ./bin/coverage +TEST_TAGS ?= # 10.11 is the minimum supported version for osxkeychain export MACOSX_DEPLOYMENT_TARGET = 10.11 @@ -44,7 +45,7 @@ release: # create release .PHONY: test test: mkdir -p $(COVERAGEDIR) - go test -short -v -coverprofile=$(COVERAGEDIR)/coverage.txt -covermode=atomic ./... + go test -tags $(TEST_TAGS) -short -v -coverprofile=$(COVERAGEDIR)/coverage.txt -covermode=atomic ./... go tool cover -func=$(COVERAGEDIR)/coverage.txt .PHONY: lint diff --git a/secretservice/secretservice_test.go b/secretservice/secretservice_test.go index 74aa03ad..df8905ab 100644 --- a/secretservice/secretservice_test.go +++ b/secretservice/secretservice_test.go @@ -1,4 +1,4 @@ -//go:build linux && cgo +//go:build linux && cgo && !skip_secretservice_tests package secretservice