@@ -78,16 +78,22 @@ jobs:
7878
7979 - name : Set up test environment
8080 run : |
81- # Set environment variables for the application
81+ # Set the environment variable to use the integration test configuration
82+ echo "ENVIRONMENT=integrate_test" >> $GITHUB_ENV
83+
84+ # Load configuration from .env.integrate_test file
85+ if [ -f .env.integrate_test ]; then
86+ while IFS= read -r line; do
87+ # Skip comments and empty lines
88+ if [[ $line =~ ^[^#]*= ]]; then
89+ echo "$line" >> $GITHUB_ENV
90+ fi
91+ done < .env.integrate_test
92+ fi
93+
94+ # Override specific variables for GitHub Actions environment
8295 echo "DATABASE_URL=postgresql://postgres:password@localhost:5432/container_engine_test" >> $GITHUB_ENV
8396 echo "REDIS_URL=redis://localhost:6379" >> $GITHUB_ENV
84- echo "PORT=3000" >> $GITHUB_ENV
85- echo "JWT_SECRET=test-jwt-secret-key-for-github-actions" >> $GITHUB_ENV
86- echo "JWT_EXPIRES_IN=3600" >> $GITHUB_ENV
87- echo "API_KEY_PREFIX=ce_test_" >> $GITHUB_ENV
88- echo "KUBERNETES_NAMESPACE=test" >> $GITHUB_ENV
89- echo "DOMAIN_SUFFIX=test.local" >> $GITHUB_ENV
90- echo "RUST_LOG=container_engine=info,tower_http=info" >> $GITHUB_ENV
9197
9298 - name : Run database migrations
9399 run : |
98104 cargo run &
99105 echo $! > server.pid
100106
101- # Wait for server to be ready
102- timeout 60 bash -c 'until curl -f http://localhost:3000 /health; do sleep 2; done'
107+ # Wait for server to be ready (using port 3001 for integration tests)
108+ timeout 60 bash -c 'until curl -f http://localhost:3001 /health; do sleep 2; done'
103109
104110 - name : Run integration tests
105111 run : |
0 commit comments