Skip to content

Commit

Permalink
Fix e2e tests (#1071)
Browse files Browse the repository at this point in the history
  • Loading branch information
IshwarKanse authored Oct 29, 2024
1 parent e1639a5 commit 762c39a
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 26 deletions.
22 changes: 6 additions & 16 deletions tests/e2e-openshift/monitoring/02-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
app.kubernetes.io/component: query-frontend
app.kubernetes.io/instance: tempostack
app.kubernetes.io/managed-by: tempo-operator
app.kubernetes.io/name: tempo
Expand All @@ -320,28 +321,17 @@ spec:
- path: /metrics
port: http
relabelings:
- sourceLabels:
- action: replace
sourceLabels:
- __meta_kubernetes_service_label_app_kubernetes_io_instance
targetLabel: cluster
- separator: /
- action: replace
separator: /
sourceLabels:
- __meta_kubernetes_namespace
- __meta_kubernetes_service_label_app_kubernetes_io_component
targetLabel: job
scheme: https
tlsConfig:
ca:
configMap:
key: service-ca.crt
name: tempo-tempostack-ca-bundle
cert:
secret:
key: tls.crt
name: tempo-tempostack-query-frontend-mtls
keySecret:
key: tls.key
name: tempo-tempostack-query-frontend-mtls
serverName: tempo-tempostack-query-frontend.chainsaw-monitoring.svc.cluster.local
scheme: http
namespaceSelector:
matchNames:
- chainsaw-monitoring
Expand Down
18 changes: 17 additions & 1 deletion tests/e2e-openshift/monolithic-route/chainsaw-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,22 @@ spec:
file: install-tempo-assert.yaml
- name: Run the must-gather and verify the contents
try:
- command:
entrypoint: oc
args:
- get
- pods
- -A
- -l control-plane=controller-manager
- -l app.kubernetes.io/name=tempo-operator
- -o
- jsonpath={.items[0].metadata.namespace}
outputs:
- name: TEMPO_NAMESPACE
value: ($stdout)
- script:
env:
- name: temponamespace
value: ($TEMPO_NAMESPACE)
timeout: 5m
content: ./check-must-gahter.sh
content: ./check-must-gather.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#!/bin/bash

# Check if must gather directory exists
MUST_GATHER_DIR=/tmp/monolithic-route
mkdir -p $MUST_GATHER_DIR
# Create a temporary directory to store must-gather
MUST_GATHER_DIR=$(mktemp -d)

# Run the must-gather script
oc adm must-gather --dest-dir=$MUST_GATHER_DIR --image=quay.io/rhn_support_ikanse/tempo-must-gather:latest -- /usr/bin/must-gather --operator-namespace tempo-operator
oc adm must-gather --dest-dir=$MUST_GATHER_DIR --image=quay.io/rhn_support_ikanse/tempo-must-gather:latest -- /usr/bin/must-gather --operator-namespace $temponamespace

# Define required files and directories
REQUIRED_ITEMS=(
Expand Down
18 changes: 17 additions & 1 deletion tests/e2e-openshift/route/chainsaw-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,22 @@ spec:
content: kubectl get --namespace $NAMESPACE tempo simplest -o jsonpath='{.status.conditions[?(@.type=="Ready")].status}' | grep True
- name: Run the must-gather and verify the contents
try:
- command:
entrypoint: oc
args:
- get
- pods
- -A
- -l control-plane=controller-manager
- -l app.kubernetes.io/name=tempo-operator
- -o
- jsonpath={.items[0].metadata.namespace}
outputs:
- name: TEMPO_NAMESPACE
value: ($stdout)
- script:
env:
- name: temponamespace
value: ($TEMPO_NAMESPACE)
timeout: 5m
content: ./check-must-gahter.sh
content: ./check-must-gather.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#!/bin/bash

# Check if must gather directory exists
MUST_GATHER_DIR=/tmp/route
mkdir -p $MUST_GATHER_DIR
# Create a temporary directory to store must-gather
MUST_GATHER_DIR=$(mktemp -d)

# Run the must-gather script
oc adm must-gather --dest-dir=$MUST_GATHER_DIR --image=quay.io/rhn_support_ikanse/tempo-must-gather:latest -- /usr/bin/must-gather --operator-namespace tempo-operator
oc adm must-gather --dest-dir=$MUST_GATHER_DIR --image=quay.io/rhn_support_ikanse/tempo-must-gather:latest -- /usr/bin/must-gather --operator-namespace $temponamespace

# Define required files and directories
REQUIRED_ITEMS=(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ spec:
- -config.file=/conf/tempo-query-frontend.yaml
- -mem-ballast-size-mbs=1024
- -log.level=info
- -config.expand-env=true
- --storage.trace.s3.secret_key=$(S3_SECRET_KEY)
- --storage.trace.s3.access_key=$(S3_ACCESS_KEY)
env:
Expand Down
1 change: 1 addition & 0 deletions tests/e2e-openshift/tls-singletenant/01-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ spec:
- -config.file=/conf/tempo-query-frontend.yaml
- -mem-ballast-size-mbs=1024
- -log.level=info
- -config.expand-env=true
- --storage.trace.s3.secret_key=$(S3_SECRET_KEY)
- --storage.trace.s3.access_key=$(S3_ACCESS_KEY)
env:
Expand Down

0 comments on commit 762c39a

Please sign in to comment.