diff --git a/.gitea/workflows/backend-integration.yml b/.gitea/workflows/backend-integration.yml new file mode 100644 index 0000000..7122145 --- /dev/null +++ b/.gitea/workflows/backend-integration.yml @@ -0,0 +1,63 @@ +name: Backend Integration Tests + +# Split out of the Tests workflow and made manual. It was blocking every push +# and pull request: on 2026-08-18 the job held the runner for 3h12m, which also +# kept frontend-e2e queued behind it for the same three hours. +# +# The suite itself is not slow — that run executed 89 tests in 87 seconds and +# then hung with "Jest did not exit one second after the test run has +# completed", so something keeps the event loop alive after the run. Until that +# is root-caused, this runs on demand and under a hard timeout. +on: + workflow_dispatch: + +jobs: + backend-integration: + runs-on: ubuntu-latest + # The suite takes ~90s. This is not a performance budget — it is a stop so a + # post-run hang costs minutes of runner time instead of hours. + timeout-minutes: 15 + services: + postgres: + image: postgres:16 + env: + POSTGRES_USER: redefined_test + POSTGRES_PASSWORD: redefined_test + POSTGRES_DB: redefined_test + options: >- + --health-cmd "pg_isready -U redefined_test" + --health-interval 5s + --health-timeout 5s + --health-retries 10 + env: + TEST_PGHOST: postgres + TEST_PGPORT: 5432 + TEST_PGUSER: redefined_test + TEST_PGPASSWORD: redefined_test + TEST_PGDATABASE: redefined_test + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Install deps + run: npm install + working-directory: backend + + - name: Run integration tests + id: integration + continue-on-error: true + run: npm run test:integration:json + working-directory: backend + + - name: Summarize + if: always() + run: node scripts/summarize-jest.js backend/integration-results.json "Backend Integration Test" + + - name: Fail job if tests failed + if: steps.integration.outcome == 'failure' + run: exit 1 diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index a9e0cdc..67cc1db 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -1,5 +1,12 @@ name: Tests +# backend-integration lives in its own manual workflow +# (.gitea/workflows/backend-integration.yml) rather than running here. It held +# the runner for 3h12m on 2026-08-18 — 87 seconds of tests followed by a hang +# after the run completed — and blocked frontend-e2e behind it for the same +# three hours. Run it from Actions before merging anything that touches the API +# or the database. + on: push: branches: [main] @@ -37,53 +44,6 @@ jobs: if: steps.unit.outcome == 'failure' run: exit 1 - backend-integration: - runs-on: ubuntu-latest - services: - postgres: - image: postgres:16 - env: - POSTGRES_USER: redefined_test - POSTGRES_PASSWORD: redefined_test - POSTGRES_DB: redefined_test - options: >- - --health-cmd "pg_isready -U redefined_test" - --health-interval 5s - --health-timeout 5s - --health-retries 10 - env: - TEST_PGHOST: postgres - TEST_PGPORT: 5432 - TEST_PGUSER: redefined_test - TEST_PGPASSWORD: redefined_test - TEST_PGDATABASE: redefined_test - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: '20' - - - name: Install deps - run: npm install - working-directory: backend - - - name: Run integration tests - id: integration - continue-on-error: true - run: npm run test:integration:json - working-directory: backend - - - name: Summarize - if: always() - run: node scripts/summarize-jest.js backend/integration-results.json "Backend Integration Test" - - - name: Fail job if tests failed - if: steps.integration.outcome == 'failure' - run: exit 1 - frontend-e2e: runs-on: ubuntu-latest services: