-
Notifications
You must be signed in to change notification settings - Fork 438
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
chore: migrate from kuttl to chainsaw #2630
Conversation
Replaces #2607 🙈 |
3760863
to
3a40714
Compare
For reference, we should really avoid this kind of thing opentelemetry-operator/tests/e2e/prometheus-config-validation/00-promreceiver-allocatorconfig.yaml Lines 16 to 19 in b32c855
Chainsaw doesn't know anything about resources created with |
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
3a40714
to
d34540d
Compare
We can use templating for it, right? That can happen as a follow-up PR though. |
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 overall, left some minor comments and questions about the Makefile and potential improvements to the tests using chainsaw's features.
@@ -118,11 +118,11 @@ KUBEBUILDER_ASSETS=$(./bin/setup-envtest use -p path 1.23) go test ./pkg... | |||
|
|||
### End to end tests | |||
|
|||
To run the end-to-end tests, you'll need [`kind`](https://kind.sigs.k8s.io) and [`kuttl`](https://kuttl.dev). Refer to their documentation for installation instructions. | |||
To run the end-to-end tests, you'll need [`kind`](https://kind.sigs.k8s.io) and [`chainsaw`](https://kyverno.github.io/chainsaw). Refer to their documentation for installation instructions. |
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 think we can just delete this line and adjust the next one. All of these tools are now installed automatically by the make targets.
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 will do that.
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.
Follow up PR if it's ok.
@{ \ | ||
set -e ;\ | ||
go install github.com/kyverno/chainsaw@v0.1.4 ;\ | ||
} |
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 have a small utility to make this nicer.
@{ \ | |
set -e ;\ | |
go install github.com/kyverno/chainsaw@v0.1.4 ;\ | |
} | |
$(call go-get-tool,$(CHAINSAW), github.com/kyverno/chainsaw,v0.1.4) |
Can we also move the version to its own variable, like the other tools?
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.
👍
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.
Follow up PR if it's ok.
tests/e2e-instrumentation/instrumentation-apache-httpd/chainsaw-test.yaml
Show resolved
Hide resolved
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, we can take care of minor fixes in a follow up. Thanks a lot for your work on this contribution @eddycharly !
Ok, i'll address those comments in follow ups once this one merges :) |
Incredible work here @eddycharly !!! Thank you very much for your contributions. I'm looking forward to those follows to clean this up further. |
This PR migrates e2e tests from kuttl to chainsaw.
Chainsaw was created because kuttl stopped to be actively maintained (it's actually a single maintainer now).
We are also solving most of the kuttl limitations that exist today and wrote a command to automatically migrate from kuttl to chainsaw. It supercharges e2e tests with better logs, config maps assertions, assertions trees and many more things 💪
This is a relatively young project but it has already been adopted by a couple of e2e tests heavy projects (kyverno, keptn, fairwinds rbac-manager, grafana-operator, redis-operator and others).
To give more context, you can see similar PRs at:
Sadly, kuttl haven't done a release since jan 2023.
Here you can find a good video showcasing chainsaw: https://www.youtube.com/watch?v=Ejof-wtAdQM&ab_channel=CamilaMacedo
To make things more concrete, there are a couple of issues in this repo, a few files are not valid and kuttl doesn't complain because unmarshalling is not strict so the non-valid fields are simply ignored. This is a problem because the behaviour of the tests is not the expected one, for example:
opentelemetry-operator/tests/e2e-opampbridge/opampbridge/00-assert.yaml
Lines 67 to 70 in c534eaf
opentelemetry-operator/tests/e2e-prometheuscr/create-sm-prometheus-exporters/07-delete.yaml
Lines 6 to 8 in 94c8420
If you need more infos 👇