feat: add E2E tests with mock Nginx services, update Traefik routing to use service names, and integrate testing into the CI workflow.
All checks were successful
Remote Deployment Pipeline / Prepare Context (pull_request) Successful in 3s
Remote Deployment Pipeline / Deploy (Staging) (pull_request) Has been skipped
Remote Deployment Pipeline / Deploy (Dev/Preview) (pull_request) Successful in 1m15s
Remote Deployment Pipeline / Cleanup Preview (pull_request) Has been skipped
Remote Deployment Pipeline / Deploy (Production) (pull_request) Has been skipped

This commit is contained in:
2025-12-25 18:43:56 +01:00
parent 0792a6c2a8
commit 1942672240
12 changed files with 416 additions and 2 deletions

37
tests/regression.sh Executable file
View File

@@ -0,0 +1,37 @@
#!/bin/bash
set -e
# Configuration
DOMAIN=${DOMAIN:-dev.kovagoadi.hu}
# Configuration
DOMAIN=${DOMAIN:-dev.kovagoadi.hu}
PORT=${PORT:-898}
# We target localhost directly to test the local instance, bypassing public DNS
TARGET_URL="http://127.0.0.1:${PORT}"
HOST_HEADER="test-whoami.${DOMAIN}"
echo "Running regression tests against ${TARGET_URL} with Host: ${HOST_HEADER}..."
# Test 1: Check if whoami service is reachable and returns 200 OK
echo "Test 1: Checking connectivity to whoami service..."
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" -H "Host: ${HOST_HEADER}" "${TARGET_URL}")
if [ "$HTTP_CODE" -eq 200 ]; then
echo " [PASS] Service returned 200 OK"
else
echo " [FAIL] Service returned $HTTP_CODE (Expected 200)"
exit 1
fi
# Test 2: Check for specific content (whoami usually returns "Hostname: ...")
echo "Test 2: Checking content..."
CONTENT=$(curl -s -H "Host: ${HOST_HEADER}" "${TARGET_URL}")
if echo "$CONTENT" | grep -q "Hostname:"; then
echo " [PASS] Content contains 'Hostname:'"
else
echo " [FAIL] Content does not look like whoami output"
echo " Output: $CONTENT"
exit 1
fi
echo "All regression tests passed!"