-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[HUDI-627] Aggregate code coverage and publish to codecov.io during CI #1347
Conversation
we have a code coverage report already in codecov.io through this PR |
scripts/upload_code_coverage.sh
Outdated
|
||
mode=$1 | ||
|
||
if [ "$mode" = "unit" ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Integration tests do not generate jacoco report (as yet). This is not detected by codecov as an error. So it may be simple to just add "bash <(curl -s https://codecov.io/bash)" directly to the travis.yml. Future changes to integration test wont require any changes here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
made changes as u have suggested.
@@ -278,8 +276,6 @@ | |||
<goal>report</goal> | |||
</goals> | |||
<configuration> | |||
<!-- Sets the path to the file which contains the execution data. --> | |||
<dataFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</dataFile> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per the following link, you can have JaCoCo append coverage of all modules in the same file in the parent module target folder. We can change the dataFile to "${project.basedir}/../target/coverage-reports/jacoco-ut.exec".
Might also have to change the prepare-agent destFile.
https://community.sonarsource.com/t/unit-tests-across-multi-module-projects/9662/3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- This seems to be specific to how sonarqube works and we don't use sonar/sonarqube for aggregation
- This is the recommendation from official jacoco documentation, which I have followed in this PR.
I did try out the sonar documentation on a test project locally and couldn't make it to work.
dd800ae
to
f3c3492
Compare
Codecov Report
@@ Coverage Diff @@
## master #1347 +/- ##
========================================
Coverage ? 0.64%
Complexity ? 2
========================================
Files ? 287
Lines ? 14310
Branches ? 1463
========================================
Hits ? 92
Misses ? 14215
Partials ? 3
Continue to review full report at Codecov.
|
pom.xml
Outdated
@@ -51,6 +51,7 @@ | |||
<module>packaging/hudi-timeline-server-bundle</module> | |||
<module>docker/hoodie/hadoop</module> | |||
<module>hudi-integ-test</module> | |||
<module>hudi-test-coverage-aggregator</module> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a way to do this without adding this module?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for now we cannot do without adding a new module in jacoco. there is a PR out in jacoco OSS to avoid this. But it is not getting much traction. i am closely following it. will remove this module once that PR gets merged to a release. for now this is just a wrapper module that does not get deployed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really dislike the additional module. can you reuse one of the bundle modules instead? or hudi-integ-test
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ramachandranms who owns the codecov account
@vinothchandar codecov lets us just upload reports without ownership. here is a screenshot of the admin page. it says that anyone with github permissions will be able to modify the codecov settings for that repo. |
@ramachandranms guess that coz its free for OSS? I am good with that part |
@ramachandranms could you rebase again and push.. for some reason, its showing 72 files being changed |
@vinothchandar will do. also the recent change was not showing coverage for |
3342369
to
cd1477e
Compare
@vinothchandar cleaned up the PR and everything looks good in my own fork build + codecov. please let me know if there are any other concerns. thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What is the purpose of the pull request
Brief change log
Verify this pull request
Committer checklist
Has a corresponding JIRA in PR title & commit
Commit message is descriptive of the change
CI is green
Necessary doc changes done or have another open PR
For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.