Skip to content

Commit

Permalink
Make gitops-to-app test observable (#689)
Browse files Browse the repository at this point in the history
  • Loading branch information
waciumawanjohi authored Mar 3, 2022
1 parent 8941486 commit 842f62d
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion hack/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ test_gitops() {
setup_source_to_gitops
test_source_to_gitops
setup_gitops_to_app
test_example_sc "gitwriter-sc"
test_gitops_to_app
teardown_gitops_example
}

Expand Down Expand Up @@ -674,6 +674,32 @@ setup_gitops_to_app() {
kapp deploy --yes -a example-deliver -f-
}

test_gitops_to_app() {
log "testing gitops-to-app"

for _ in {1..5}; do
for sleep_duration in {15..1}; do
local deployed_pods
deployed_pods=$(kubectl get pods \
-l "serving.knative.dev/configuration=gitwriter-sc" \
-o name)

if [[ "$deployed_pods" == *"gitwriter-sc"* ]]; then
log "testing '$test_name' SUCCEEDED! sweet"
return 0
fi

echo "- waiting $sleep_duration seconds"
sleep "$sleep_duration"
done

kubectl tree deliverable gitops
done

log "testing gitops-to-app FAILED :("
exit 1
}

delete_containers() {
docker rm -f $REGISTRY_CONTAINER_NAME || true
docker rm -f $KUBERNETES_CONTAINER_NAME || true
Expand Down

0 comments on commit 842f62d

Please sign in to comment.