From a844c4624f4df77661745b6f1e1e61c367316676 Mon Sep 17 00:00:00 2001 From: tesla59 Date: Tue, 21 May 2024 03:03:23 +0530 Subject: [PATCH] fix: coverage report generation for k8s_env tests Signed-off-by: tesla59 --- .github/workflows/ci-test-ginkgo.yml | 8 +++----- tests/k8s_env/Makefile | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-test-ginkgo.yml b/.github/workflows/ci-test-ginkgo.yml index 48a5ac1b3b..4aa2c82938 100644 --- a/.github/workflows/ci-test-ginkgo.yml +++ b/.github/workflows/ci-test-ginkgo.yml @@ -117,14 +117,12 @@ jobs: - name: Measure code coverage if: ${{ always() }} run: | - go install github.com/modocache/gover@latest - gover - go tool cover -func=gover.coverprofile - working-directory: KubeArmor + go tool cover -func=coverprofile.out + working-directory: ./tests/k8s_env env: GOPATH: /home/runner/go - uses: codecov/codecov-action@v3 if: ${{ always() }} with: - files: ./KubeArmor/gover.coverprofile + files: ./tests/k8s_env/coverprofile.out diff --git a/tests/k8s_env/Makefile b/tests/k8s_env/Makefile index ef96bc28e4..03c8c6e89e 100644 --- a/tests/k8s_env/Makefile +++ b/tests/k8s_env/Makefile @@ -6,8 +6,8 @@ build: @go mod tidy # run in two steps as syscall suite fails if run at the very end # see - https://github.com/kubearmor/KubeArmor/issues/1269 - @ginkgo --vv --flake-attempts=10 --timeout=10m syscalls/ - @ginkgo -r --vv --flake-attempts=10 --timeout=30m --skip-package "syscalls" + @ginkgo --vv --flake-attempts=10 --timeout=10m --coverpkg=github.com/kubearmor/KubeArmor/tests/... syscalls/ + @ginkgo -r --vv --flake-attempts=10 --timeout=30m --coverpkg=github.com/kubearmor/KubeArmor/tests/... --skip-package "syscalls" .PHONY: test test: @ginkgo -r -v \ No newline at end of file