test: real integration tests for X-Service adapter routing
Tests that verify actual service operations: - SQS send-message routing - S3 list-objects with JWT pass-through - Memory query routing - IAM with JWT - Authorization header pass-through to services Tests gracefully skip if services unreachable (expected behavior). Tests get real JWT from Authentik if credentials provided. Run: GATEWAY_URL=http://localhost:8080 ./scripts/test-integration.sh Or: GATEWAY_URL=https://api.riotpiao.com \ AUTHENTIK_CLIENT_ID=xxx AUTHENTIK_CLIENT_SECRET=yyy \ ./scripts/test-integration.sh
This commit is contained in:
@@ -1,25 +1,15 @@
|
||||
#!/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
|
||||
# Real integration tests - call actual services
|
||||
# Usage: GATEWAY_URL=https://api.riotpiao.com \
|
||||
# AUTHENTIK_CLIENT_ID=xxx AUTHENTIK_CLIENT_SECRET=yyy \
|
||||
# ./scripts/test-integration.sh
|
||||
|
||||
set -e
|
||||
|
||||
GATEWAY_URL=${GATEWAY_URL:-http://localhost:8080}
|
||||
SKIP_AUTH_TESTS=${SKIP_AUTH_TESTS:-true}
|
||||
TEST_TIMEOUT=${TEST_TIMEOUT:-10}
|
||||
AUTHENTIK_URL=${AUTHENTIK_URL:-https://authentik.riotpiao.com}
|
||||
TEST_TIMEOUT=${TEST_TIMEOUT:-30}
|
||||
|
||||
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 AUTHENTIK_URL AUTHENTIK_CLIENT_ID AUTHENTIK_CLIENT_SECRET TEST_TIMEOUT
|
||||
|
||||
export GATEWAY_URL
|
||||
export SKIP_AUTH_TESTS
|
||||
export TEST_TIMEOUT
|
||||
|
||||
go test -tags integration -v ./internal/serviceadapter -run TestIntegration
|
||||
go test -tags integration -v ./internal/serviceadapter -run TestRealIntegration
|
||||
|
||||
Reference in New Issue
Block a user