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

Implement fail field #1

Open
jaypipes opened this issue Aug 1, 2023 · 0 comments
Open

Implement fail field #1

jaypipes opened this issue Aug 1, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@jaypipes
Copy link
Member

jaypipes commented Aug 1, 2023

Currently, the assert field contains a set of assertions that are checked by gdt-kube. These assertions are retried until successful evaluation or a timeout (defaulting to 5s).

However, we want the ability to tell gdt-kube that if a certain condition is matched, that we should immediately fail the test. This would allow test authors to declare, for example, "if this Pod Ready condition goes to False, then fail the test and don't retry"

Possible example schema for the fail field:

tests:
 - kube.get: deployments/nginx
   fail:
     matches:
       spec:
         replicas: 1
   assert:
     matches:
       status:
         readyReplicas: 2

So, the above would attempt to find a status.readyReplicas field value of 2 for a default timeout of 5 seconds, but if at any time the spec.replicas field value is 1, then the test would immediately fail.

@jaypipes jaypipes added the enhancement New feature or request label Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant