"vscode:/vscode.git/clone" did not exist on "5eb35ec98b7172a2784a970314cdd1fa1508de61"
Unverified Commit 1ecbc249 authored by moto's avatar moto Committed by GitHub
Browse files

Run tests in parallel with pytest-xdist (#807)

Currently macOS CI job takes twice the time of linux unit tests.
This PR uses `pytest-xdist` to run unit tests in parallel on macOS CI job. 

Interestingly applying the same technique to linux unit tests make the test execution longer.
So the change is only applied to macOS.

macOS 27 mins -> 17 mins 😸
linux 14 mins -> 1 hours 😾
parent 8fdb8df2
...@@ -6,6 +6,7 @@ dependencies: ...@@ -6,6 +6,7 @@ dependencies:
- numpy - numpy
- pytest - pytest
- pytest-cov - pytest-cov
- pytest-xdist
- codecov - codecov
- librosa - librosa
- llvmlite==0.31 # See https://github.com/pytorch/audio/pull/766 - llvmlite==0.31 # See https://github.com/pytorch/audio/pull/766
......
...@@ -2,9 +2,20 @@ ...@@ -2,9 +2,20 @@
set -e set -e
case "$(uname -s)" in
Darwin*) os=MacOSX;;
*) os=Linux
esac
eval "$(./conda/bin/conda shell.bash hook)" eval "$(./conda/bin/conda shell.bash hook)"
conda activate ./env conda activate ./env
python -m torch.utils.collect_env python -m torch.utils.collect_env
export PATH="${PWD}/third_party/install/bin/:${PATH}" export PATH="${PWD}/third_party/install/bin/:${PATH}"
pytest --cov=torchaudio --junitxml=test-results/junit.xml -v --durations 20 test
if [ "${os}" == MacOSX ] ; then
pytest -q -n auto --dist=loadscope --cov=torchaudio --junitxml=test-results/junit.xml --durations 20 test
else
pytest -v --cov=torchaudio --junitxml=test-results/junit.xml --durations 20 test
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment