diff --git a/.github/workflows/test-haproxy-ingress.yml b/.github/workflows/test-haproxy-ingress.yml index 70eea06..fe5bb59 100644 --- a/.github/workflows/test-haproxy-ingress.yml +++ b/.github/workflows/test-haproxy-ingress.yml @@ -143,32 +143,48 @@ jobs: for ((i=1; i<=MAX_RETRIES; i++)); do echo "Attempt $i of $MAX_RETRIES for $url" + echo "Headers being sent: $headers" + if [ -n "$headers" ]; then - RESP_CODE=$(curl -s -o /dev/null -w "%{http_code}" $headers "$url") + echo "Full curl command: curl -v $headers \"$url\"" + RESP=$(curl -v $headers "$url" 2>&1) + RESP_CODE=$(echo "$RESP" | grep "< HTTP" | awk '{print $3}') else - RESP_CODE=$(curl -s -o /dev/null -w "%{http_code}" "$url") + echo "Full curl command: curl -v \"$url\"" + RESP=$(curl -v "$url" 2>&1) + RESP_CODE=$(echo "$RESP" | grep "< HTTP" | awk '{print $3}') fi + + echo -e "\nšŸ” Response Details:" + echo "------------------------" echo "Response code: $RESP_CODE" + echo -e "\nšŸ“‹ Response Headers:" + echo "$RESP" | grep -E "^< " || echo "No headers found" + echo -e "\nšŸ“ Response Body:" + echo "$RESP" | sed -n '/^* Connected/,/^* Connection/!p' | grep -v "^[*<>]" || echo "No body found" + echo "------------------------" if [ "$RESP_CODE" -eq "$expected_code" ]; then + echo "āœ… Expected response code $expected_code received" return 0 fi if [ "$i" -lt "$MAX_RETRIES" ]; then - echo "Waiting ${RETRY_DELAY}s before next attempt..." + echo "ā³ Waiting ${RETRY_DELAY}s before next attempt..." sleep "$RETRY_DELAY" fi done + echo "āŒ Failed to get expected response code $expected_code after $MAX_RETRIES attempts" return 1 } - echo "Testing frontend endpoint..." + echo "šŸŒ Testing frontend endpoint..." test_endpoint "http://$INGRESS_IP/" 200 || exit 1 - echo "Testing backend endpoint..." + echo "šŸ”Œ Testing backend endpoint..." test_endpoint "http://$INGRESS_IP/v2/docs/" 200 || exit 1 - echo "Testing websocket endpoint..." + echo "šŸ”„ Testing websocket endpoint..." test_endpoint "http://$INGRESS_IP/websocket/" 101 "-H 'Upgrade: websocket' -H 'Connection: Upgrade'" || \ test_endpoint "http://$INGRESS_IP/websocket/" 400 "-H 'Upgrade: websocket' -H 'Connection: Upgrade'" || exit 1 diff --git a/.github/workflows/test-nginx-ingress.yml b/.github/workflows/test-nginx-ingress.yml index 1023127..f78f45c 100644 --- a/.github/workflows/test-nginx-ingress.yml +++ b/.github/workflows/test-nginx-ingress.yml @@ -112,12 +112,19 @@ jobs: run: | helm install keep ./charts/keep -f debug/nginx-values.yaml - - name: Wait for the backend pod + - name: Wait for all pods run: | - kubectl wait --namespace default \ - --for=condition=ready pod \ - --selector=app.kubernetes.io/instance=keep,keep-component=backend \ - --timeout=90s + echo "Waiting for all pods to be ready..." + kubectl wait --for=condition=ready pod --all -n default --timeout=180s + + echo "Checking pod status..." + kubectl get pods -n default + + echo "Checking ingress status..." + kubectl get ingress -n default + + echo "Waiting additional 30s for services to stabilize..." + sleep 30 - name: Debug - Show resources if: ${{ inputs.debug_enabled }}