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
WIP: Enable import-boss for e2e framework dependency #81246
WIP: Enable import-boss for e2e framework dependency #81246
Conversation
/sig testing |
The errors are outputs as we expected:
|
017cf9d
to
3fafa10
Compare
/area e2e-test-framework |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall +1
There is some more work to be done for #76206 and #77095 and due to the gigantic universe of imports it there may be new framework subpkgs and those may be imported by the framework itself (not the ideal case but it takes a lot of work to rewrite the framework to not use its subpkgs).
Would it be reasonable to update hack/.e2e_framework_import_failures
with these new packages as they come up, clean them up (make sure the framework doesn't import these), and then remove the reference to them from hack/.e2e_framework_import_failures
?
/priority important-soon
/assign @timothysc @andrewsykim
Can we not use our existing |
/hold |
Ha forgot about #80496 |
@spiffxp @alejandrox1 Thanks for your advice. |
Core e2e test framework(test/e2e/framework) should not import sub e2e test frameworks (e.g. test/e2e/framework/auth) for avoiding circular dependency. This adds e2e code check for avoiding such circular dependency.
3fafa10
to
e82a0a0
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 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 |
I am adding some rule to |
I guessed this PR should fail on some gating job because current implementation is against the additional rule I expected, but it doesn't happen. |
Ha! I think I discovered an issue...
import-boss is a small script that uses the Cming back to this, I don't think that /test/e2e/framework/.import-restrictions is "working". It seems that we have to explicitly tell import-boss to go into arguments.InputDirs = []string{
"k8s.io/kubernetes/pkg/...",
"k8s.io/kubernetes/cmd/...",
"k8s.io/kubernetes/plugin/...",
"k8s.io/kubernetes/test/e2e/framework/...",
}
```. |
Great help, thanks!
Yep, we need to add the line. |
"SelectorRegexp": "k8s[.]io/kubernetes/test/e2e/framework/", | ||
"AllowedPrefixes": [], | ||
"ForbiddenPrefixes": [ | ||
"k8s.io/kubernetes/test/e2e/framework/auth", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this? Wouldn't it by definition cause an import cycle?
All subpackages would import framework.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for my late response.
and you are right, all subpackages should be able to import the framework.
After understanding this verify-import-boss check way, I saw the above proposed change was invalid.
I will try to find the valid way to block circular import with this.
update on this: I'll work on fixing the current import restrictions on the e2e framework (ref #81246 (comment) ) so we can get on with this. |
Bug triage for 1.17 here. Code freeze is Nov. 14th. Will this PR be merged by then? If not, can we move it out of the milestone? |
/milestone clear |
/assign @alejandrox1 |
Sorry for leaving this in long time, I'd like to restart fixing this again because this is useful for maintaining e2e framework in long-term. |
/hold cancel |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Core e2e test framework(test/e2e/framework) should not import sub e2e test frameworks (e.g. test/e2e/framework/auth).
This enables import-boss check for blocking such invalid dependency on e2e test framework.
Ref: #81245
Does this PR introduce a user-facing change?: