Skip to content

Commit

Permalink
adjust metrics integration test to use a real promtheus metrics provi…
Browse files Browse the repository at this point in the history
…der and a real query, remove badmetric

Signed-off-by: Moritz Wiesinger <[email protected]>
  • Loading branch information
mowies committed Apr 17, 2023
1 parent 5882d1b commit 84a0f04
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 23 deletions.
7 changes: 7 additions & 0 deletions test/integration/metrics/00-install.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: metrics.keptn.sh/v1alpha3
kind: KeptnMetricsProvider
metadata:
name: my-provider
spec:
type: prometheus
targetServer: "http://prometheus-k8s.monitoring.svc.cluster.local:9090"
7 changes: 0 additions & 7 deletions test/integration/metrics/00-teststep-install.yaml

This file was deleted.

4 changes: 4 additions & 0 deletions test/integration/metrics/01-teststep-install.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
apply:
- goodmetric.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
error: # this checks that kubectl get resource fails, AKA bad CRD not added
- badmetric.yaml
assert: # this checks that kubectl get resource succeeds
- goodmetric.yaml
9 changes: 0 additions & 9 deletions test/integration/metrics/badmetric.yaml

This file was deleted.

7 changes: 3 additions & 4 deletions test/integration/metrics/goodmetric.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
apiVersion: metrics.keptn.sh/v1alpha2
apiVersion: metrics.keptn.sh/v1alpha3
kind: KeptnMetric
metadata:
name: podtato-head
namespace: keptn-lifecycle-toolkit-system
spec:
provider:
name: "provider"
query: "query"
name: "my-provider"
query: "sum(kube_pod_container_resource_limits{resource='cpu'})"
fetchIntervalSeconds: 5
1 change: 0 additions & 1 deletion test/integration/metrics/retrieve-metrics.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash

METRIC_NAME="podtato-head"
NAMESPACE="keptn-lifecycle-toolkit-system"
RETRY_COUNT=3
SLEEP_TIME=5

Expand Down

0 comments on commit 84a0f04

Please sign in to comment.