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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg/apis tests cleanup on duplicate test name 馃拝 #3495

Merged

Conversation

vdemeester
Copy link
Member

@vdemeester vdemeester commented Nov 4, 2020

Changes

The error/fatal message should report the name of the test. It is
already available when the test fail as it is part of the name of the
test.

This reduces some duplication and make some tests a bit easier to read
and write 馃槈.

Signed-off-by: Vincent Demeester vdemeest@redhat.com

/kind misc
/area testing

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes tests (if functionality changed/added)
  • Includes docs (if user facing)
  • Commit messages follow commit message best practices
  • Release notes block has been filled in or deleted (only if no user facing changes)

See the contribution guide for more details.

Double check this list of stuff that's easy to miss:

Reviewer Notes

If API changes are included, additive changes must be approved by at least two OWNERS and backwards incompatible changes must be approved by more than 50% of the OWNERS, and they must first be added in a backwards compatible way.

Release Notes

NONE

@tekton-robot tekton-robot added release-note-none Denotes a PR that doesnt merit a release note. kind/misc Categorizes issue or PR as a miscellaneuous one. area/testing Issues or PRs related to testing labels Nov 4, 2020
@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 4, 2020
@vdemeester
Copy link
Member Author

/retest

Comment on lines 127 to 151
if d := cmp.Diff(err.Error(), ps.want.Error()); d != "" {
t.Errorf("PipelineRun.Validate/%s %s", ps.name, diff.PrintWantGot(d))
t.Error(diff.PrintWantGot(d))
Copy link
Member

Choose a reason for hiding this comment

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

nit: got/want needs to be flipped to want/got to make this error msg correct 馃

Copy link
Member Author

Choose a reason for hiding this comment

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

oh on the cmd.Diff, indeed 馃槄

@jerop
Copy link
Member

jerop commented Nov 4, 2020

/retest

@vdemeester vdemeester force-pushed the test-remove-duplicate-test-name branch from acd2d73 to 8e96733 Compare November 5, 2020 09:18
@jerop
Copy link
Member

jerop commented Nov 5, 2020

/lgtm

@tekton-robot tekton-robot added lgtm Indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Nov 5, 2020
The error/fatal message should report the name of the test. It is
already available when the test fail as it is part of the name of the
test.

This reduces some duplication and make some tests a bit easier to read
and write 馃槈.

Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
@vdemeester vdemeester force-pushed the test-remove-duplicate-test-name branch from 8e96733 to 28ca2ae Compare November 10, 2020 14:19
@tekton-robot tekton-robot removed lgtm Indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Nov 10, 2020
@vdemeester
Copy link
Member Author

/test all

@ghost
Copy link

ghost commented Nov 11, 2020

/retest

}
t.Run(tt.name, func(t *testing.T) {
sa := tt.pr.GetServiceAccountName(taskName)
if expected != sa {
Copy link

Choose a reason for hiding this comment

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

does expected here need to be shadowed inside the if now that it's wrapped in a t.Run? Or is that only if t.Parallel has been called somewhere else?

Copy link
Member Author

Choose a reason for hiding this comment

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

Only if t.Parallel is called inside the t.Run 馃槈

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sbwsg

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

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 11, 2020
@dlorenc
Copy link
Contributor

dlorenc commented Nov 16, 2020

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 16, 2020
@tekton-robot tekton-robot merged commit d5283ce into tektoncd:master Nov 16, 2020
@vdemeester vdemeester deleted the test-remove-duplicate-test-name branch November 16, 2020 17:13
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. area/testing Issues or PRs related to testing kind/misc Categorizes issue or PR as a miscellaneuous one. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesnt merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants