Skip to content
Snippets Groups Projects
Commit 8e9d37a3 authored by Shrey Garg's avatar Shrey Garg Committed by Fabian Seidl
Browse files

Resolve "Adding support and visualization for the test coverage"

See merge request !335
parent a305223d
Branches
Tags
2 merge requests!335Resolve "Adding support and visualization for the test coverage",!333WIP: Develop
Pipeline #105011 passed
...@@ -11,6 +11,9 @@ ...@@ -11,6 +11,9 @@
when: always when: always
reports: reports:
junit: report.xml junit: report.xml
coverage_report:
coverage_format: cobertura
path: ./controller/coverage.xml
needs: needs:
- build-testing-image - build-testing-image
...@@ -21,6 +24,7 @@ unit-test: ...@@ -21,6 +24,7 @@ unit-test:
after_script: after_script:
- cd controller - cd controller
- go tool cover -func=coverage.out - go tool cover -func=coverage.out
- gocover-cobertura < coverage.out > coverage.xml
<<: *test <<: *test
controller-test: controller-test:
......
...@@ -20,6 +20,7 @@ install-tools: ...@@ -20,6 +20,7 @@ install-tools:
ci-install-tools: ci-install-tools:
go install gotest.tools/gotestsum@v1.7.0 go install gotest.tools/gotestsum@v1.7.0
go install github.com/boumenot/gocover-cobertura@v1.2.0
build: build:
$(GOBUILD) -o $(BINARY_NAME) ./cmd/gosdn $(GOBUILD) -o $(BINARY_NAME) ./cmd/gosdn
...@@ -41,7 +42,7 @@ controller-test: install-tools ...@@ -41,7 +42,7 @@ controller-test: install-tools
ENVIRONMENT=testing ./$(TOOLS_DIR)/gotestsum --junitfile report.xml --format testname -- -race -v -run TestRun ENVIRONMENT=testing ./$(TOOLS_DIR)/gotestsum --junitfile report.xml --format testname -- -race -v -run TestRun
ci-unit-test: ci-install-tools ci-unit-test: ci-install-tools
ENVIRONMENT=testing gotestsum --junitfile report.xml --format testname -- -short -race $$( go list ./... | grep -v /forks/ | grep -v /mocks ) -v -coverprofile=coverage.out -timeout 30m ENVIRONMENT=testing gotestsum --junitfile report.xml --format testname -- -short -race $$( go list ./... | grep -v /forks/ | grep -v /mocks ) -v -coverprofile=coverage.out -covermode atomic -timeout 30m
ci-controller-test: ci-install-tools ci-controller-test: ci-install-tools
ENVIRONMENT=testing gotestsum --junitfile report.xml --format testname -- -race -v -run TestRun -coverprofile=coverage.out ENVIRONMENT=testing gotestsum --junitfile report.xml --format testname -- -race -v -run TestRun -coverprofile=coverage.out
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment