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

Enable import-boss check for integration test #89235

Merged
merged 1 commit into from Mar 31, 2020

Conversation

oomichi
Copy link
Member

@oomichi oomichi commented Mar 18, 2020

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Integration tests imported e2e test code and the dependency made two drawbacks:

This enables import-boss check for blocking such dependency.

Which issue(s) this PR fixes:

Fixes #89185

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. 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 Mar 18, 2020
@k8s-ci-robot k8s-ci-robot added area/test 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 Mar 18, 2020
"Rules": [
{
"SelectorRegexp": "k8s[.]io/kubernetes/test/e2e",
"AllowedPrefixes": []
Copy link
Member Author

Choose a reason for hiding this comment

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

This means test/integration code is not allowed to import any code under test/e2e/.

@oomichi
Copy link
Member Author

oomichi commented Mar 23, 2020

/test pull-kubernetes-verify

@oomichi
Copy link
Member Author

oomichi commented Mar 23, 2020

Now we have remaining one as

errors in package "k8s.io/kubernetes/test/integration/benchmark/jsonify":
the following imports did not match any allowed prefix:
  k8s.io/kubernetes/test/e2e/perftype

@oomichi
Copy link
Member Author

oomichi commented Mar 27, 2020

/retitle Enable import-boss check for integration test

@k8s-ci-robot k8s-ci-robot changed the title WIP: Enable import-boss check for integration test Enable import-boss check for integration test Mar 27, 2020
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 27, 2020
@oomichi
Copy link
Member Author

oomichi commented Mar 27, 2020

/cc @andrewsykim

@oomichi
Copy link
Member Author

oomichi commented Mar 27, 2020

/retest

@gavinfish
Copy link
Contributor

@oomichi thanks for doing this! Wait for other reviewers' feedback.

@gavinfish
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 27, 2020
@spiffxp
Copy link
Member

spiffxp commented Mar 30, 2020

/assign

@@ -30,7 +30,7 @@ kube::golang::setup_env

make -C "${KUBE_ROOT}" WHAT=vendor/k8s.io/code-generator/cmd/import-boss

packages=("k8s.io/kubernetes/pkg/..." "k8s.io/kubernetes/cmd/..." "k8s.io/kubernetes/plugin/..." "k8s.io/kubernetes/test/e2e/framework/...")
packages=("k8s.io/kubernetes/pkg/..." "k8s.io/kubernetes/cmd/..." "k8s.io/kubernetes/plugin/..." "k8s.io/kubernetes/test/e2e/framework/..." "k8s.io/kubernetes/test/integration/...")
Copy link
Member

Choose a reason for hiding this comment

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

can you put these on newlines and alphasort for ease of diff going forward?

Suggested change
packages=("k8s.io/kubernetes/pkg/..." "k8s.io/kubernetes/cmd/..." "k8s.io/kubernetes/plugin/..." "k8s.io/kubernetes/test/e2e/framework/..." "k8s.io/kubernetes/test/integration/...")
packages=(
"k8s.io/kubernetes/cmd/..."
"k8s.io/kubernetes/pkg/..."
# etc..
)

Copy link
Member Author

Choose a reason for hiding this comment

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

@spiffxp Thanks for your review.
That is a good idea to maintain many places.

Integration tests imported e2e test code and the dependency made two drawbacks:

- Hard to move test/e2e/framework into staging (kubernetes#74352)
- Need to run integration tests always even if PRs are just changing e2e test code

This enables import-boss check for blocking such dependency.
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 30, 2020
@spiffxp
Copy link
Member

spiffxp commented Mar 30, 2020

I tried running this locally via make verify WHAT="import-boss" and saw a lot of warnings. It appears to be doing that in CI too, is that expected?

@spiffxp
Copy link
Member

spiffxp commented Mar 30, 2020

/priority important-soon
/approve
/lgtm

@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. lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Mar 30, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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 Mar 30, 2020
@oomichi
Copy link
Member Author

oomichi commented Mar 30, 2020

@spiffxp

I tried running this locally via make verify WHAT="import-boss" and saw a lot of warnings. It appears to be doing that in CI too, is that expected?

That is a nice point.
Yes, that is expected.
The latest master branch without this PR also outputs such warning messages if running hack/verify-import-boss.sh.
I submitted #89668 for handling this issue.

@k8s-ci-robot k8s-ci-robot merged commit 740a7b1 into kubernetes:master Mar 31, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.19 milestone Mar 31, 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. 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.

Integration tests should be independent from e2e test code
4 participants