ci: separate rust and python test sessions

This commit is contained in:
Anand Balakrishnan 2023-10-18 16:38:06 -07:00
parent eab6e219ef
commit a295f21049
No known key found for this signature in database

View file

@ -131,37 +131,41 @@ def mypy(session: nox.Session):
# ) # )
@nox.session(python=PYTHONS) @nox.session(python=False)
def tests(session: nox.Session): def rust_tests(session: nox.Session) -> None:
session.conda_install("pytest", "hypothesis", "lark", "maturin")
session.env.update(ENV) session.env.update(ENV)
try: session.run(
session.run( "cargo",
"cargo", "test",
"test", "--release",
"--release", "--workspace",
"--workspace", "--exclude",
"--exclude", "pyargus",
"pyargus", external=True,
external=True, )
)
except Exception:
... @nox.session(python=PYTHONS)
try: def python_tests(session: nox.Session) -> None:
session.run( session.conda_install("pytest", "hypothesis", "lark", "maturin")
"maturin", session.run(
"develop", "maturin",
"--release", "develop",
"-m", "--release",
"./pyargus/Cargo.toml", "-m",
"-E", "./pyargus/Cargo.toml",
"test", "-E",
silent=True, "test",
) silent=True,
with session.chdir(CURRENT_DIR / "pyargus"): )
session.run("pytest", ".", "--hypothesis-explain") with session.chdir(CURRENT_DIR / "pyargus"):
except Exception: session.run("pytest", ".", "--hypothesis-explain")
...
@nox.session(python=False)
def tests(session: nox.Session):
session.notify("rust_tests")
session.notify("python_tests")
@nox.session(python=DEFAULT_PYTHON) @nox.session(python=DEFAULT_PYTHON)