From 002f2ab76a29934e5613fc262d07211f3359a532 Mon Sep 17 00:00:00 2001 From: SKY <183753734+SahilKumar965@users.noreply.github.com> Date: Fri, 27 Nov 2026 14:27:47 +0530 Subject: [PATCH] tests: fix red dev CI (rich line wrap, missing demo sources, ruff format) - test_build_force: ignore Rich's line wrapping when matching the error. - test_demo_workflows_generate: mark generalcontrol/generalcontroler as known unsupported; their sources pstim.py, pacq.py, simpm.py are not in demo/, and mkconcore now errors on missing sources (918e6d6). - test_cli: apply ruff format so the lint job passes. --- tests/test_build_force.py | 3 ++- tests/test_cli.py | 12 +++++++++--- tests/test_demo_workflows_generate.py | 5 +++++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/tests/test_build_force.py b/tests/test_build_force.py index 3164aa34..a5c5c076 100644 --- a/tests/test_build_force.py +++ b/tests/test_build_force.py @@ -63,7 +63,8 @@ def test_force_refuses_a_directory_that_is_not_a_study(self): result = self.runner.invoke(cli, args + ["--output", "mydata", "--force"]) self.assertNotEqual(result.exit_code, 0) - self.assertIn("does not look like a study", result.output) + # Rich wraps long messages at the console width, so ignore line breaks + self.assertIn("does not look like a study", " ".join(result.output.split())) self.assertTrue((Path("mydata") / "important.txt").exists()) def test_force_refuses_the_current_directory(self): diff --git a/tests/test_cli.py b/tests/test_cli.py index 32d55f49..68122f03 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -1145,16 +1145,22 @@ def test_validate_and_inspect_julia_node(self): (src_dir / "ctrl.jl").write_text("# julia controller") # validate passes with no unusual file extension warning - val_res = self.runner.invoke(cli, ["validate", "workflow.graphml", "--format", "json"]) + val_res = self.runner.invoke( + cli, ["validate", "workflow.graphml", "--format", "json"] + ) self.assertEqual(val_res.exit_code, 0) val_payload = json.loads(val_res.output) self.assertTrue(val_payload["valid"]) self.assertEqual(val_payload["summary"]["error_count"], 0) warning_messages = [w["message"] for w in val_payload["warnings"]] - self.assertFalse(any("unusual file extension" in m for m in warning_messages)) + self.assertFalse( + any("unusual file extension" in m for m in warning_messages) + ) # inspect reports Julia language - insp_res = self.runner.invoke(cli, ["inspect", "workflow.graphml", "--json"]) + insp_res = self.runner.invoke( + cli, ["inspect", "workflow.graphml", "--json"] + ) self.assertEqual(insp_res.exit_code, 0) insp_payload = json.loads(insp_res.output) self.assertEqual(insp_payload["nodes"]["by_language"].get("julia"), 1) diff --git a/tests/test_demo_workflows_generate.py b/tests/test_demo_workflows_generate.py index 18f6812d..4d609aa6 100644 --- a/tests/test_demo_workflows_generate.py +++ b/tests/test_demo_workflows_generate.py @@ -37,6 +37,11 @@ KNOWN_UNSUPPORTED = { ("sampleJ.graphml", "posix"): "Julia (.jl) nodes in local builds", ("sampleJ.graphml", "windows"): "Julia (.jl) nodes in local builds", + **{ + (name, build_type): "node sources pstim.py, pacq.py, simpm.py are not in demo/" + for name in ("generalcontrol.graphml", "generalcontroler.graphml") + for build_type in ("posix", "windows", "docker") + }, }