diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 5748cd971c..2ed245b494 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -52,6 +52,8 @@ jobs: chmod +x ./dist/artifacts/k3s go test -coverpkg=./... -coverprofile=coverage.out ./pkg/... -run Integration go tool cover -func coverage.out + # these tests do not relate to coverage and must be run separately + go test ./tests/integration/... -run Integration - name: On Failure, Launch Debug Session if: ${{ failure() }} uses: mxschmitt/action-tmate@v3 diff --git a/tests/integration/dualstack/dualstack_int_test.go b/tests/integration/dualstack/dualstack_int_test.go index 0c26eef99b..b486d6c547 100644 --- a/tests/integration/dualstack/dualstack_int_test.go +++ b/tests/integration/dualstack/dualstack_int_test.go @@ -1,6 +1,7 @@ package integration import ( + "os" "strings" "testing" @@ -18,7 +19,7 @@ var dualStackServerArgs = []string{ "--disable-network-policy", } var _ = BeforeSuite(func() { - if !testutil.IsExistingServer() { + if !testutil.IsExistingServer() && os.Getenv("CI") != "" { var err error dualStackServer, err = testutil.K3sStartServer(dualStackServerArgs...) Expect(err).ToNot(HaveOccurred()) @@ -29,6 +30,8 @@ var _ = Describe("dual stack", func() { BeforeEach(func() { if testutil.IsExistingServer() && !testutil.ServerArgsPresent(dualStackServerArgs) { Skip("Test needs k3s server with: " + strings.Join(dualStackServerArgs, " ")) + } else if os.Getenv("CI") == "true" { + Skip("Github environment does not support IPv6") } }) When("a ipv4 and ipv6 cidr is present", func() { @@ -48,7 +51,7 @@ var _ = Describe("dual stack", func() { }) var _ = AfterSuite(func() { - if !testutil.IsExistingServer() { + if !testutil.IsExistingServer() && os.Getenv("CI") != "" { Expect(testutil.K3sKillServer(dualStackServer)).To(Succeed()) } }) diff --git a/tests/util/cmd.go b/tests/util/cmd.go index b3c36e46ca..a928c46163 100644 --- a/tests/util/cmd.go +++ b/tests/util/cmd.go @@ -172,7 +172,7 @@ func K3sKillServer(server *K3sServer) error { return err } if !flock.CheckLock(lockFile) { - return os.Remove(lockFile) + return os.RemoveAll(lockFile) } return nil }