Skip to content

Commit

Permalink
seperate e2e test from pods booting up
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam0Brien committed Nov 20, 2024
1 parent 4b23da4 commit 4d7176a
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 19 deletions.
40 changes: 22 additions & 18 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,6 @@ jobs:

- name: Monitor Pods in Kind
run: |
for i in {1..300}; do
STATUS=$(kubectl get pods --selector=job-name=e2e-inventory-http-tests -o jsonpath='{.items[0].status.phase}')
if [ "$STATUS" = "Succeeded" ]; then
echo "Test pod completed successfully."
exit 0
elif [ "$STATUS" = "Failed" ]; then
echo "Test pod failed."
TEST_POD=$(kubectl get pods --selector=job-name=e2e-inventory-http-tests -o jsonpath='{.items[0].metadata.name}')
kubectl logs $TEST_POD
kubectl get pods
exit 1
fi
sleep 1
done
echo "Timeout reached while waiting for the test pod to complete."
exit 1
for i in {1..300}; do
MIGRATE_STATUS=$(kubectl get pods -l job-name=spicedb-cr-migrate -o jsonpath='{.items[0].status.phase}')
if [ "$MIGRATE_STATUS" = "Completed" ]; then
Expand Down Expand Up @@ -63,6 +45,28 @@ jobs:
exit 1

- name: Inventory Tests
run: |
make inventory-e2e-apply
for i in {1..300}; do
STATUS=$(kubectl get pods --selector=job-name=e2e-inventory-http-tests -o jsonpath='{.items[0].status.phase}')
if [ "$STATUS" = "Succeeded" ]; then
echo "Test pod completed successfully."
exit 0
elif [ "$STATUS" = "Failed" ]; then
echo "Test pod failed."
TEST_POD=$(kubectl get pods --selector=job-name=e2e-inventory-http-tests -o jsonpath='{.items[0].metadata.name}')
kubectl logs $TEST_POD
kubectl get pods
exit 1
fi
sleep 1
done
echo "Timeout reached while waiting for the test pod to complete."
exit 1
- name: View Test Pod Logs
run: |
TEST_POD=$(kubectl get pods --selector=job-name=e2e-inventory-http-tests -o jsonpath='{.items[0].metadata.name}')
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ inventory-up-kafka:
inventory-up-kind:
./scripts/start-inventory-kind.sh

.PHONY: inventory-e2e-apply
inventory-up-kind:
./scripts/apply-e2e.sh

.PHONY: get-token
get-token:
./scripts/get-token.sh
Expand Down
6 changes: 6 additions & 0 deletions scripts/apply-e2e.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
set -e

kubectl apply -f deploy/kind/e2e/e2e-batch.yaml


2 changes: 1 addition & 1 deletion scripts/start-inventory-kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,5 @@ kubectl apply -f deploy/kind/relations/spicedb-kind-setup/relations-api/secret.y
kubectl apply -f deploy/kind/relations/spicedb-kind-setup/relations-api/deployment.yaml
kubectl apply -f deploy/kind/relations/spicedb-kind-setup/relations-api/svc.yaml

kubectl apply -f deploy/kind/e2e/e2e-batch.yaml
#kubectl apply -f deploy/kind/e2e/e2e-batch.yaml
echo "Setup complete."

0 comments on commit 4d7176a

Please sign in to comment.