Skip to content

Commit cd91624

Browse files
committed
ci: run some tests in parallel
Signed-off-by: Henry Schreiner <[email protected]>
1 parent cb8b58b commit cd91624

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ jobs:
120120
if: matrix.python-version != 'pypy-3.8'
121121
run:
122122
uv pip install
123-
-e.[test,test-meta,test-numpy,test-schema,test-hatchling,wheels,cov,wheel-free-setuptools]
123+
-e.[test,test-meta,test-numpy,test-schema,test-hatchling,wheels,cov,wheel-free-setuptools] pytest-xdist
124124
--system
125125

126126
- name: Install package (pip)
@@ -132,7 +132,7 @@ jobs:
132132
- name: Test package
133133
if: "!contains(matrix.python_version, 'pypy')"
134134
run: >-
135-
pytest -ra --showlocals --cov --cov-report=xml --cov-report=term
135+
pytest -ra --showlocals --cov --cov-report=xml --cov-report=term -n auto
136136
--durations=20
137137
138138
- name: Test package (two attempts)
@@ -144,7 +144,7 @@ jobs:
144144
timeout_seconds: 5
145145
command: >-
146146
pytest -ra --showlocals --cov --cov-report=xml --cov-report=term
147-
--durations=20
147+
--durations=20 -n auto
148148
149149
- name: Upload coverage report
150150
uses: codecov/codecov-action@v5

noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def _run_tests(
6363
run_args: Sequence[str] = (),
6464
extras: Sequence[str] = (),
6565
) -> None:
66-
posargs = list(session.posargs)
66+
posargs = list(session.posargs) or ["-n", "auto"]
6767
env = {"PIP_DISABLE_PIP_VERSION_CHECK": "1"}
6868

6969
_prepare_cmake_ninja(session)
@@ -74,7 +74,7 @@ def _run_tests(
7474
posargs.append("--cov-config=pyproject.toml")
7575

7676
install_arg = f"-e.[{','.join(_extras)}]"
77-
session.install(install_arg, *install_args, silent=False)
77+
session.install(install_arg, *install_args, "pytest-xdist", silent=False)
7878
session.run("pytest", *run_args, *posargs, env=env)
7979

8080

0 commit comments

Comments
 (0)