From 379f92c110fa62c31d5c930e86a08bca3dd1eb26 Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Fri, 27 Feb 2026 12:08:04 -0500 Subject: [PATCH] Add legacy_tool.dot workflow and CLI tests for backwards compat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Exercises the old tool_command attribute through validate and dry-run to catch regressions in the tool → script compatibility. Co-Authored-By: Claude Opus 4.6 --- crates/attractor/tests/cli.rs | 17 +++++++++++++++++ test/legacy_tool.dot | 11 +++++++++++ 2 files changed, 28 insertions(+) create mode 100644 test/legacy_tool.dot diff --git a/crates/attractor/tests/cli.rs b/crates/attractor/tests/cli.rs index 41092e955..8c486db44 100644 --- a/crates/attractor/tests/cli.rs +++ b/crates/attractor/tests/cli.rs @@ -53,6 +53,15 @@ fn validate_styled() { .stderr(predicate::str::contains("Validation: OK")); } +#[test] +fn validate_legacy_tool() { + attractor() + .args(["validate", "../../test/legacy_tool.dot"]) + .assert() + .success() + .stderr(predicate::str::contains("Validation: OK")); +} + #[test] fn validate_invalid() { attractor() @@ -118,6 +127,14 @@ fn dry_run_styled() { .success(); } +#[test] +fn dry_run_legacy_tool() { + attractor() + .args(["run", "--dry-run", "--auto-approve", "../../test/legacy_tool.dot"]) + .assert() + .success(); +} + // -- NDJSON logging ---------------------------------------------------------- #[test] diff --git a/test/legacy_tool.dot b/test/legacy_tool.dot new file mode 100644 index 000000000..6e0b389bc --- /dev/null +++ b/test/legacy_tool.dot @@ -0,0 +1,11 @@ +digraph LegacyTool { + graph [goal="Verify backwards compatibility with old tool naming"] + rankdir=LR + + start [shape=Mdiamond, label="Start"] + exit [shape=Msquare, label="Exit"] + + echo_task [label="Echo", shape=parallelogram, tool_command="echo hello"] + + start -> echo_task -> exit +}