fix(facets): prevent endless loading state when query is disabled #211
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: E2E Tests | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| paths: | |
| - 'e2e/**' | |
| - 'e2e-stub/**' | |
| - 'src/**' | |
| - 'middleware.ts' | |
| - 'Dockerfile.e2e' | |
| - 'package.json' | |
| - 'pnpm-lock.yaml' | |
| - '.github/workflows/e2e-tests.yml' | |
| workflow_dispatch: | |
| concurrency: | |
| group: e2e-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| e2e-tests: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Cache Docker layers | |
| uses: actions/cache@v4 | |
| with: | |
| path: /tmp/.buildx-cache | |
| key: ${{ runner.os }}-buildx-${{ hashFiles('Dockerfile.e2e', 'e2e-stub/Dockerfile', 'pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-buildx- | |
| - name: Build Docker images | |
| run: | | |
| docker compose -f e2e/docker-compose.yml build \ | |
| --build-arg BUILDKIT_INLINE_CACHE=1 | |
| env: | |
| DOCKER_BUILDKIT: 1 | |
| COMPOSE_DOCKER_CLI_BUILD: 1 | |
| - name: Run E2E tests | |
| run: | | |
| docker compose -f e2e/docker-compose.yml up \ | |
| --abort-on-container-exit \ | |
| --exit-code-from tests \ | |
| --attach tests | |
| - name: Collect test artifacts | |
| if: failure() | |
| run: | | |
| # Copy artifacts from Docker container if it still exists | |
| if docker ps -a | grep -q e2e-tests; then | |
| docker cp e2e-tests:/app/e2e/test-results ./test-results 2>/dev/null || true | |
| docker cp e2e-tests:/app/e2e/playwright-report ./playwright-report 2>/dev/null || true | |
| fi | |
| - name: Upload test artifacts | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: e2e-test-results | |
| path: | | |
| test-results/ | |
| playwright-report/ | |
| retention-days: 7 | |
| - name: Cleanup containers | |
| if: always() | |
| run: | | |
| docker compose -f e2e/docker-compose.yml down -v | |
| - name: Post PR comment | |
| if: always() && github.event_name == 'pull_request' | |
| continue-on-error: true | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const fs = require('fs'); | |
| const status = '${{ job.status }}'; | |
| const runUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`; | |
| let message = ''; | |
| if (status === 'success') { | |
| message = `✅ **E2E Tests Passed**\n\n🎭 All middleware E2E tests completed successfully.\n\n[View workflow run](${runUrl})`; | |
| } else { | |
| message = `❌ **E2E Tests Failed**\n\n🎭 Some E2E tests failed.\n\n📎 Test artifacts are available in the [workflow run](${runUrl})`; | |
| } | |
| // Find existing comment | |
| const { data: comments } = await github.rest.issues.listComments({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| }); | |
| const botComment = comments.find(comment => | |
| comment.user.type === 'Bot' && | |
| comment.body.includes('E2E Tests') | |
| ); | |
| if (botComment) { | |
| // Update existing comment | |
| await github.rest.issues.updateComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| comment_id: botComment.id, | |
| body: message | |
| }); | |
| } else { | |
| // Create new comment | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| body: message | |
| }); | |
| } |