Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix coverage report workflow step #91

Merged
merged 2 commits into from
Aug 30, 2024
Merged

Conversation

dimkouv
Copy link
Contributor

@dimkouv dimkouv commented Aug 30, 2024

So far the coverage report workflow step was not using make test for the target branch but a simple go test. Recently make test was updated leading to wrong coverage reports.

@dimkouv dimkouv requested a review from a team as a code owner August 30, 2024 07:57
@@ -35,16 +35,14 @@ jobs:
- name: Generate coverage report
if: github.event_name == 'pull_request'
run: |
go tool cover -func=coverage.out > coverage.txt
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noop

total=$(go tool cover -func=coverage.out | grep total | awk '{print $3}')
echo "coverage=$total" >> $GITHUB_ENV
- name: Coverage on target branch
if: github.event_name == 'pull_request'
run: |
git fetch origin ${{ github.base_ref }}
git checkout ${{ github.base_ref }}
go test -coverprofile=coverage_target.out ./...
go tool cover -func=coverage_target.out > coverage_target.txt
TEST_COUNT=1 COVERAGE_FILE=coverage_target.out make test
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use same test strategy as in branch test run

Copy link

Test Coverage

Branch Coverage
dk/fix-coverage-report 72.4%
ccip-develop 72.4%

@dimkouv dimkouv requested a review from asoliman92 August 30, 2024 08:49
@dimkouv dimkouv merged commit 0950bef into ccip-develop Aug 30, 2024
3 checks passed
@mateusz-sekara mateusz-sekara deleted the dk/fix-coverage-report branch August 30, 2024 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants