diff --git a/.circleci/config.yml b/.circleci/config.yml index 3de2b6e099b9..e339d02a5e6d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -58,6 +58,10 @@ jobs: - run: name: Unit Tests command: make BUILD_IN_CONTAINER=false test + - run: + name: Upload Codecov + command: | + bash <(curl -s https://codecov.io/bash) # Promtail build/promtail-windows: diff --git a/.gitignore b/.gitignore index 740b3407676c..c8cb7d3ccc55 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ cmd/fluent-bit/out_loki.h dlv rootfs/ dist +coverage.txt diff --git a/Makefile b/Makefile index 52feb25505d7..efc57a7dc5b4 100644 --- a/Makefile +++ b/Makefile @@ -242,7 +242,7 @@ lint: ######## test: all - GOGC=10 go test $(MOD_FLAG) -p=4 ./... + GOGC=10 go test -covermode=atomic -coverprofile=coverage.txt $(MOD_FLAG) -p=4 ./... ######### # Clean # diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 000000000000..3bc3fcff10d8 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,24 @@ +codecov: + require_ci_to_pass: yes + +coverage: + precision: 2 + round: down + range: "70...100" + +parsers: + gcov: + branch_detection: + conditional: yes + loop: yes + method: no + macro: no + +comment: + layout: "reach,diff,flags,tree" + behavior: default + require_changes: no + +ignore: + - "**/*.pb.go" + - "**/*.y.go"