Skip to content

Commit

Permalink
Added code coverage report generation and upload to codecov (#317)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dharmjit Singh authored Jan 18, 2022
1 parent 952add0 commit 0fefe0b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@ jobs:
go-version: 1.16

- name: Install ginkgo
run: sudo apt-get install golang-ginkgo-dev
run: go get github.com/onsi/ginkgo/[email protected]

- name: Run test make target
run: make test

- name: Upload test coverage
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: cover.out
verbose: true
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ all: build
HOST_AGENT_DIR ?= agent

# Run tests
test: generate fmt vet manifests controller-test agent-test webhook-test
test: generate fmt vet manifests test-coverage webhook-test

test-coverage:
source ./scripts/fetch_ext_bins.sh; fetch_tools; setup_envs; ginkgo --randomizeAllSpecs -r --cover --coverprofile=cover.out --outputdir=. --skipPackage=test,apis .

agent-test:
source ./scripts/fetch_ext_bins.sh; fetch_tools; setup_envs; ginkgo --randomizeAllSpecs -r $(HOST_AGENT_DIR) -coverprofile cover.out
Expand Down

0 comments on commit 0fefe0b

Please sign in to comment.