From f9708bb9ebe40050f26703c79004ba9f65d2aed1 Mon Sep 17 00:00:00 2001 From: Roland Date: Thu, 8 Oct 2026 16:55:00 -0600 Subject: [PATCH] Split the backend tests into four jobs by directory The groups are balanced by test time, so each runs about a quarter of the suite. `rest` ignores the other groups' paths rather than listing its own, so a new directory is tested before it is assigned to a group. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/backend.yml | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index ab44b3cb..05cec023 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -14,8 +14,29 @@ concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: + # The suite is split by directory so it finishes in a few minutes, and so a check's name says + # which area broke. The groups are balanced by test time; `rest` runs everything the others do + # not, so a new directory is tested before anyone assigns it. A path added to any other group + # must also be added to `rest` as an --ignore, or its tests run twice. api-tests: + name: api-tests (${{ matrix.name }}) runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - name: core + paths: wrolpi/test + - name: media + paths: modules/videos modules/zim modules/docs modules/map modules/inventory modules/flasher + - name: files + paths: wrolpi/files wrolpi/collections + - name: rest + paths: >- + --ignore=wrolpi/test + --ignore=modules/videos --ignore=modules/zim --ignore=modules/docs --ignore=modules/map + --ignore=modules/inventory --ignore=modules/flasher + --ignore=wrolpi/files --ignore=wrolpi/collections steps: - name: Checkout repository uses: actions/checkout@v4 @@ -37,13 +58,15 @@ jobs: # `logical`, not `auto`: with psutil installed, `auto` counts physical cores, which is two on # the four-vCPU runner. No `-v`: the full test output inflates wall time and logs. - name: Run pytest - run: pytest -n logical --junitxml=test-results.xml + env: + PATHS: ${{ matrix.paths }} + run: pytest -n logical $PATHS --junitxml=test-results.xml - name: Upload test results if: ${{ !cancelled() }} uses: actions/upload-artifact@v4 with: - name: api-test-results + name: api-test-results-${{ matrix.name }} path: test-results.xml retention-days: 30