Skip to content

Commit

Permalink
add kuttl tests
Browse files Browse the repository at this point in the history
Signed-off-by: Rakshit Gondwal <[email protected]>
  • Loading branch information
rakshitgondwal committed Jul 24, 2023
1 parent 46f8830 commit f338106
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 2 deletions.
3 changes: 2 additions & 1 deletion test/integration/metrics/01-teststep-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ apply:
- goodmetric2.yaml
- goodmetric3.yaml
- goodmetric4.yaml
- goodmetric5.yaml
commands:
- command: kubectl apply -f badmetric.yaml
- command: kubectl apply -f badmetric1.yaml badmetric2.yaml
ignoreFailure: true # we must install ignoring the validating webhook error to proceed with the test
4 changes: 3 additions & 1 deletion test/integration/metrics/02-teststep-assert.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
error: # this checks that kubectl get resource fails, AKA bad CRD not added
- badmetric.yaml
- badmetric1.yaml
- badmetric2.yaml
assert: # this checks that kubectl get resource succeeds
- goodmetric1.yaml
- goodmetric2.yaml
- goodmetric3.yaml
- goodmetric4.yaml
- goodmetric5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ commands:
- script: ./retrieve-metrics.sh "podtato-head2"
- script: ./retrieve-metrics.sh "podtato-head3"
- script: ./retrieve-metrics.sh "podtato-head4"
- script: ./retrieve-metrics.sh "podtato-head5"
File renamed without changes.
12 changes: 12 additions & 0 deletions test/integration/metrics/badmetric2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: metrics.keptn.sh/v1alpha3
kind: KeptnMetric
metadata:
name: podtato-head1
spec:
provider:
name: "my-provider"
query: "sum(kube_pod_container_resource_limits{resource='cpu'})"
fetchIntervalSeconds: 5
range:
interval: "5m"
step: "1mins"
12 changes: 12 additions & 0 deletions test/integration/metrics/goodmetric5.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: metrics.keptn.sh/v1alpha3
kind: KeptnMetric
metadata:
name: podtato-head5
spec:
provider:
name: "my-provider2"
query: "sum(kube_pod_container_resource_limits{resource='cpu'})"
fetchIntervalSeconds: 5
range:
interval: "5m"
step: "1m"

0 comments on commit f338106

Please sign in to comment.