JSDoc all the things #19
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: Integration Tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| integration-tests: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Type check | |
| run: bun run typecheck | |
| - name: Build | |
| run: bun run build | |
| - name: Start Appwrite | |
| run: docker compose -f tests/docker-compose.yml --env-file tests/.env up -d | |
| - name: Wait for Appwrite | |
| run: | | |
| echo "Waiting for Appwrite to be ready..." | |
| for i in $(seq 1 60); do | |
| if curl -sf http://localhost/v1/locale > /dev/null 2>&1; then | |
| echo "Appwrite is ready!" | |
| exit 0 | |
| fi | |
| echo "Attempt $i/60 - waiting 5s..." | |
| sleep 5 | |
| done | |
| echo "Appwrite failed to start" | |
| docker compose -f tests/docker-compose.yml logs appwrite | |
| exit 1 | |
| - name: Wait for executor | |
| run: | | |
| echo "Waiting for executor to be healthy..." | |
| for i in $(seq 1 30); do | |
| HEALTH=$(docker inspect --format='{{.State.Health.Status}}' openruntimes-executor 2>/dev/null || echo "not_found") | |
| if [ "$HEALTH" = "healthy" ]; then | |
| echo "Executor is healthy!" | |
| exit 0 | |
| fi | |
| echo "Attempt $i/30 - executor status: $HEALTH - waiting 5s..." | |
| sleep 5 | |
| done | |
| echo "Executor failed to become healthy" | |
| docker compose -f tests/docker-compose.yml logs openruntimes-executor | |
| docker compose -f tests/docker-compose.yml logs appwrite-worker-builds | |
| exit 1 | |
| - name: Setup test environment | |
| run: bun run test:setup | |
| - name: Run integration tests | |
| run: bun test --timeout 30000 | |
| - name: Dump logs on failure | |
| if: failure() | |
| run: | | |
| echo "=== Docker container status ===" | |
| docker compose -f tests/docker-compose.yml ps | |
| echo "" | |
| echo "=== Executor logs ===" | |
| docker compose -f tests/docker-compose.yml logs openruntimes-executor --tail=50 | |
| echo "" | |
| echo "=== Builds worker logs ===" | |
| docker compose -f tests/docker-compose.yml logs appwrite-worker-builds --tail=50 | |
| echo "" | |
| echo "=== Appwrite API logs ===" | |
| docker compose -f tests/docker-compose.yml logs appwrite --tail=50 | |
| echo "" | |
| echo "=== Docker networks ===" | |
| docker network ls | |
| echo "" | |
| echo "=== Appwrite network inspect ===" | |
| docker network inspect appwrite 2>/dev/null || echo "Network not found" | |
| - name: Teardown | |
| if: always() | |
| run: docker compose -f tests/docker-compose.yml --env-file tests/.env down -v |