From 11c60557c25638a6af150db000f203e99e1b2efd Mon Sep 17 00:00:00 2001 From: Vladimir Milosevic Date: Fri, 25 Oct 2024 07:26:52 +0000 Subject: [PATCH] Run tests in two groups --- .github/workflows/build-and-test.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 817467654..066353ca7 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -3,6 +3,7 @@ name: Build and Test on: workflow_dispatch: workflow_call: + push: jobs: @@ -44,6 +45,7 @@ jobs: matrix: build: - runs-on: runner + test_group_id: [1] runs-on: - in-service @@ -121,13 +123,22 @@ jobs: run: | source env/activate set -o pipefail # Ensures that the exit code reflects the first command that fails - pytest --junit-xml=${{ steps.strings.outputs.test_report_path }} 2>&1 | tee pytest.log + pip install pytest-split + # pytest --splits 2 --group ${{ matrix.test_group_id }} --junit-xml=${{ steps.strings.outputs.test_report_path }} 2>&1 | tee pytest.log + pytest --store-durations --junit-xml=${{ steps.strings.outputs.test_report_path }} 2>&1 | tee pytest.log + + - name: Upload Test Durations + uses: actions/upload-artifact@v4 + if: success() || failure() + with: + name: test-durations-${{ matrix.build.runs-on }}-${{ matrix.test_group_id }} + path: .test_durations - name: Upload Test Log uses: actions/upload-artifact@v4 if: success() || failure() with: - name: test-log-${{ matrix.build.runs-on }} + name: test-log-${{ matrix.build.runs-on }}-${{ matrix.test_group_id }} path: pytest.log - name: Run Perf Benchmark @@ -140,7 +151,7 @@ jobs: uses: actions/upload-artifact@v4 if: success() || failure() with: - name: test-reports-${{ matrix.build.runs-on }} + name: test-reports-${{ matrix.build.runs-on }}-${{ matrix.test_group_id }} path: ${{ steps.strings.outputs.test_report_path }} - name: Show Test Report