Skip to content

Commit

Permalink
test: improve metrics integration tests by adding kuttl log collectors (
Browse files Browse the repository at this point in the history
#2765)

Signed-off-by: Rizul Gupta <[email protected]>
Signed-off-by: Rizul Gupta <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Co-authored-by: odubajDT <[email protected]>
  • Loading branch information
rizul2108 and odubajDT authored Jan 18, 2024
1 parent d6d83c7 commit 728cea8
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 15 deletions.
26 changes: 11 additions & 15 deletions test/testmetrics/metrics-hpa/01-assert.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: podtato-head-entry
labels:
app: podtato-head
spec:
selector:
matchLabels:
component: podtato-head-entry
replicas: 3
template:
metadata:
labels:
component: podtato-head-entry
assert: deployment.yaml
apiVersion: kuttl.dev/v1beta1
kind: TestAssert
collectors:
- type: pod
selector: app=podtato-head
- command: |
kubectl logs -l app=metrics-operator -n keptn-system
kubectl describe keptnmetric podtatometric -n $NAMESPACE
kubectl describe keptnmetricsprovider dynatrace -n $NAMESPACE
kubectl describe pods -l app=podtato-head -n $NAMESPACE
15 changes: 15 additions & 0 deletions test/testmetrics/metrics-hpa/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: podtato-head-entry
labels:
app: podtato-head
spec:
selector:
matchLabels:
component: podtato-head-entry
replicas: 3
template:
metadata:
labels:
component: podtato-head-entry
8 changes: 8 additions & 0 deletions test/testmetrics/metrics/02-teststep-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,11 @@ assert: # this checks that kubectl get resource succeeds
- goodmetric3.yaml
- goodmetric4.yaml
- goodmetric5.yaml
collectors:
- type: pod
selector: app=test
- command: |
kubectl logs -l app=metrics-operator -n keptn-system
kubectl describe keptnmetric podtatometric -n $NAMESPACE
kubectl describe keptnmetricsprovider dynatrace -n $NAMESPACE
kubectl describe pods -l app=podtato-head -n $NAMESPACE

0 comments on commit 728cea8

Please sign in to comment.