Skip to content

Commit c4e4c2a

Browse files
committed
pytest: use the worksteal scheduler and run on all logical cores, not just physical.
1 parent 3b39796 commit c4e4c2a

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

conformance-test.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ else
7878
pip uninstall -y cwltool
7979
pip install -r"${SCRIPT_DIRECTORY}/mypy-requirements.txt"
8080
CWLTOOL_USE_MYPYC=1 MYPYPATH="${SCRIPT_DIRECTORY}/mypy-stubs" pip install "${SCRIPT_DIRECTORY}" -r"${SCRIPT_DIRECTORY}/requirements.txt"
81-
pip install 'cwltest>=2.5' pytest-cov pytest-xdist
81+
pip install 'cwltest>=2.5' pytest-cov pytest-xdist>=3.2.0 psutil
8282
fi
8383

8484
# Set conformance test filename
@@ -121,7 +121,7 @@ if (( "${#exclusions[*]}" > 0 )); then
121121
fi
122122

123123
# Build command
124-
TEST_COMMAND="python -m pytest ${CONFORMANCE_TEST} -n auto -rs --junit-xml=${TMP_DIR}/cwltool_conf_${VERSION}_${GIT_TARGET}_${CONTAINER}.xml -o junit_suite_name=cwltool_$(echo "${CWLTOOL_OPTIONS}" | tr "[:blank:]-" _)"
124+
TEST_COMMAND="python -m pytest ${CONFORMANCE_TEST} -n logical --dist worksteal -rs --junit-xml=${TMP_DIR}/cwltool_conf_${VERSION}_${GIT_TARGET}_${CONTAINER}.xml -o junit_suite_name=cwltool_$(echo "${CWLTOOL_OPTIONS}" | tr "[:blank:]-" _)"
125125
if [[ -n "${EXCLUDE}" ]] ; then
126126
TEST_COMMAND="${TEST_COMMAND} --cwl-exclude ${EXCLUDE}"
127127
fi

test-requirements.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
bagit>=1.6.4,<1.9
22
pytest>= 6.2,< 8.2
3-
pytest-xdist
3+
pytest-xdist>=3.2.0 # for the worksteal scheduler
4+
psutil # enhances pytest-xdist to allow "-n logical"
45
pytest-httpserver
56
pytest-retry;python_version>'3.9'
67
mock>=2.0.0

tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ envlist =
1111
skip_missing_interpreters = True
1212

1313
[pytest]
14-
addopts=--ignore cwltool/schemas -n auto
14+
addopts=--ignore cwltool/schemas -n logical --dist worksteal
1515
testpaths = tests
1616

1717
[gh-actions]

0 commit comments

Comments
 (0)