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

Show coverage report in HTML format #2465

Merged
merged 1 commit into from
Mar 1, 2022
Merged

Show coverage report in HTML format #2465

merged 1 commit into from
Mar 1, 2022

Conversation

jjngx
Copy link
Contributor

@jjngx jjngx commented Mar 1, 2022

Proposed changes

Add a make target make cover-html for running tests with coverage and displaying reports in HTML format in local browser. When test execution is completed test coverage report is automatically opened in default web browser.

Example:

➜  kubernetes-ingress git:(local-coverage-check) make cover-html
go test -shuffle=on -race ./... -count=1 -cover -covermode=atomic -coverprofile=coverage.out
ok  	github.com/nginxinc/kubernetes-ingress/cmd/nginx-ingress	2.535s	coverage: 6.8% of statements
ok  	github.com/nginxinc/kubernetes-ingress/internal/configs	1.873s	coverage: 66.6% of statements
[...]
go tool cover -html coverage.out

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto master
  • I will ensure my PR is targeting the master branch and pulling from my branch from my own fork

@jjngx jjngx added the tests Pull requests that update tests label Mar 1, 2022
Copy link
Member

@ciarams87 ciarams87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼

@jjngx jjngx merged commit 9c4a516 into nginxinc:master Mar 1, 2022
@jjngx jjngx deleted the local-coverage-check branch March 1, 2022 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Pull requests that update tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants