From 8a54f1631c54b917d8176158d07179e912f460d9 Mon Sep 17 00:00:00 2001 From: Shreyas Kirtane <122562364+skirtan1@users.noreply.github.com> Date: Sat, 25 Jan 2025 08:19:20 -0700 Subject: [PATCH] Add coverage calculation and badge (#127) ## Which problem is this PR solving? Enhancements for [#6572](https://github.com/jaegertracing/jaeger/issues/6572) ## Description of the changes - Use retry upload action from main branch - Delete lines for model.pb.go from coverage - add badge to readme ## How was this change tested? - ## Checklist - [X] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [X] I have signed all commits - [ ] I have added unit tests for the new functionality - [ ] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `npm run lint` and `npm run test` --------- Signed-off-by: Shreyas Kirtane Signed-off-by: Yuri Shkuro Signed-off-by: Yuri Shkuro Co-authored-by: Yuri Shkuro Co-authored-by: Yuri Shkuro --- .codecov.yml | 22 ++++++++++++++++++++++ .gitignore | 1 + Makefile | 1 + README.md | 3 +++ 4 files changed, 27 insertions(+) create mode 100644 .codecov.yml diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 0000000..a69cfa2 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,22 @@ +codecov: + notify: + require_ci_to_pass: yes + strict_yaml_branch: main # only use the latest copy on the main branch + +ignore: + - "model/v1/model.pb.go" + - "proto-gen/*/*" + +coverage: + precision: 2 + round: down + range: "85...100" + status: + project: + default: + enabled: yes + target: 85% + patch: + default: + enabled: yes + target: 90% diff --git a/.gitignore b/.gitignore index 6eae0f3..396dc68 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .idea/ gen-*/ .proto-gen-polyglot/ +coverage.txt diff --git a/Makefile b/Makefile index dffdf5c..82f2a48 100644 --- a/Makefile +++ b/Makefile @@ -40,6 +40,7 @@ swagger-validate: clean: rm -rf *gen-* || true rm -rf .*gen-* || true + rm -rf coverage.txt .PHONY: thrift thrift: thrift-image clean $(THRIFT_FILES) diff --git a/README.md b/README.md index 449cfb6..396ea84 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # jaeger-idl [![Build Status][ci-img]][ci] +[![Coverage Status][cov-img]][cov] A set of shared Thrift and Protobuf data model definitions used by the Jaeger components. @@ -35,3 +36,5 @@ See [CONTRIBUTING](./CONTRIBUTING.md). [ci-img]: https://github.com/jaegertracing/jaeger-idl/actions/workflows/ci-unit-tests.yml/badge.svg [ci]: https://github.com/jaegertracing/jaeger-idl/actions/workflows/ci-unit-tests.yml +[cov-img]: https://codecov.io/gh/jaegertracing/jaeger-idl/branch/main/graph/badge.svg +[cov]: https://codecov.io/gh/jaegertracing/jaeger-idl/branch/main/