diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c8190bdd..502ebab5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,7 @@ jobs: go-version-file: go.mod - name: Run tests - run: go test -v -race -coverprofile=coverage.txt ./... + run: go test -v -tags integration -race -coverprofile=coverage.txt ./... - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v4 diff --git a/README.md b/README.md index 80b47591..72fb32ce 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ To run the integrations tests, make sure you installed the following tools: 1. Run the following command to run the integrations tests: ```sh -go test -v ./test/integration +go test -v -tags integration ./test/integration ``` ### Run the kubernetes e2e tests diff --git a/test/integration/cryptsetup_test.go b/test/integration/cryptsetup_test.go index 56c5353b..d0814ad0 100644 --- a/test/integration/cryptsetup_test.go +++ b/test/integration/cryptsetup_test.go @@ -1,3 +1,5 @@ +//go:build integration + package integration import ( diff --git a/test/integration/docker.go b/test/integration/docker.go index a2979f29..cb876c92 100644 --- a/test/integration/docker.go +++ b/test/integration/docker.go @@ -1,3 +1,5 @@ +//go:build integration + package integration import ( diff --git a/test/integration/integration_test.go b/test/integration/integration_test.go index ddcbba70..67775cc3 100644 --- a/test/integration/integration_test.go +++ b/test/integration/integration_test.go @@ -1,3 +1,5 @@ +//go:build integration + package integration import ( @@ -29,7 +31,7 @@ func prepareDockerImage() error { defer os.Unsetenv("GOARCH") os.Setenv("CGO_ENABLED", "0") defer os.Unsetenv("CGO_ENABLED") - if output, err := runCmd("go", "test", "-c", "-o", "integration.tests"); err != nil { + if output, err := runCmd("go", "test", "-tags", "integration", "-c", "-o", "integration.tests"); err != nil { return fmt.Errorf("error compiling test binary: %w\n%s", err, output) } diff --git a/test/integration/volumes_test.go b/test/integration/volumes_test.go index 8d9a3d63..3288877c 100644 --- a/test/integration/volumes_test.go +++ b/test/integration/volumes_test.go @@ -1,3 +1,5 @@ +//go:build integration + package integration import (