Skip to content

[build] Enforce module-level code coverage verfication#157

Merged
adamxchen merged 12 commits intolinkedin:mainfrom
adamxchen:githubci
Jan 10, 2023
Merged

[build] Enforce module-level code coverage verfication#157
adamxchen merged 12 commits intolinkedin:mainfrom
adamxchen:githubci

Conversation

@adamxchen
Copy link
Copy Markdown
Contributor

@adamxchen adamxchen commented Jan 5, 2023

Motivation

We want to ensure enough unit tests will be written for each new PR and gradually improve code coverage among modules.
Start with a new CI step which verifies each module has met enough line coverages. The threshold is defined per module and we can continue tweaking it as we go.

Note that this PR doesn't introduce new code coverage check, only module-level code coverage check. The former will be done in a later PR.

Testing

./gradlew jacocoTestCoverageVerification and the new CI step.

WcTest/7390

For a build that meets the coverage requirements:
https://github.com/linkedin/venice/actions/runs/3852662122/jobs/6564983018

/// no error output

For a build that doesn't meet the coverage requirements:
https://github.com/linkedin/venice/actions/runs/3852887609/jobs/6565384906

Rule violated for bundle da-vinci-client: lines covered ratio is 0.4, but expected minimum is 0.8

@adamxchen adamxchen changed the title [NOT READY FOR REVIEW, STILL TESTING] [build] Enforce module-level code coverage verfication [build] Enforce module-level code coverage verfication Jan 6, 2023
Comment thread clients/da-vinci-client/build.gradle Outdated
# Conflicts:
#	internal/venice-test-common/build.gradle
Copy link
Copy Markdown
Contributor

@huangminchn huangminchn left a comment

Choose a reason for hiding this comment

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

Thanks Adam!

Comment thread .github/workflows/gh-ci.yml
@adamxchen adamxchen requested a review from anaberezhnov January 9, 2023 19:52
Comment thread build.gradle
Comment thread build.gradle Outdated
Comment thread build.gradle
@anaberezhnov
Copy link
Copy Markdown
Contributor

Are you planning to skip generated and test classes from the check?

@adamxchen
Copy link
Copy Markdown
Contributor Author

adamxchen commented Jan 10, 2023

Are you planning to skip generated and test classes from the check?

For the record, I think this commit lists these classes.
Jacoco reports currently includes them but they have relatively low percentage compared to our own codes. That being said, I will try to exclude them at later time.

@adamxchen adamxchen merged commit a0114c2 into linkedin:main Jan 10, 2023
@adamxchen adamxchen deleted the githubci branch January 10, 2023 23:36
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.

4 participants