Skip to content

Commit ed96375

Browse files
committed
coverage: run cuda core tests in coverage using 8M thread
1 parent ecf269f commit ed96375

File tree

1 file changed

+31
-2
lines changed

1 file changed

+31
-2
lines changed

.github/workflows/coverage.yml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,11 +380,40 @@ jobs:
380380
sys.exit(result['code'])
381381
PYTEST_EOF
382382
383-
- name: Run cuda.core tests
383+
# Same 8MB stack thread as bindings: Cython linetrace under coverage on Windows
384+
# can need a larger stack than the default thread size.
385+
- name: Run cuda.core tests (with 8MB stack)
384386
continue-on-error: true
385387
run: |
386388
cd "${{ steps.install-root.outputs.INSTALL_ROOT }}"
387-
"$GITHUB_WORKSPACE/.venv/Scripts/pytest" -v --cov=./cuda --cov-append --cov-context=test --cov-config="$GITHUB_WORKSPACE/.coveragerc" "$GITHUB_WORKSPACE/cuda_core/tests"
389+
"$GITHUB_WORKSPACE/.venv/Scripts/python" << PYTEST_EOF
390+
import os
391+
import sys
392+
import threading
393+
import pytest
394+
395+
os.chdir(r'${{ steps.install-root.outputs.INSTALL_ROOT }}')
396+
threading.stack_size(8 * 1024 * 1024)
397+
result = {'code': 1}
398+
399+
def _run():
400+
workspace = os.environ['GITHUB_WORKSPACE']
401+
result['code'] = pytest.main([
402+
'-v',
403+
'--cov=./cuda',
404+
'--cov-append',
405+
'--cov-context=test',
406+
f'--cov-config={workspace}/.coveragerc',
407+
f'{workspace}/cuda_core/tests'
408+
])
409+
410+
t = threading.Thread(target=_run)
411+
t.start()
412+
t.join()
413+
414+
print(f'cuda.core tests exit code: {result["code"]}')
415+
sys.exit(result['code'])
416+
PYTEST_EOF
388417
389418
- name: Copy Windows coverage file to workspace
390419
run: |

0 commit comments

Comments
 (0)