|
56 | 56 |
|
57 | 57 | test: |
58 | 58 | name: Test Runtime |
| 59 | + if: always() |
| 60 | + needs: [test-runtime] |
| 61 | + runs-on: ubuntu-latest |
| 62 | + steps: |
| 63 | + - run: | |
| 64 | + if [[ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}" == "true" ]]; then |
| 65 | + echo "One or more runtime test shards failed or were cancelled" |
| 66 | + exit 1 |
| 67 | + fi |
| 68 | +
|
| 69 | + test-runtime: |
| 70 | + name: Test Runtime / ${{ matrix.name }} |
59 | 71 | runs-on: ubuntu-latest |
60 | | - timeout-minutes: 10 |
| 72 | + timeout-minutes: 12 |
| 73 | + strategy: |
| 74 | + fail-fast: false |
| 75 | + matrix: |
| 76 | + include: |
| 77 | + - name: Node 1/2 |
| 78 | + artifact: node-1 |
| 79 | + args: --project node --shard=1/2 |
| 80 | + - name: Node 2/2 |
| 81 | + artifact: node-2 |
| 82 | + args: --project node --shard=2/2 |
| 83 | + - name: CLI |
| 84 | + artifact: cli |
| 85 | + args: --project cli |
61 | 86 | env: |
62 | 87 | # GitHub-hosted runners are ephemeral, so we can skip the Ryuk sidecar |
63 | 88 | # and avoid Docker Hub rate limits on testcontainers/ryuk pulls. |
@@ -112,10 +137,47 @@ jobs: |
112 | 137 | eval "$(dbus-launch --sh-syntax)" |
113 | 138 | eval "$(printf '\n' | gnome-keyring-daemon --unlock)" |
114 | 139 | eval "$(printf '\n' | gnome-keyring-daemon --start)" |
115 | | - pnpm exec vp test --run --project node --project cli --bail=1 |
| 140 | +
|
| 141 | + log="runtime-tests-${{ matrix.artifact }}.log" |
| 142 | + touch "${log}" |
| 143 | + tail -n +1 -f "${log}" & |
| 144 | + tail_pid=$! |
| 145 | +
|
| 146 | + setsid pnpm exec vp test --run ${{ matrix.args }} --reporter=verbose --bail=1 > "${log}" 2>&1 & |
| 147 | + test_pid=$! |
| 148 | +
|
| 149 | + ( |
| 150 | + sleep 9m |
| 151 | + if kill -0 "${test_pid}" 2>/dev/null; then |
| 152 | + echo "::error::Runtime test shard exceeded 9 minutes" >> "${log}" |
| 153 | + kill -TERM "-${test_pid}" 2>/dev/null || true |
| 154 | + sleep 30 |
| 155 | + kill -KILL "-${test_pid}" 2>/dev/null || true |
| 156 | + fi |
| 157 | + ) & |
| 158 | + watchdog_pid=$! |
| 159 | +
|
| 160 | + set +e |
| 161 | + wait "${test_pid}" |
| 162 | + test_status=$? |
| 163 | + set -e |
| 164 | +
|
| 165 | + kill "${watchdog_pid}" 2>/dev/null || true |
| 166 | + kill "${tail_pid}" 2>/dev/null || true |
| 167 | + wait "${tail_pid}" 2>/dev/null || true |
| 168 | + exit "${test_status}" |
116 | 169 | env: |
117 | 170 | CI: true |
118 | 171 |
|
| 172 | + - name: Upload runtime test log |
| 173 | + if: ${{ always() }} |
| 174 | + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
| 175 | + with: |
| 176 | + name: runtime-test-log-${{ matrix.artifact }} |
| 177 | + path: runtime-tests-${{ matrix.artifact }}.log |
| 178 | + if-no-files-found: ignore |
| 179 | + retention-days: 7 |
| 180 | + |
119 | 181 | test-html: |
120 | 182 | name: Test HTML |
121 | 183 | runs-on: ubuntu-latest |
|
0 commit comments