-
Notifications
You must be signed in to change notification settings - Fork 55
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
[Feature] Run test conditionally #1160
Comments
When we rollout a policy, we do this by our environment gradually (dev, test, and production) and control the value via helm values that are passed in. During our testing pipeline, we have added a script to ensure that |
We would like to see this feature too. Some of our tests depend on the cluster env, cloud provider and auth types. For example, we are currently running these tests as below.
It would be great if this use case is handled in Chainsaw like if all the conditions match, proceed with the test run else skip the test case. |
Cli has parameters: --exclude-test-regex and --include-test-regex. |
+1 for this feature request. We would also like to sometimes skip steps within tests. Currently, there is ability to skip the entire test, but not a step within the test. So something like:
|
Problem Statement
For example, I want to run a chainsaw test if a Kyverno policy is in Enforce mode, but if the Kyverno policy is in Audit mode, then the chainsaw test is not run.
Solution Description
One way I can think of to implement this is to add some precondition check field under spec, in the example below I named it precheck. So if the precheck fails, then the test is skipped.
Alternatives
It might be better to have the precheck field available on both the spec level so that the entire test can be skipped, and available on the spec.steps level so that specific steps can be skipped.
Additional Context
No response
Slack discussion
https://kubernetes.slack.com/archives/C067LUFL43U/p1712276658755649
Research
The text was updated successfully, but these errors were encountered: