Skip to content

Commit

Permalink
Add codecov setting for test coverge check
Browse files Browse the repository at this point in the history
Signed-off-by: Wenqi Qiu <[email protected]>
  • Loading branch information
wenqiq committed Nov 22, 2022
1 parent 21f844c commit d90e024
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ jobs:
- name: Run integration tests
run: |
make docker-test-integration
- name: Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: cover.out
flags: unit-tests
name: codecov-unit-test

tidy:
runs-on: [ubuntu-latest]
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ test-integration:
@echo
@echo "==> Running integration tests <=="
@echo "SOME TESTS WILL FAIL IF NOT RUN AS ROOT!"
$(GO) test antrea.io/ofnet/ofctrl/...
$(GO) test antrea.io/ofnet/ofctrl/... -v -coverprofile cover.out

.PHONY: docker-test-integration
docker-test-integration:
Expand Down
35 changes: 35 additions & 0 deletions codecov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
codecov:
branch: main
require_ci_to_pass: no

comment:
layout: "reach,diff,flags,tree"
behavior: default
require_changes: no
require_base: no
require_head: no
after_n_builds: 1
show_carryforward_flags: true

github_checks:
annotations: true

coverage:
status:
patch:
default:
target: 70%
threshold: 5%
base: auto
only_pulls: false
project:
default:
target: auto
threshold: 0.3%

flag_management:
default_rules:
carryforward: true

ignore:
- "**/testing/*.go"

0 comments on commit d90e024

Please sign in to comment.