Skip to content

Commit

Permalink
pytest: use the worksteal scheduler and run on all logical cores, not…
Browse files Browse the repository at this point in the history
… just physical.
  • Loading branch information
mr-c committed Mar 11, 2024
1 parent c34c7a1 commit 6b86425
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions conformance-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ else
pip uninstall -y cwltool
pip install -r"${SCRIPT_DIRECTORY}/mypy-requirements.txt"
CWLTOOL_USE_MYPYC=1 MYPYPATH="${SCRIPT_DIRECTORY}/mypy-stubs" pip install "${SCRIPT_DIRECTORY}" -r"${SCRIPT_DIRECTORY}/requirements.txt"
pip install 'cwltest>=2.5' pytest-cov pytest-xdist
pip install 'cwltest>=2.5' pytest-cov pytest-xdist>=3.2.0 psutil
fi

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

# Build command
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:]-" _)"
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:]-" _)"
if [[ -n "${EXCLUDE}" ]] ; then
TEST_COMMAND="${TEST_COMMAND} --cwl-exclude ${EXCLUDE}"
fi
Expand Down
2 changes: 1 addition & 1 deletion release-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ run_tests() {
mod_loc=$(pip show ${package} |
grep ^Location | awk '{print $2}')/${module}
"${test_prefix}"bin/py.test "--ignore=${mod_loc}/schemas/" \
--pyargs -x ${module} -n auto --dist=loadfile
--pyargs -x ${module} -n logical --dist=worksteal
}
pipver=23.1 # minimum required version of pip for Python 3.12
setuptoolsver=67.6.1 # required for Python 3.12
Expand Down
3 changes: 2 additions & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
bagit>=1.6.4,<1.9
pytest>= 6.2,< 8.2
pytest-xdist
pytest-xdist>=3.2.0 # for the worksteal scheduler
psutil # enhances pytest-xdist to allow "-n logical"
pytest-httpserver
pytest-retry;python_version>'3.9'
mock>=2.0.0
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ envlist =
skip_missing_interpreters = True

[pytest]
addopts=--ignore cwltool/schemas -n auto
addopts=--ignore cwltool/schemas -n logical --dist worksteal
testpaths = tests

[gh-actions]
Expand Down

0 comments on commit 6b86425

Please sign in to comment.