Skip to content

Commit

Permalink
test: Show Operator Failed Logs (#843)
Browse files Browse the repository at this point in the history
Signed-off-by: Shubham Gupta <[email protected]>
  • Loading branch information
shubham-cmyk authored Mar 25, 2024
1 parent ff91665 commit a521613
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ spec:
file: ready-svc.yaml
- assert:
file: ready-pvc.yaml
catch:
- description: Redis Operator Logs
podLogs:
namespace: redis-operator-system
selector: control-plane=redis-operator
container: manager
tail: -1 # tail all logs

- name: Sleep for five minutes
try:
Expand Down
30 changes: 29 additions & 1 deletion tests/e2e-chainsaw/v1beta2/ha-failover/chainsaw-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ spec:
file: sentinel.yaml
- create:
file: cli-pod.yaml
catch:
- description: Redis Operator Logs
podLogs:
namespace: redis-operator-system
selector: control-plane=redis-operator
container: manager
tail: -1 # tail all logs

- name: Sleep for 3 minutes
try:
Expand All @@ -25,6 +32,13 @@ spec:
kubectl exec --namespace ${NAMESPACE} redis -- redis-cli -h redis-sentinel-sentinel.${NAMESPACE}.svc -p 26379 sentinel master myMaster | grep -A 1 'flags' | tail -n 1
check:
($stdout=='master'): true
catch:
- description: Redis Operator Logs
podLogs:
namespace: redis-operator-system
selector: control-plane=redis-operator
container: manager
tail: -1 # tail all logs

# New created cluster, the first pod is master
- name: Terminate the redis-replication-0 pod
Expand All @@ -33,6 +47,13 @@ spec:
timeout: 10s
content: |
kubectl --namespace ${NAMESPACE} delete pod redis-replication-0
catch:
- description: Redis Operator Logs
podLogs:
namespace: redis-operator-system
selector: control-plane=redis-operator
container: manager
tail: -1 # tail all logs

- name: Sleep for 3 minutes
try:
Expand All @@ -46,4 +67,11 @@ spec:
content: |
kubectl exec --namespace ${NAMESPACE} redis -- redis-cli -h redis-sentinel-sentinel.${NAMESPACE}.svc -p 26379 sentinel master myMaster | grep -A 1 'flags' | tail -n 1
check:
($stdout=='master'): true
($stdout=='master'): true
catch:
- description: Redis Operator Logs
podLogs:
namespace: redis-operator-system
selector: control-plane=redis-operator
container: manager
tail: -1 # tail all logs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ spec:
file: ready-svc.yaml
- assert:
file: ready-pvc.yaml
catch:
- description: Redis Operator Logs
podLogs:
namespace: redis-operator-system
selector: control-plane=redis-operator
container: manager
tail: -1 # tail all logs

- name: Sleep for five minutes
try:
Expand Down Expand Up @@ -127,4 +134,5 @@ spec:
content: |
kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-follower redis-cluster-v1beta2-follower-2 -- redis-cli -c -p 6379 set foo-5 bar-5
check:
($stdout=='OK'): true
($stdout=='OK'): true

Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ spec:
file: ready-svc.yaml
- assert:
file: ready-pvc.yaml
catch:
- description: Redis Operator Logs
podLogs:
namespace: redis-operator-system
selector: control-plane=redis-operator
container: manager
tail: -1 # tail all logs

- name: Ping Replicated Cluster
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,11 @@ spec:
- assert:
file: ready-sts.yaml
- assert:
file: ready-svc.yaml
file: ready-svc.yaml
catch:
- description: Redis Operator Logs
podLogs:
namespace: redis-operator-system
selector: control-plane=redis-operator
container: manager
tail: -1 # tail all logs

0 comments on commit a521613

Please sign in to comment.