Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallelize pytest runs. #29

Merged
merged 1 commit into from
Mar 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
run: |
set -xe
python -m pip install --upgrade pip setuptools wheel
python -m pip install flake8 pytest pytype pylint pylint-exit
python -m pip install flake8 pytest-xdist pytype pylint pylint-exit
python -m pip install -r requirements.txt
python -m pip install -r requirements-test.txt
shell: bash
Expand Down Expand Up @@ -57,8 +57,8 @@ jobs:
# Change directory to avoid importing the package from repo root.
mkdir _testing && cd _testing
# Main tests.
python -m pytest --pyargs chex -k "not fake_set_n_cpu_devices_test"
python -m pytest -n "$(grep -c ^processor /proc/cpuinfo)" --pyargs chex -k "not fake_set_n_cpu_devices_test"
# Isolate tests that use `chex.set_n_cpu_device()`.
python -m pytest --pyargs chex -k "fake_set_n_cpu_devices_test"
python -m pytest -n "$(grep -c ^processor /proc/cpuinfo)" --pyargs chex -k "fake_set_n_cpu_devices_test"
cd ..
shell: bash