Fix #634: Handle Gemini Deprecation #1703
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | |
| on: | |
| pull_request: | |
| paths: | |
| - 'packages/app/control/**' | |
| - 'packages/app/server/**' | |
| - 'packages/sdk/react/**' | |
| - 'packages/sdk/next/**' | |
| - 'packages/sdk/ts/**' | |
| - 'packages/tests/integration/**' | |
| - '.github/workflows/**' | |
| - 'pnpm-lock.yaml' | |
| - 'package.json' | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'packages/app/control/**' | |
| - 'packages/app/server/**' | |
| - 'packages/sdk/react/**' | |
| - 'packages/sdk/ts/**' | |
| - 'packages/tests/integration/**' | |
| - '.github/workflows/**' | |
| jobs: | |
| integration-tests: | |
| name: Run Integration Tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| env: | |
| # Database Configuration | |
| DATABASE_URL: postgresql://test:test@localhost:5433/echo_integration_test | |
| # Service URLs | |
| ECHO_CONTROL_URL: http://localhost:3001 | |
| ECHO_DATA_SERVER_URL: http://localhost:3069 | |
| # Authentication Secrets | |
| JWT_SECRET: ${{ secrets.TEST_JWT_SECRET }} | |
| JWT_ISSUER: http://localhost:3001 | |
| JWT_AUDIENCE: echo-proxy | |
| # Auth.js Configuration | |
| AUTH_SECRET: ${{ secrets.TEST_AUTH_SECRET }} | |
| # Integration Test JWTs | |
| INTEGRATION_TEST_JWT: ${{ secrets.INTEGRATION_TEST_JWT }} | |
| INTEGRATION_TEST_JWT_USER_2: ${{ secrets.INTEGRATION_TEST_JWT_USER_2 }} | |
| # API Keys for Echo Server | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| # CDP Configuration | |
| CDP_API_KEY_ID: ${{ secrets.CDP_API_KEY_ID }} | |
| CDP_API_KEY_SECRET: ${{ secrets.CDP_API_KEY_SECRET }} | |
| CDP_WALLET_SECRET: ${{ secrets.CDP_WALLET_SECRET }} | |
| # Facilitator Configuration | |
| PROXY_FACILITATOR_URL: ${{ secrets.PROXY_FACILITATOR_URL }} | |
| # OAuth Configuration (short expiry for fast integration tests) | |
| OAUTH_REFRESH_TOKEN_EXPIRY_SECONDS: 5 | |
| OAUTH_ACCESS_TOKEN_EXPIRY_SECONDS: 5 | |
| # Environment Flags | |
| CI: true | |
| NODE_ENV: test | |
| INTEGRATION_TEST_MODE: true | |
| NEXT_PUBLIC_ECHO_APP_ID: 74d9c979-e036-4e43-904f-32d214b361fc | |
| # Optional Stripe Configuration | |
| STRIPE_SECRET_KEY: ${{ secrets.TEST_STRIPE_SECRET_KEY }} | |
| STRIPE_PUBLISHABLE_KEY: ${{ secrets.TEST_STRIPE_PUBLISHABLE_KEY }} | |
| STRIPE_WEBHOOK_SECRET: ${{ secrets.TEST_STRIPE_WEBHOOK_SECRET }} | |
| # Test Configuration | |
| HEADLESS: true | |
| LOG_LEVEL: error | |
| services: | |
| postgres: | |
| image: postgres:15-alpine | |
| env: | |
| POSTGRES_DB: echo_integration_test | |
| POSTGRES_USER: test | |
| POSTGRES_PASSWORD: test | |
| ports: | |
| - 5433:5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| run: npm install -g pnpm | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'pnpm' | |
| - name: Install workspace dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run all workspace unit tests | |
| run: | | |
| echo "🧪 Running all workspace unit tests..." | |
| pnpm run test:unit | |
| echo "✅ All workspace unit tests passed" | |
| - name: Create integration test environment file | |
| working-directory: packages/tests/integration | |
| run: | | |
| cat > .env.test << EOF | |
| # Database Configuration | |
| DATABASE_URL=postgresql://test:test@localhost:5433/echo_integration_test | |
| # Service URLs | |
| ECHO_CONTROL_URL=http://localhost:3001 | |
| ECHO_DATA_SERVER_URL=http://localhost:3069 | |
| # Authentication Secrets | |
| JWT_SECRET=${{ secrets.TEST_JWT_SECRET }} | |
| JWT_ISSUER=http://localhost:3001 | |
| JWT_AUDIENCE=echo-proxy | |
| # Auth.js Configuration | |
| AUTH_SECRET=${{ secrets.TEST_AUTH_SECRET }} | |
| # Integration Test JWTs | |
| INTEGRATION_TEST_JWT=${{ secrets.INTEGRATION_TEST_JWT }} | |
| INTEGRATION_TEST_JWT_USER_2=${{ secrets.INTEGRATION_TEST_JWT_USER_2 }} | |
| # Next.js Configuration | |
| NEXT_PUBLIC_ECHO_APP_ID=74d9c979-e036-4e43-904f-32d214b361fc | |
| # API Keys for Echo Server | |
| OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} | |
| ANTHROPIC_API_KEY=${{ secrets.ANTHROPIC_API_KEY }} | |
| # CDP Configuration | |
| CDP_API_KEY_ID=${{ secrets.CDP_API_KEY_ID }} | |
| CDP_API_KEY_SECRET=${{ secrets.CDP_API_KEY_SECRET }} | |
| CDP_WALLET_SECRET=${{ secrets.CDP_WALLET_SECRET }} | |
| WALLET_OWNER="integration-test-owner" | |
| # Facilitator Configuration | |
| PROXY_FACILITATOR_URL=${{ secrets.PROXY_FACILITATOR_URL }} | |
| # OAuth Configuration | |
| OAUTH_REFRESH_TOKEN_EXPIRY_SECONDS=5 | |
| OAUTH_ACCESS_TOKEN_EXPIRY_SECONDS=5 | |
| # Environment Flags | |
| CI=true | |
| NODE_ENV=test | |
| INTEGRATION_TEST_MODE=true | |
| # Optional Stripe Configuration | |
| STRIPE_SECRET_KEY=${{ secrets.TEST_STRIPE_SECRET_KEY }} | |
| STRIPE_PUBLISHABLE_KEY=${{ secrets.TEST_STRIPE_PUBLISHABLE_KEY }} | |
| STRIPE_WEBHOOK_SECRET=${{ secrets.TEST_STRIPE_WEBHOOK_SECRET }} | |
| # Test Configuration | |
| HEADLESS=true | |
| LOG_LEVEL=error | |
| EOF | |
| - name: Wait for PostgreSQL to be ready | |
| run: | | |
| timeout 30 bash -c 'until pg_isready -h localhost -p 5433 -U test -d echo_integration_test; do | |
| echo "Waiting for PostgreSQL..." | |
| sleep 2 | |
| done' | |
| - name: Setup Prisma schema | |
| working-directory: packages/app/control | |
| run: pnpm prisma:generate | |
| - name: Run database migrations and seed data | |
| working-directory: packages/app/control | |
| run: | | |
| echo "🗃️ Running database migrations..." | |
| pnpm prisma:migrate-deploy | |
| echo "🌱 Seeding integration test database..." | |
| cd ../../tests/integration | |
| pnpm db:seed | |
| - name: Build and start echo-control | |
| working-directory: packages/app/control | |
| run: | | |
| echo "🚀 Building echo-control..." | |
| INTEGRATION_TEST_MODE=true pnpm build | |
| echo "🚀 Starting echo-control on port 3001..." | |
| PORT=3001 \ | |
| NODE_ENV=test \ | |
| DATABASE_URL="${DATABASE_URL}" \ | |
| JWT_SECRET="${JWT_SECRET}" \ | |
| JWT_ISSUER="${JWT_ISSUER}" \ | |
| JWT_AUDIENCE="${JWT_AUDIENCE}" \ | |
| INTEGRATION_TEST_MODE=true \ | |
| OAUTH_REFRESH_TOKEN_EXPIRY_SECONDS="${OAUTH_REFRESH_TOKEN_EXPIRY_SECONDS}" \ | |
| OAUTH_ACCESS_TOKEN_EXPIRY_SECONDS="${OAUTH_ACCESS_TOKEN_EXPIRY_SECONDS}" \ | |
| nohup pnpm start > /tmp/echo-control.log 2>&1 & | |
| echo $! > /tmp/echo-control.pid | |
| echo "✅ Started echo-control (PID: $(cat /tmp/echo-control.pid))" | |
| echo "⏳ Waiting for echo-control health check..." | |
| timeout 60 bash -c 'until curl -f http://localhost:3001/api/health >/dev/null 2>&1; do sleep 2; done' || { | |
| echo "❌ echo-control failed to start" | |
| echo "📋 Logs:" | |
| cat /tmp/echo-control.log | |
| exit 1 | |
| } | |
| echo "✅ echo-control is healthy" | |
| - name: Build and start echo-data-server | |
| working-directory: packages/app/server | |
| run: | | |
| echo "🚀 Building echo-data-server..." | |
| pnpm build | |
| echo "🚀 Starting echo-data-server on port 3069..." | |
| DATABASE_URL="${DATABASE_URL}" \ | |
| NODE_ENV=test \ | |
| PORT=3069 \ | |
| PROXY_FACILITATOR_URL="${PROXY_FACILITATOR_URL}" \ | |
| OPENAI_API_KEY="${OPENAI_API_KEY}" \ | |
| ANTHROPIC_API_KEY="${ANTHROPIC_API_KEY}" \ | |
| CDP_API_KEY_ID="${CDP_API_KEY_ID}" \ | |
| CDP_API_KEY_SECRET="${CDP_API_KEY_SECRET}" \ | |
| CDP_WALLET_SECRET="${CDP_WALLET_SECRET}" \ | |
| WALLET_OWNER="integration-test-owner" \ | |
| nohup pnpm start > /tmp/echo-data-server.log 2>&1 & | |
| echo $! > /tmp/echo-data-server.pid | |
| echo "✅ Started echo-data-server (PID: $(cat /tmp/echo-data-server.pid))" | |
| echo "⏳ Waiting for echo-data-server health check..." | |
| timeout 60 bash -c 'until curl -f http://localhost:3069/health >/dev/null 2>&1; do sleep 2; done' || { | |
| echo "❌ echo-data-server failed to start" | |
| echo "📋 Logs:" | |
| cat /tmp/echo-data-server.log | |
| exit 1 | |
| } | |
| echo "✅ echo-data-server is healthy" | |
| - name: Run integration tests | |
| working-directory: packages/tests/integration | |
| run: | | |
| echo "🧪 Running Echo Data Server Tests..." | |
| pnpm test:echo-data-server | |
| echo "🧪 Running OAuth Protocol Tests..." | |
| pnpm test:oauth-protocol | |
| # TODO: Re-enable echo-server integration tests when properly configured | |
| # - name: Run Echo Server Integration Tests | |
| # run: cd echo-server && pnpm run test:integration | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: integration-test-results | |
| path: | | |
| packages/tests/integration/test-results/ | |
| packages/tests/integration/coverage/ | |
| retention-days: 30 | |
| - name: Show server logs on failure | |
| if: failure() | |
| run: | | |
| echo "📋 Echo Control Logs:" | |
| cat /tmp/echo-control.log 2>/dev/null || echo "No echo-control logs found" | |
| echo "" | |
| echo "📋 Echo Data Server Logs:" | |
| cat /tmp/echo-data-server.log 2>/dev/null || echo "No echo-data-server logs found" | |
| - name: Cleanup integration environment | |
| if: always() | |
| run: | | |
| echo "🧹 Stopping background processes..." | |
| if [ -f /tmp/echo-control.pid ]; then | |
| PID=$(cat /tmp/echo-control.pid) | |
| kill $PID 2>/dev/null || true | |
| kill -9 $PID 2>/dev/null || true | |
| fi | |
| if [ -f /tmp/echo-data-server.pid ]; then | |
| PID=$(cat /tmp/echo-data-server.pid) | |
| kill $PID 2>/dev/null || true | |
| kill -9 $PID 2>/dev/null || true | |
| fi | |
| pkill -f "PORT=3001.*pnpm start" || true | |
| pkill -f "PORT=3069.*pnpm start" || true | |
| rm -f /tmp/echo-control.pid /tmp/echo-data-server.pid | |
| rm -f /tmp/echo-control.log /tmp/echo-data-server.log | |
| echo "✅ Cleanup complete" | |
| e2e-tests: | |
| name: End-to-End Tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| needs: integration-tests | |
| if: github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'run-e2e') | |
| env: | |
| # Database Configuration | |
| DATABASE_URL: postgresql://test:test@postgres-test:5432/echo_integration_test | |
| # Service URLs | |
| ECHO_CONTROL_URL: http://echo-control-test:3000 | |
| ECHO_DATA_SERVER_URL: http://echo-data-server-test:3069 | |
| # Authentication Secrets | |
| JWT_SECRET: ${{ secrets.TEST_JWT_SECRET }} | |
| JWT_ISSUER: http://echo-control-test:3000 | |
| JWT_AUDIENCE: echo-proxy | |
| # Auth.js Configuration | |
| AUTH_SECRET: ${{ secrets.TEST_AUTH_SECRET }} | |
| # Integration Test JWTs | |
| INTEGRATION_TEST_JWT: ${{ secrets.INTEGRATION_TEST_JWT }} | |
| INTEGRATION_TEST_JWT_USER_2: ${{ secrets.INTEGRATION_TEST_JWT_USER_2 }} | |
| # API Keys for Echo Server | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| # CDP Configuration | |
| CDP_API_KEY_ID: ${{ secrets.CDP_API_KEY_ID }} | |
| CDP_API_KEY_SECRET: ${{ secrets.CDP_API_KEY_SECRET }} | |
| CDP_WALLET_SECRET: ${{ secrets.CDP_WALLET_SECRET }} | |
| # Facilitator Configuration | |
| PROXY_FACILITATOR_URL: ${{ secrets.PROXY_FACILITATOR_URL }} | |
| # OAuth Configuration | |
| OAUTH_REFRESH_TOKEN_EXPIRY_SECONDS: 2592000 | |
| OAUTH_ACCESS_TOKEN_EXPIRY_SECONDS: 86400 | |
| # Environment Flags | |
| CI: true | |
| NODE_ENV: test | |
| INTEGRATION_TEST_MODE: true | |
| # Optional Stripe Configuration | |
| STRIPE_SECRET_KEY: ${{ secrets.TEST_STRIPE_SECRET_KEY }} | |
| STRIPE_PUBLISHABLE_KEY: ${{ secrets.TEST_STRIPE_PUBLISHABLE_KEY }} | |
| STRIPE_WEBHOOK_SECRET: ${{ secrets.TEST_STRIPE_WEBHOOK_SECRET }} | |
| NEXT_PUBLIC_ECHO_APP_ID: 74d9c979-e036-4e43-904f-32d214b361fc | |
| # Test Configuration | |
| HEADLESS: true | |
| LOG_LEVEL: error | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| run: npm install -g pnpm | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'pnpm' | |
| - name: Install workspace dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Install Playwright browsers | |
| working-directory: packages/tests/integration | |
| run: npx playwright install --with-deps | |
| - name: Create environment file for E2E tests | |
| working-directory: packages/tests/integration | |
| run: | | |
| cat > .env.test << EOF | |
| DATABASE_URL=postgresql://test:test@postgres-test:5432/echo_integration_test | |
| ECHO_CONTROL_URL=http://echo-control-test:3000 | |
| ECHO_DATA_SERVER_URL=http://echo-data-server-test:3069 | |
| JWT_SECRET=${{ secrets.TEST_JWT_SECRET }} | |
| INTEGRATION_TEST_JWT=${{ secrets.INTEGRATION_TEST_JWT }} | |
| OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} | |
| ANTHROPIC_API_KEY=${{ secrets.ANTHROPIC_API_KEY }} | |
| CDP_API_KEY_ID=${{ secrets.CDP_API_KEY_ID }} | |
| CDP_API_KEY_SECRET=${{ secrets.CDP_API_KEY_SECRET }} | |
| CDP_WALLET_SECRET=${{ secrets.CDP_WALLET_SECRET }} | |
| PROXY_FACILITATOR_URL=${{ secrets.PROXY_FACILITATOR_URL }} | |
| OAUTH_REFRESH_TOKEN_EXPIRY_SECONDS=2592000 | |
| CI=true | |
| NODE_ENV=test | |
| HEADLESS=true | |
| AUTH_SECRET: ${{ secrets.TEST_AUTH_SECRET }} | |
| EOF | |
| - name: Create Docker environment overrides | |
| working-directory: packages/tests/integration/docker | |
| run: | | |
| cat > .env.docker << EOF | |
| DATABASE_URL=postgresql://test:test@postgres-test:5432/echo_integration_test | |
| ECHO_CONTROL_URL=http://echo-control-test:3000 | |
| ECHO_DATA_SERVER_URL=http://echo-data-server-test:3069 | |
| EOF | |
| - name: Start Docker services for E2E tests | |
| working-directory: packages/tests/integration | |
| run: | | |
| docker-compose -f docker/docker-compose.yml up -d | |
| echo "Waiting for services to be healthy..." | |
| timeout 300 bash -c 'until docker-compose -f docker/docker-compose.yml ps | grep -E "(healthy|Up).*echo-control-test" && docker-compose -f docker/docker-compose.yml ps | grep -E "(healthy|Up).*echo-data-server-test"; do | |
| echo "Still waiting for services..." | |
| sleep 10 | |
| done' | |
| - name: Run E2E tests | |
| working-directory: packages/tests/integration | |
| run: pnpm test:e2e | |
| - name: Upload Playwright report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-report | |
| path: packages/tests/integration/playwright-report/ | |
| retention-days: 30 | |
| - name: Cleanup Docker services | |
| if: always() | |
| working-directory: packages/tests/integration | |
| run: docker-compose -f docker/docker-compose.yml down -v |