From 372ec09c47022a618dda6fd82356f5764d985db3 Mon Sep 17 00:00:00 2001 From: bellman Date: Wed, 3 Jun 2026 19:31:45 +0900 Subject: [PATCH] test: cover roadmap helper missing path --- ROADMAP.md | 6 ++++++ tests/__init__.py | 0 tests/test_roadmap_helpers.py | 11 +++++++++++ 3 files changed, 17 insertions(+) create mode 100644 tests/__init__.py diff --git a/ROADMAP.md b/ROADMAP.md index 4757a24b..666a4433 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -8002,3 +8002,9 @@ Original filing (2026-04-18): the session emitted `SessionStart hook (completed) **Fix applied.** `parse_direct_slash_cli_action` now routes `/status`, `/diff`, `/version`, `/doctor`, and `/sandbox` directly to the same local `CliAction` variants as `status`, `diff`, `version`, `doctor`, and `sandbox`. The generic `interactive_only` branch remains the fallback for valid but live-REPL-only slash commands, preserving the #829 non-resume-safe hint behavior. **Verification.** `cargo test --manifest-path rust/Cargo.toml -p rusty-claude-cli direct_resume_safe_slash_commands_route_to_local_json_actions_831 -- --nocapture`. + +832. **DONE — roadmap-next-id helper missing explicit ROADMAP path behavior lacked regression coverage** — follow-up to #725 and PR #3117 after dogfood showed `scripts/roadmap-next-id.sh /tmp/nonexistent-roadmap` already failed correctly but the helper tests did not pin that behavior. The missing-path case is important because docs-only PRs can otherwise regress back to printing a next id for an absent explicit file. + + **Fix applied.** Added `test_roadmap_next_id_fails_when_explicit_roadmap_path_is_missing`, proving an explicit missing ROADMAP path exits nonzero, keeps stdout empty, and reports both `ROADMAP not found` and the requested path on stderr. Added `tests/__init__.py` so `python3 -m unittest tests.test_roadmap_helpers` resolves this repository's tests package consistently. + + **Verification.** `python3 -m unittest tests.test_roadmap_helpers`; `scripts/roadmap-check-ids.sh`; `scripts/roadmap-next-id.sh`. diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/test_roadmap_helpers.py b/tests/test_roadmap_helpers.py index 725a8963..3c875198 100644 --- a/tests/test_roadmap_helpers.py +++ b/tests/test_roadmap_helpers.py @@ -59,6 +59,17 @@ class RoadmapHelperTests(unittest.TestCase): self.assertIn('999', result.stderr) self.assertNotIn('1000', result.stdout) + def test_roadmap_next_id_fails_when_explicit_roadmap_path_is_missing(self) -> None: + with tempfile.TemporaryDirectory() as temp_dir: + roadmap = Path(temp_dir) / 'missing-ROADMAP.md' + + result = run_next_id(roadmap) + + self.assertNotEqual(0, result.returncode) + self.assertEqual('', result.stdout) + self.assertIn('ROADMAP not found', result.stderr) + self.assertIn(str(roadmap), result.stderr) + def test_roadmap_next_id_fails_closed_when_checker_is_unavailable(self) -> None: with tempfile.TemporaryDirectory() as temp_dir: script_dir = Path(temp_dir) / 'scripts'