Skip to content

Conversation

@cletter7
Copy link
Contributor

Changes:

  • Add -coverpkg ./... option to the mage coverage command
  • Add -func report to the mage coverage command

With -coverpkg ./... the total coverage is different, and the -func report includes files with 0% coverage.

Below you can find the coverage diff screenshot from github-datasource.

On the left (without -coverpkg, total coverage 45.5%):

go test ./pkg/... -v -cover -coverprofile=coverage/backend.out && go tool cover -func=coverage/backend.out -o coverage/backend.txt

On the right (with -coverpkg, total coverage 39.9%):

go test ./pkg/... -coverpkg ./... -v -cover -coverprofile=coverage/backend.out && go tool cover -func=coverage/backend.out -o coverage/backend.txt

image

image

@cletter7 cletter7 requested a review from a team as a code owner February 21, 2023 14:03
@cletter7 cletter7 requested review from andresmgot and marefr and removed request for a team February 21, 2023 14:03
@CLAassistant
Copy link

CLAassistant commented Feb 21, 2023

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@andresmgot andresmgot left a comment

Choose a reason for hiding this comment

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

Tested and working as expected for me 👍

@cletter7 cletter7 merged commit 75af7a9 into main Feb 21, 2023
@cletter7 cletter7 deleted the feat/improve-mage-coverage branch February 21, 2023 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants