Skip to content

Commit

Permalink
test: clean version
Browse files Browse the repository at this point in the history
Signed-off-by: realanna <[email protected]>
  • Loading branch information
RealAnna committed Apr 12, 2023
1 parent 8f5c912 commit d4e6367
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 20 deletions.
10 changes: 8 additions & 2 deletions test/integration/expose-keptn-metric/00-teststep.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
apiVersion: kuttl.dev/v1
kind: TestStep
commands: #generating job and metric based on namespace to avoid interference between runs
- script: ./applyjob.sh no-metrics.yaml
- script: ./assertjob.sh job1
- script: |
export NAME=$( echo $NAMESPACE | tr -d -)
echo "installing first job"
envsubst < no-metrics.yaml | kubectl apply -f -
- script: |
export NAME=$( echo $NAMESPACE | tr -d -)
echo "asserting first job"
kubectl wait --for=condition=complete job $NAME-job1 -n $NAMESPACE
12 changes: 12 additions & 0 deletions test/integration/expose-keptn-metric/01-teststep.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: kuttl.dev/v1
kind: TestStep
commands:
- script: | #generating job and metric based on namespace to avoid interference between runs
export NAME=$( echo $NAMESPACE | tr -d -)
echo "installing second job"
envsubst < metrics.yaml | kubectl apply -f -
- script: | #generating job assertion file
export NAME=$( echo $NAMESPACE | tr -d -)
echo "asserting second job"
kubectl wait --for=condition=complete job $NAME-job2 -n $NAMESPACE
6 changes: 0 additions & 6 deletions test/integration/expose-keptn-metric/02-teststep.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions test/integration/expose-keptn-metric/applyjob.sh

This file was deleted.

4 changes: 0 additions & 4 deletions test/integration/expose-keptn-metric/assertjob.sh

This file was deleted.

4 changes: 2 additions & 2 deletions test/integration/expose-keptn-metric/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: metrics.keptn.sh/v1alpha2
kind: KeptnMetric
metadata:
name: $NAME
namespace: keptn-lifecycle-toolkit-system
namespace: $NAMESPACE
spec:
provider:
name: "provider"
Expand Down Expand Up @@ -39,7 +39,7 @@ spec:
- /bin/sh
- -ec
- |
curl -s metrics-operator-service.keptn-lifecycle-toolkit-system.svc.cluster.local:9999/api/v1/metrics/keptn-lifecycle-toolkit-system//$NAME > ~/out.txt
curl -s metrics-operator-service.keptn-lifecycle-toolkit-system.svc.cluster.local:9999/api/v1/metrics/$NAMESPACE/$NAME > ~/out.txt
echo ~/out.txt
if grep -F "$NAME" ~/out.txt
then
Expand Down
2 changes: 1 addition & 1 deletion test/integration/expose-keptn-metric/no-metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
- /bin/sh
- -ec
- |
curl -s metrics-operator-service.keptn-lifecycle-toolkit-system.svc.cluster.local:9999/api/v1/metrics//{$NAME} > ~/out.txt
curl -s metrics-operator-service.keptn-lifecycle-toolkit-system.svc.cluster.local:9999/api/v1/metrics/$NAMESPACE/$NAME > ~/out.txt
cat ~/out.txt
if grep -F "$NAME" ~/out.txt
then
Expand Down

0 comments on commit d4e6367

Please sign in to comment.