-
Notifications
You must be signed in to change notification settings - Fork 8
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
test: add context-aware integration tests #399
test: add context-aware integration tests #399
Conversation
fe05241
to
1a000b5
Compare
7a811f7
to
32f0c21
Compare
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.
LGTM. I just have a quick question. I'll not give a "approved" flag because the PR is a draft and I know that Fabrizio is working on this still.
32f0c21
to
7a42537
Compare
0e026ad
to
443bd1d
Compare
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.
Love it! One minor nitpick, see my comment.
I would start the transfer process of the test policies to the kubewaden organization, and then change this PR to consume the images from there. Then we can merge it
Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
4a48d59
to
f50075c
Compare
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.
LGTM!
Description
This PR introduces context-aware integration tests.
The following runtimes have been tested by using context-aware test policies:
Todo
To be able to run the tests, a mock Kubernetes client was created by using this guide: https://kube.rs/controllers/testing/#unit-tests-with-mocks
Since there is nothing equivalent to envtest in Rust, using a mock allows us to save some CI time (and effort) by relying on a mock kube-rs Client.
An alternative could have been setting up a real cluster, but dealing with the isolation and testcontainers was a big downside and the return on investment wasn't worth it for this type of test, since the goal is testing the policy evaluator and considering we already have e2e tests in place.