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

Add code check for framework.ExpectEqual() #80785

Merged
merged 1 commit into from
Aug 13, 2019

Conversation

oomichi
Copy link
Member

@oomichi oomichi commented Jul 31, 2019

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

This adds code check for using framework.ExpectEqual(foo, bar) in
e2e tests for keeping the test code simple.

Close: #79686

Special notes for your reviewer:

When we finish all tasks in #79686 this PR can be merged.

@k8s-ci-robot
Copy link
Contributor

@oomichi: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jul 31, 2019
@k8s-ci-robot k8s-ci-robot requested review from eparis and ixdy July 31, 2019 03:35
@oomichi
Copy link
Member Author

oomichi commented Jul 31, 2019

/release-note-none

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Jul 31, 2019
errors_expect_equal=()
for file in "${all_e2e_files[@]}"
do
if grep "Expect(.*)\.To(.*Equal(" "${file}" > /dev/null
Copy link
Contributor

Choose a reason for hiding this comment

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

The line detects test/e2e/auth/node_authn.go as containing errors.
node_authn.go contains the following line. But I think that it should not be detected.

gomega.Expect(result).To(gomega.Or(gomega.Equal("401"), gomega.Equal("403")), ...

How about changing it like grep -E "Expect\(.*\)\.To\((gomega\.Equal|Equal) ?

Copy link
Member Author

Choose a reason for hiding this comment

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

@k-toyoda-pi Thank you for your comment, nice catch.
I will update this soon.

This adds code check for using framework.ExpectEqual(foo, bar) in
e2e tests for keeping the test code simple.
@oomichi
Copy link
Member Author

oomichi commented Jul 31, 2019

/sig testing

@k8s-ci-robot k8s-ci-robot added sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jul 31, 2019
@spiffxp
Copy link
Member

spiffxp commented Jul 31, 2019

/priority important-soon
/retest
Can we find a way to do these checks without bash?

@k8s-ci-robot k8s-ci-robot added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jul 31, 2019
@spiffxp
Copy link
Member

spiffxp commented Jul 31, 2019

/area test

@oomichi
Copy link
Member Author

oomichi commented Jul 31, 2019

@spiffxp

Can we find a way to do these checks without bash?

Humm, TBH I cannot imagine alternative way except current bash way :-(

Anyways, this cannot be merged at this time because 2 PRs(#80790 and not-yet PR according to #79686) are necessary to be merged first before this.

@oomichi
Copy link
Member Author

oomichi commented Jul 31, 2019

To wait for merging necessary PRs before this.

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 31, 2019
@oomichi
Copy link
Member Author

oomichi commented Aug 7, 2019

All necessary PRs are merged, so let's retest this.

/retest
/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 7, 2019
@oomichi
Copy link
Member Author

oomichi commented Aug 7, 2019

@spiffxp This seems ready at this time, PTAL :-)

@oomichi
Copy link
Member Author

oomichi commented Aug 8, 2019

/cc @BenTheElder Could you take a look at this?

Copy link
Member

@BenTheElder BenTheElder left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 12, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: BenTheElder, oomichi

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 12, 2019
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

2 similar comments
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@oomichi
Copy link
Member Author

oomichi commented Aug 13, 2019

/test pull-kubernetes-kubemark-e2e-gce-big

@k8s-ci-robot k8s-ci-robot merged commit d2eecfe into kubernetes:master Aug 13, 2019
@k8s-ci-robot k8s-ci-robot added this to the v1.16 milestone Aug 13, 2019
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/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-none Denotes a PR that doesn't merit a release note. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use framework.ExpectEqual() for e2e tests
6 participants