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

Run code coverage on the entire knative/pkg repo #110

Merged
merged 3 commits into from Sep 24, 2018

Conversation

steuhs
Copy link
Contributor

@steuhs steuhs commented Sep 11, 2018

@adrcunha , as discussed with @mattmoor , we want to try running code coverage on ./

@knative-prow-robot knative-prow-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 11, 2018
@knative-prow-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: steuhs

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 11, 2018
@adrcunha
Copy link
Contributor

As discussed offline, try to validate this locally and then make final changes instead of using a complex trial-and-error approach.

@knative-prow-robot knative-prow-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 11, 2018
@steuhs steuhs changed the title added a code coverage job to test running coverage on entire ./ change a code coverage job to test running coverage on entire ./ Sep 11, 2018
@@ -1094,7 +1094,7 @@ presubmits:
- "--postsubmit-job-name=post-knative-pkg-go-coverage"
- "--artifacts=$(ARTIFACTS)"
- "--profile-name=coverage_profile.txt"
- "--cov-target=./apis/ ./configmap/"
- "--cov-target=."
Copy link
Contributor

Choose a reason for hiding this comment

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

a) Would that automatically exclude //vendor and //test?
b) Why not applying this pattern to all coverage jobs, since it makes sense?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. it automatically exclude vendor folder, but not test
  2. let's confirm with @jessiezcc and see if we want to apply this pattern to all repos.

Copy link
Contributor

Choose a reason for hiding this comment

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

can u apply gitattribute to a folder?

Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest that you be consistent with specifying excluded directories in the tool to avoid confusion and conflict, and thus not automatically exclude //vendor and leave that (and //test, in this case) for .gitattributes just like https://github.com/knative/serving/blob/665012885601188d00e54f4da8fe539cd28765be/.gitattributes#L11

Copy link
Member

Choose a reason for hiding this comment

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

Can we get the coverage and then prune it back :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@adrcunha it's go test's default behavior to ignore vendor. Do you mean to specify it explicitly in .gitattributes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mattmoor the current behavior is to get a complete coverage profile and then ignore those files that are marked as coverage-excluded in .gitattributes when summarizing. I guess this is what you meant, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

@steuhs yes

@adrcunha adrcunha changed the title change a code coverage job to test running coverage on entire ./ Run code coverage on the entire knative/pkg repo Sep 24, 2018
@adrcunha
Copy link
Contributor

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 24, 2018
@knative-prow-robot knative-prow-robot merged commit 45b3a2e into knative:master Sep 24, 2018
Cynocracy pushed a commit to Cynocracy/test-infra that referenced this pull request Jun 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants