Skip to content

fix: resolve eslint CI failure - remove conflicting configs, add miss… #15

fix: resolve eslint CI failure - remove conflicting configs, add miss…

fix: resolve eslint CI failure - remove conflicting configs, add miss… #15

name: Integration Tests
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- main
paths:
- 'quantara/web_app/**'
- 'quantara/frontend/**'
- 'devops/**'
pull_request:
branches:
- main
paths:
- 'quantara/web_app/**'
- 'quantara/frontend/**'
- 'devops/**'
jobs:
integration-tests:
runs-on: ubuntu-latest
permissions:
contents: read
env:
STELLAR_HORIZON_URL: https://horizon-testnet.stellar.org
STELLAR_SOROBAN_RPC_URL: https://soroban-testnet.stellar.org
DB_USER: postgres
DB_PASSWORD: password
DB_NAME: quantara
DB_HOST: db
DB_PORT: 5432
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Create .env file
run: |
cat << EOF > .env
ENV_VERSION=DEV
STELLAR_HORIZON_URL=${{ env.STELLAR_HORIZON_URL }}
STELLAR_SOROBAN_RPC_URL=${{ env.STELLAR_SOROBAN_RPC_URL }}
STELLAR_NETWORK_PASSPHRASE=Test SDF Network ; September 2015
DB_USER=${{ env.DB_USER }}
DB_PASSWORD=${{ env.DB_PASSWORD }}
DB_NAME=${{ env.DB_NAME }}
DB_HOST=${{ env.DB_HOST }}
DB_PORT=${{ env.DB_PORT }}
EOF
- name: Build and Start Containers
run: |
docker compose -f devops/docker-compose.quantara.dev.yaml --env-file .env up -d --build
- name: Wait for Backend Service
timeout-minutes: 5
run: |
echo "Waiting for backend to become healthy..."
for i in $(seq 1 60); do
if curl -sf http://localhost:8000/health > /dev/null 2>&1; then
echo "Backend is healthy after $((i * 2))s"
break
fi
if ! docker ps --format '{{.Names}}' | grep -q backend_dev; then
echo "ERROR: backend container stopped!"
docker compose -f devops/docker-compose.quantara.dev.yaml logs backend || true
exit 1
fi
sleep 2
done
# Verify backend is responding
if ! curl -sf http://localhost:8000/health > /dev/null 2>&1; then
echo "ERROR: Backend did not become healthy within 120s!"
docker compose -f devops/docker-compose.quantara.dev.yaml logs backend || true
exit 1
fi
- name: Apply Migrations
run: |
docker compose -f devops/docker-compose.quantara.dev.yaml exec -T backend poetry run alembic -c web_app/alembic.ini upgrade head || {
echo "Migration failed. Showing backend logs:"
docker compose -f devops/docker-compose.quantara.dev.yaml logs backend || true
exit 1
}
- name: Run Integration Tests
run: |
docker compose -f devops/docker-compose.quantara.dev.yaml exec -T backend poetry run pytest web_app/test_integration/ -v --tb=short
- name: Clean Up
if: always()
run: |
docker compose -f devops/docker-compose.quantara.dev.yaml logs > docker-logs.txt || true
docker compose -f devops/docker-compose.quantara.dev.yaml down -v
- name: Upload Docker Logs on Failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: docker-logs
path: docker-logs.txt