You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to write sort of the equivalent of an integration test I guess.
I have a couple different "types" of apps I deploy and they all use mostly the same parameters. I want to write a test that describes a complete profile of parameters to deploy a specific classification of app. This could be "public web app with mysql DB", "internal web app with redis DB", etc.
If I could do this then these tests would also be able to serve as documentation- a complete example with ALL the specific params required to deploy app of type X.
Is this possible? Maybe this already is possible but Im not sure how the test "suites" are organized.
Example might look like this:
suite: test deployment
set:
<all the required values to deploy this type of app>
templates:
- deployment.yaml
- ingress.yaml
- <bunch of other resources>
tests:
- it: A public facing web app the uses a mysql DB
asserts:
# test Deployment resource
- isKind:
of: Deployment
- matchRegex:
path: metadata.name
pattern: -my-chart$
# also test Ingress resource in same test
- isKind:
of: Ingress
- matchRegex:
path: metadata.name
pattern: blahblahblah
The text was updated successfully, but these errors were encountered:
While it isn't what you're looking for, YAML anchors and the fact unittest isn't strict about its schema can help you here:
suite: test deploymentfixtures:
required: &required-values<all the required values to deploy this type of app>templates:
- deployment.yamltests:
- it: does the things with the stuffset: *required-valuesasserts:
<your assertions here>
- it: does more things with the stuff if blergh is set to ABCset:
<<: *required-valuesblergh: ABCasserts:
<your assertions here>
Sadly, AFAIK only the tests themselves, not the assertions, can be limited to specific templates:
templates:
- deployment.yaml
- ingress.yamltests:
- it: does the things with the stufftemplates: [ deployment.yaml ]asserts:
<your deployment assertions>
- it: also does the things with the stufftemplates: [ ingress.yaml ]asserts:
<your ingress assertions>
I want to write sort of the equivalent of an integration test I guess.
I have a couple different "types" of apps I deploy and they all use mostly the same parameters. I want to write a test that describes a complete profile of parameters to deploy a specific classification of app. This could be "public web app with mysql DB", "internal web app with redis DB", etc.
If I could do this then these tests would also be able to serve as documentation- a complete example with ALL the specific params required to deploy app of type X.
Is this possible? Maybe this already is possible but Im not sure how the test "suites" are organized.
Example might look like this:
The text was updated successfully, but these errors were encountered: