test: add integration test suite + canary deployment script
Integration tests: - internal/serviceadapter/integration_test.go (8 test cases) - Tests real gateway: health, routing, 404s, auth flow - Configurable via GATEWAY_URL, TEST_JWT_TOKEN, SKIP_AUTH_TESTS Canary deployment script: - scripts/test-canary.sh: scale→1, test, scale→N on pass - Keeps 1 pod for debugging on test failure - Supports custom NAMESPACE, DEPLOYMENT, REPLICAS Usage: - Local: ./scripts/test-integration.sh - Production: GATEWAY_URL=https://api.riotpiao.com ./scripts/test-integration.sh - Canary: ./scripts/test-canary.sh Added INTEGRATION_TESTS.md with full documentation.
This commit is contained in:
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
# Run integration tests against real gateway
|
||||
# Usage:
|
||||
# ./scripts/test-integration.sh # Test local gateway
|
||||
# GATEWAY_URL=https://api.riotpiao.com ./scripts/test-integration.sh # Test production
|
||||
|
||||
set -e
|
||||
|
||||
GATEWAY_URL=${GATEWAY_URL:-http://localhost:8080}
|
||||
SKIP_AUTH_TESTS=${SKIP_AUTH_TESTS:-true}
|
||||
TEST_TIMEOUT=${TEST_TIMEOUT:-10}
|
||||
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
echo "Integration Tests"
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
echo "Gateway URL: $GATEWAY_URL"
|
||||
echo "Skip Auth Tests: $SKIP_AUTH_TESTS"
|
||||
echo "Timeout: ${TEST_TIMEOUT}s"
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
|
||||
export GATEWAY_URL
|
||||
export SKIP_AUTH_TESTS
|
||||
export TEST_TIMEOUT
|
||||
|
||||
go test -tags integration -v ./internal/serviceadapter -run TestIntegration
|
||||
Reference in New Issue
Block a user