Skip to content
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

Feat: update mutate tests #21

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

realshuting
Copy link
Member

This PR updates mutate test to create 10 mutation policies for load testing.

✗ ./start.sh tests/kyverno-mutate.js 1 1
Running tests/kyverno-mutate.js...
installing 10 mutate policies
Policies data has been written to /tmp/policies.json file
clusterpolicy.kyverno.io/policy-0 created
clusterpolicy.kyverno.io/policy-2 created
clusterpolicy.kyverno.io/policy-7 created
clusterpolicy.kyverno.io/policy-6 created
clusterpolicy.kyverno.io/policy-5 created
clusterpolicy.kyverno.io/policy-9 created
clusterpolicy.kyverno.io/policy-8 created
clusterpolicy.kyverno.io/policy-3 created
clusterpolicy.kyverno.io/policy-1 created
clusterpolicy.kyverno.io/policy-4 created
clusterpolicy.kyverno.io/policy-0 condition met
clusterpolicy.kyverno.io/policy-1 condition met
clusterpolicy.kyverno.io/policy-2 condition met
clusterpolicy.kyverno.io/policy-3 condition met
clusterpolicy.kyverno.io/policy-4 condition met
clusterpolicy.kyverno.io/policy-5 condition met
clusterpolicy.kyverno.io/policy-6 condition met
clusterpolicy.kyverno.io/policy-7 condition met
clusterpolicy.kyverno.io/policy-8 condition met
clusterpolicy.kyverno.io/policy-9 condition met
Deploying namespace...
namespace/load-tests created
Deploying RBAC...
serviceaccount/load-test created
clusterrolebinding.rbac.authorization.k8s.io/load-test created
secret/load-test-token created
Creating configmap...
configmap/load-test created
Deploying k6 job...
job.batch/load-test created
Waiting for the job to finish...
job.batch/load-test condition met
Getting job exit code...
Job exit code: 0
Extracting logs and summary...
Clean up job and configmap...
job.batch "load-test" deleted
configmap "load-test" deleted
clusterrolebinding.rbac.authorization.k8s.io "load-test" deleted
Clean up...
namespace "load-tests" deleted
cleaning up 10 mutate policies
clusterpolicy.kyverno.io "policy-0" deleted
clusterpolicy.kyverno.io "policy-2" deleted
clusterpolicy.kyverno.io "policy-7" deleted
clusterpolicy.kyverno.io "policy-6" deleted
clusterpolicy.kyverno.io "policy-5" deleted
clusterpolicy.kyverno.io "policy-9" deleted
clusterpolicy.kyverno.io "policy-8" deleted
clusterpolicy.kyverno.io "policy-3" deleted
clusterpolicy.kyverno.io "policy-1" deleted
clusterpolicy.kyverno.io "policy-4" deleted

Signed-off-by: ShutingZhao <shuting@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
@KhaledEmaraDev
Copy link
Collaborator

Instead if hardcoding the number of policies we can use env vars. I would also argue against hard-coding the name of the test in the start script. The original way I did it using setup is the best way I believe. It's controlled by k6 and reports the creation status in the final report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants