|
22 | 22 | steps: |
23 | 23 | - name: Checkout code |
24 | 24 | uses: actions/checkout@v4 |
| 25 | + with: |
| 26 | + fetch-depth: 0 # Fetch all history for proper diff |
25 | 27 |
|
26 | 28 | - name: Restore global uv cache |
27 | 29 | id: cache-restore |
@@ -49,22 +51,29 @@ jobs: |
49 | 51 | uses: actions/cache/restore@v4 |
50 | 52 | with: |
51 | 53 | path: .test_durations_py* |
52 | | - key: test-durations-py${{ matrix.python-version }}- |
53 | | - restore-keys: | |
54 | | - test-durations-py${{ matrix.python-version }}- |
| 54 | + key: test-durations-py${{ matrix.python-version }} |
55 | 55 |
|
56 | 56 | - name: Run tests (group ${{ matrix.group }} of 8) |
57 | 57 | run: | |
58 | 58 | PYTHON_VERSION_SAFE=$(echo "${{ matrix.python-version }}" | tr '.' '_') |
59 | 59 | DURATION_FILE=".test_durations_py${PYTHON_VERSION_SAFE}" |
60 | 60 | |
61 | | - if [ -f "$DURATION_FILE" ]; then |
62 | | - echo "Using cached test durations for optimal splitting" |
63 | | - DURATIONS_ARG="--durations-path=${DURATION_FILE}" |
64 | | - else |
65 | | - echo "No cached durations found, tests will be split evenly" |
66 | | - DURATIONS_ARG="" |
67 | | - fi |
| 61 | + # Temporarily always skip cached durations to fix test splitting |
| 62 | + # When durations don't match, pytest-split runs duplicate tests instead of splitting |
| 63 | + echo "Using even test splitting (duration cache disabled until fix merged)" |
| 64 | + DURATIONS_ARG="" |
| 65 | + |
| 66 | + # Original logic (disabled temporarily): |
| 67 | + # if [ ! -f "$DURATION_FILE" ]; then |
| 68 | + # echo "No cached durations found, tests will be split evenly" |
| 69 | + # DURATIONS_ARG="" |
| 70 | + # elif git diff origin/${{ github.base_ref }}...HEAD --name-only 2>/dev/null | grep -q "^tests/.*\.py$"; then |
| 71 | + # echo "Test files have changed, skipping cached durations to avoid mismatches" |
| 72 | + # DURATIONS_ARG="" |
| 73 | + # else |
| 74 | + # echo "No test changes detected, using cached test durations for optimal splitting" |
| 75 | + # DURATIONS_ARG="--durations-path=${DURATION_FILE}" |
| 76 | + # fi |
68 | 77 | |
69 | 78 | uv run pytest \ |
70 | 79 | --block-network \ |
|
0 commit comments