Skip to content
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

create a makefile target for running tests with code coverage and visualize them #40

Closed
MalloZup opened this issue Oct 14, 2019 · 3 comments · Fixed by #43
Closed

create a makefile target for running tests with code coverage and visualize them #40

MalloZup opened this issue Oct 14, 2019 · 3 comments · Fixed by #43
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest help wanted Extra attention is needed

Comments

@MalloZup
Copy link
Contributor

MalloZup commented Oct 14, 2019

the golang language has the feature to create and display code coverage of unit- tests

Task:

  • research about this interesting feature

  • create a makefile target like make coverage this will execute tests with code coverage
    By default we don't need it , so we will have make coverage and make test will run without coverage. The make coverage will run go test with some flags

  • this task should create an html golang report and then open a fenster in web-browser to visualize it.

rationale:

We don't want to enable codecoverage or similar in travis or CI because codecovarage can be a really wrong metric for running in PRs or automation.

We just want to use code coverage from time to time to see what we could perhaps cover but there should be a human analyzing it.

As use-case could be:

As dev I run make coverage and this will open automatically the browser fenster to the code-coverage of golang in html

Then I can analyze from time to time what perhaps isn't covered by tests. ( we can't cover everything by tests since we don't have binary).

The code-coverage thing should be manual human process .

@MalloZup MalloZup added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers hacktoberfest labels Oct 14, 2019
@mbiagetti
Copy link
Contributor

Hi! I've proposed a solution

@diegoakechi
Copy link
Member

@mbiagetti Thanks for your collaboration!

@MalloZup I am not against on having code coverage included and enforced on the CI, not as a punishment tool, but as a tool to help us to grow the codebase without introducing regressions that often. Not saying that unit tests will cover everything or so, but many times the fact that you need to write tests makes you double check some parts and even refactor to a better code before even submitting a PR. My vote would be to have it checked on each PR and as much as possible have it covered. On special cases, we can overwrite the check if need.

@MalloZup
Copy link
Contributor Author

@diegoakechi ok we can have it as long it doesn't write comments to PR or block them i'm fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants