Skip to content

Commit

Permalink
ci: separate rust and python test sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
anand-bala committed Oct 18, 2023
1 parent eab6e21 commit a295f21
Showing 1 changed file with 33 additions and 29 deletions.
62 changes: 33 additions & 29 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,37 +131,41 @@ def mypy(session: nox.Session):
# )


@nox.session(python=False)
def rust_tests(session: nox.Session) -> None:
session.env.update(ENV)
session.run(
"cargo",
"test",
"--release",
"--workspace",
"--exclude",
"pyargus",
external=True,
)


@nox.session(python=PYTHONS)
def tests(session: nox.Session):
def python_tests(session: nox.Session) -> None:
session.conda_install("pytest", "hypothesis", "lark", "maturin")
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(
"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)
Expand Down

0 comments on commit a295f21

Please sign in to comment.