-
Notifications
You must be signed in to change notification settings - Fork 6.7k
[MXNET-851] Test coverage metrics for R-package #12391
Conversation
|
Thank you! Could you elaborate how and when this script is getting executed? I guess we have to modify our test pipeline and add it there |
|
Thanks. Did you enable the proper error propagation? |
|
@marcoabreu the error propagation issue is due to a bug in the test framework that we are using, |
|
Great, thank you. Do you want to fix that in a separate PR? |
ca993e1 to
84fdfa8
Compare
|
yes, I will make that another PR. |
R-package/ci-test-coverage.sh
Outdated
|
|
||
| MXNET_HOME=${PWD} | ||
| cd ${MXNET_HOME}/R-package | ||
| Rscript -e 'covr::codecov()' |
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 think this script is obsolete now
828e35b to
37578be
Compare
|
@marcoabreu The CI run generates the report but it is not able to upload the reports to codecov due to the following error - |
|
Do you see the publish_test_coverage call in our Jenkinsfile? It's important that this call submits the report to codecov. Here, it seems like the package is trying to upload the report itself. Is it possible to just output the test coverage report into the workdir? Codecov will then automatically pick it up |
|
@marcoabreu this run - http://jenkins.mxnet-ci.amazon-ml.com/blue/organizations/jenkins/incubator-mxnet/detail/PR-12391/6/pipeline/133 just outputs the coverage report to the console, but codecov is unable to retrieve/parse the results. |
|
Have a look at the source here: https://github.com/r-lib/covr/blob/master/R/codecov.R They automatically try to upload to codecov. We don't want that. Instead, we want this output to be redirected to a file. Our method then automatically picks that file up and uploads it properly. Basically what I would recommend is to take that function and replicate it to redirect the output to a file. Can you try that? The reason we don't want this implicit upload is because of high availability. We took some measures because codecov is not really reliable in terms of availability of their default endpoints. |
f3b2a06 to
6985af6
Compare
6985af6 to
3e6bae8
Compare
|
@marcoabreu please review. |
|
Thanks a lot! It seems like the files are not showing up as covered here though :( |
|
but as you suggested, i am writing it to a json file in the local directory. |
|
Can you upload the content of that file on pastebin or gist? I'd love to have a closer look to investigate |
Makefile
Outdated
| rpkgtest: | ||
| Rscript -e "require(testthat);res<-test_dir('R-package/tests/testthat');if(!testthat:::all_passed(res)){stop('Test failures', call. = FALSE)}" | ||
| Rscript -e 'require(testthat);res<-test_dir("R-package/tests/testthat");if(!testthat:::all_passed(res)){stop("Test failures", call. = FALSE)}' | ||
| Rscript -e 'res<-covr:::package_coverage("R-package");fileConn<-file("r-package_coverage.json");writeLines(RJSONIO:::toJSON(res), fileConn);close(fileConn)' |
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 think this functions output does not really match the format codecov expects. Have a look at this line:
3e6bae8 to
c9935b1
Compare
marcoabreu
left a comment
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.
|
Thanks a lot! It seems like codecov is having trouble associating the proper commit hash of a PR with the report, but that's a separate problem. This PR has successfully added test coverage for R, great job! |
|
@marcoabreu Thanks! Though the current coverage report is not completely accurate, it shows 0% coverage for certain files which have unit tests for them. Will check why |
* get test coverage metrics for r-package * update makefile to include test coverage, and fix test failures * write to json file
Description
Track test coverage metrics for R-package using
covrpackage.Checklist
Essentials
Please feel free to remove inapplicable items for your PR.
Comments