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
Integrate with coveralls for code coverage #548
Conversation
|
Changes Unknown when pulling d5a4d43 on coveralls into ** on master**. |
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.
The only thing I think needs to be cleaned up are the duplicate lines in the Makefile. I would like if there were a way for you to push the coverage files into a directory that we could simply gitignore for git and rm -rf ${coverage_dir} on cleanup.
Makefile
Outdated
| @$(foreach pkg,$(PACKAGES),\ | ||
| go test -coverprofile=coverage.out -covermode=count $(pkg);\ | ||
| tail -n +2 coverage.out >> coverage-all.out;) | ||
| @go tool cover -html=coverage-all.out # -o coverage.html |
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.
So if you are excluding -o coverage.html where is the file that I would open in my browser to see it ?
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.
running go tool cover -html=coverage-all.out will actually open the browser window for you. With the -o it will simply write it to the file. I'll remove the reference to the coverage.html
Makefile
Outdated
|
|
||
| ci-test-coverage: ## CI test coverage, upload to coveralls | ||
| @echo "mode: count" > coverage-all.out | ||
| @$(foreach pkg,$(PACKAGES),\ |
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 is a duplicate from test-coverage-html, is there a way for you to not repeat yourself?
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 will look at deduping
.gitignore
Outdated
| handler.out | ||
| registries.out | ||
| validation.out | ||
| coverage.html |
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 don't get the impression that you need this anymore
|
Changes Unknown when pulling 5df6494 on coveralls into ** on master**. |
|
@djzager I have deduped the coverage generation for you. I also removed references to coverage.html since I no longer use it. |
|
Changes Unknown when pulling 9daaca8 on coveralls into ** on master**. |
Now the Makefile will monitor coverage-all.out. If the sources get changed, it will rebuild coverage-all.out assuming you updated code. Then when you run test-coverage-html or ci-test-coverage, these tasks will look to see if coverage-all.out is out of date, it not just show the coverage.
|
Changes Unknown when pulling a209070 on coveralls into ** on master**. |
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
Describe what this PR does and why we need it:
Changes proposed in this pull request
make ci-test-coverageDoes this PR depend on another PR (Use this to track when PRs should be merged)
none
Which issue this PR fixes (This will close that issue when PR gets merged)
none