From 57a4ee048c961d7349c70057535c7b856671514e Mon Sep 17 00:00:00 2001 From: Alec Edgington <54802828+cqc-alec@users.noreply.github.com> Date: Mon, 22 Jul 2024 14:25:05 +0100 Subject: [PATCH] test: Add "validate" to hugr CLI command. (#1331) And include rust code filter in criteria for running python tests on CI. --- .github/change-filters.yml | 3 ++- hugr-py/tests/conftest.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/change-filters.yml b/.github/change-filters.yml index aaa916bc2..f0ecf5db7 100644 --- a/.github/change-filters.yml +++ b/.github/change-filters.yml @@ -1,7 +1,7 @@ # Filters used by [dorny/path-filters](https://github.com/dorny/paths-filter) # to detect changes in each subproject, and only run the corresponding jobs. -rust: +rust: &rust - "hugr/**" - "hugr-cli/**" - "hugr-core/**" @@ -11,6 +11,7 @@ rust: - ".github/workflows/ci-rs.yml" python: + - *rust - "hugr-py/**" - "pyproject.toml" - "poetry.lock" diff --git a/hugr-py/tests/conftest.py b/hugr-py/tests/conftest.py index 19e84e106..075b70efb 100644 --- a/hugr-py/tests/conftest.py +++ b/hugr-py/tests/conftest.py @@ -118,7 +118,7 @@ def validate(h: Hugr, mermaid: bool = False, roundtrip: bool = True): workspace_dir = pathlib.Path(__file__).parent.parent.parent # use the HUGR_BIN environment variable if set, otherwise use the debug build bin_loc = os.environ.get("HUGR_BIN", str(workspace_dir / "target/debug/hugr")) - cmd = [bin_loc, "-"] + cmd = [bin_loc, "validate", "-"] if mermaid: cmd.append("--mermaid")