Skip to content

Commit

Permalink
Run tests in two groups
Browse files Browse the repository at this point in the history
  • Loading branch information
vmilosevic committed Oct 25, 2024
1 parent 3c26306 commit 11c6055
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Build and Test
on:
workflow_dispatch:
workflow_call:
push:

jobs:

Expand Down Expand Up @@ -44,6 +45,7 @@ jobs:
matrix:
build:
- runs-on: runner
test_group_id: [1]

runs-on:
- in-service
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 11c6055

Please sign in to comment.