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)
def tests(session: nox.Session):
session.conda_install("pytest", "hypothesis", "lark", "maturin")
@nox.session(python=False)
def rust_tests(session: nox.Session) -> None:
session.env.update(ENV)
try:
session.run(
"cargo",
"test",
"--release",
"--workspace",
"--exclude",
"pyargus",
external=True,
)
except Exception:
...
try:
session.run(
"maturin",
"develop",
"--release",
"-m",
"./pyargus/Cargo.toml",
"-E",
"test",
silent=True,
)
with session.chdir(CURRENT_DIR / "pyargus"):
session.run("pytest", ".", "--hypothesis-explain")
except Exception:
...
session.run(
"cargo",
"test",
"--release",
"--workspace",
"--exclude",
"pyargus",
external=True,
)
@nox.session(python=PYTHONS)
def python_tests(session: nox.Session) -> None:
session.conda_install("pytest", "hypothesis", "lark", "maturin")
session.run(
"maturin",
"develop",
"--release",
"-m",
"./pyargus/Cargo.toml",
"-E",
"test",
silent=True,
)
with session.chdir(CURRENT_DIR / "pyargus"):
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)