-
Notifications
You must be signed in to change notification settings - Fork 34
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 Framework for Conformance Tests #98
Add Framework for Conformance Tests #98
Conversation
✅ Deploy Preview for kubernetes-sigs-network-policy-api ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
1c4ecdf
to
0d18643
Compare
This commit tracks the go.mod and go.sum changes to import some of the dependencies we need to build and run conformance tests. Signed-off-by: Surya Seetharaman <suryaseetharaman.9@gmail.com>
0d18643
to
9f48fd2
Compare
9f48fd2
to
1e988f9
Compare
|
||
// StandardExtendedFeatures are extra generic features that implementations may | ||
// choose to support as an opt-in. | ||
var StandardExtendedFeatures = sets.New( |
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.
We should probably document somewhere that these are the "optional" features
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.
yes good point: #102 -> I have opened that issue to document everything on conformance but probably the docs PR will go last once I've finished adding all the tests - but certainly planning on having a separate space in our website to talk about conformance.
Tested locally things look good! Just some small NITs |
t.Logf("Running conformance tests with cleanup: %t\n debug: %t\n enable all features: %t \n supported features: [%v]\n exempt features: [%v]", | ||
*flags.CleanupBaseResources, *flags.ShowDebug, *flags.EnableAllSupportedFeatures, *flags.SupportedFeatures, *flags.ExemptFeatures) | ||
|
||
cSuite := suite.New(suite.Options{ |
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.
@tssurya Would it be difficult to have a "--dry-run" flag here?
Then in our upstream CI we could run the tests against a vanilla KIND cluster without actually testing an implementation
It could help ensure the future stability of the tests
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.
I'm assuming it would just involve adding it to your "poke..." function
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.
hmm great point! I think this should be doable.. let me open a card for this to enhance this further - #107
Also note that all implementations should be running these exact tests downstream, so if something breaks here we will know for sure :D because I will have trouble in OVN-K CI :D - let me take a stab at this issue once I have figured out the whole picture of how I will digest this downstream on the CI...
This commit adds the initial framework we need to run conformance tests. ALL CREDIT to sig-network-gatewaya-api community and folks who added conformance there. We have blatantly copied from them and adapted the suite to our needs. https://github.com/kubernetes-sigs/gateway-api/tree/main/conformance Signed-off-by: Surya Seetharaman <suryaseetharaman.9@gmail.com>
1e988f9
to
00bf1ff
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: astoycos, tssurya 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 |
NOTE: Most of the framework is blatantly adopted from https://github.com/kubernetes-sigs/gateway-api/tree/main/conformance gateway-api code without reinventing the wheel so that we can also adopt the new conformance profile GEP. Of course I have modified some of this to suite the needs of netpol conformance. Kudos/Credit to the
gateway-api
team.NOTE2: This PR only adds the test framework. The actual tests will be added in a second PR.
NOTE3: I contemplated using gateway-api imports into this repo to refer to their conformance test utilities but that didn't seem like the right thing to do because moving forward we would still need to customize some of these utils according to how we modify our tests and so on. @shaneutt has brought up some great points around consolidating some of these pieces into a separate repo that both parties and more parties in future can use extensibly but that is something to ponder in the future.
Sample Output:
Closes #35