Skip to content

Commit

Permalink
test(e2e): catch log when test err
Browse files Browse the repository at this point in the history
  • Loading branch information
whg517 committed Dec 31, 2024
1 parent eb3fb5a commit 7f634c9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ chainsaw-setup: ## Run the chainsaw setup
.PHONY: chainsaw-test
chainsaw-test: chainsaw ## Run the chainsaw test
KUBECONFIG=$(KIND_KUBECONFIG) $(CHAINSAW) test --cluster cluster-1=$(KIND_KUBECONFIG) --test-dir ./test/e2e/
KUBECONFIG=$(KIND_KUBECONFIG) kubectl logs -n $(TEST_NAMESPACE) -l "app.kubernetes.io/name=secret-operator"

.PHONY: chainsaw-cleanup
chainsaw-cleanup: ## Run the chainsaw cleanup
Expand Down
8 changes: 8 additions & 0 deletions test/e2e/krb5/chainsaw-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,11 @@ spec:
file: pod-scope.yaml
- assert:
file: pod-scope-assert.yaml
- catch:
- script:
env:
- name: NAMESPACE
value: ($namespace)
content: |
kubectl -n "$NAMESPACE" get pod
kubectl -n "$NAMESPACE" describe pod
8 changes: 8 additions & 0 deletions test/e2e/tls/chainsaw-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,11 @@ spec:
fi
check:
($error == null): true
- catch:
- script:
env:
- name: NAMESPACE
value: ($namespace)
content: |
kubectl -n "$NAMESPACE" get pod
kubectl -n "$NAMESPACE" describe pod

0 comments on commit 7f634c9

Please sign in to comment.