Add function for checking that code dirs have test#134
Conversation
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: greghaynes If they are not already assigned, you can assign the PR to them by writing The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There is a known issue where directories which contain code but no tests are skipped in coverage reports. We work around this by adding a stub_tests.go file in these directories.
565537a to
6ea5528
Compare
|
CLAs look good, thanks! |
|
cc @steuhs |
| # stub_tests.go with no tests to these directories. | ||
| function check_subdirs_without_tests() { | ||
| ret=0 | ||
| for dir in $(find pkg -type d); do |
There was a problem hiding this comment.
I assume you intended to replace pkg by $1 here?
| # reports resulting in inaccurately high coverage results. Fix by adding a | ||
| # stub_tests.go with no tests to these directories. | ||
| function check_subdirs_without_tests() { | ||
| ret=0 |
|
/test pull-knative-test-infra-build-tests |
|
@steuhs is solving the same problem with same solution AFAIK. |
|
For the code coverage tool, I am planning on add _test.go to all .go file on the repo checked out locally. Once that is done, it will not only solve the issue mentioned here, but also cover all .go files. For now, this solution is a doable approach, but it will become redundant after the code coverage feature is updated accordingly. |
|
@steuhs can we close this PR now that your solution is implemented? |
|
@adrcunha yes, we can close this |
There is a known issue where directories which contain code but no tests
are skipped in coverage reports. We work around this by adding a
stub_tests.go file in these directories.