Skip to content

Commit 6ea72d9

Browse files
authored
tests: run in parallel (#106)
* tests: run in parallel Signed-off-by: Henry Schreiner <[email protected]> * tests: shallow clone Signed-off-by: Henry Schreiner <[email protected]> * tests: skip scikit-build on Windows for now Signed-off-by: Henry Schreiner <[email protected]> --------- Signed-off-by: Henry Schreiner <[email protected]>
1 parent 2c89220 commit 6ea72d9

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def tests(session: nox.Session) -> None:
3737
"""
3838
test_grp = nox.project.dependency_groups(PYPROJECT, "test")
3939
session.install("-e.", *test_grp)
40-
session.run("pytest", *session.posargs, env={"COVERAGE_CORE": "sysmon"})
40+
session.run("pytest", "-nauto", *session.posargs, env={"COVERAGE_CORE": "sysmon"})
4141

4242

4343
@nox.session(default=False)

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,11 @@ check-sdist = "check_sdist.schema:get_schema"
5555
test = [
5656
"pytest >=7",
5757
"pytest-cov >=3",
58+
"pytest-xdist",
5859
"pyproject-hooks !=1.1.0",
5960
"validate-pyproject >=0.16",
6061
]
62+
dev = [{ include-group = "test" }]
6163

6264

6365
[tool.hatch]

tests/test_downstream.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
import subprocess
4+
import sys
45
from pathlib import Path
56

67
import pytest
@@ -28,11 +29,15 @@
2829
("repo", "ref", "fail"), [(x["repo"], x["ref"], x.get("fail", 0)) for x in packages]
2930
)
3031
def test_packages(repo, ref, fail, tmp_path, monkeypatch, installer):
32+
if repo.endswith("scikit-build") and sys.platform.startswith("win32"):
33+
pytest.skip(reason="Path too long on Windows (0.18)")
34+
3135
monkeypatch.chdir(tmp_path)
3236
cmd = [
3337
"git",
3438
"clone",
3539
f"https://github.com/{repo}",
40+
"--depth=1",
3641
"--branch",
3742
ref,
3843
"--recurse-submodules",

0 commit comments

Comments
 (0)