Run cc-architect spawning tests in-process #1336

Closed
opened 2026-10-25 19:48:34 +00:00 by jared · 2 comments
Owner

Problem

Four cc-architect test files under plugins/cc-architect/scripts/plugin_config/test/ start the script with Open3.capture3('ruby', SCRIPT_PATH, ...): test_entry_point (7 tests), test_validate_entry_point (3), test_cli_invocation_seam (7), and test_runtime_verifier (8).

Approach

Call PluginConfig::Cli.run(argv, Invocation.for_test) in place of each spawn.

Behavior is unchanged. The existing suite is the proof. Each bin or hook keeps exactly one smoke test, in a file named <bin>_bin_smoke_test.rb. The smoke test runs it as a subprocess to prove the plain-ruby boot and the shebang. Calls to external tools (git, rubocop) stay as subprocess calls.

Required work:

  1. Convert the four test files to call PluginConfig::Cli.run(argv, Invocation.for_test).
  2. Add one <script>_bin_smoke_test.rb file per script.
  3. Remove the spawn from the converted tests — check: absent SCRIPT_PATH in plugins/cc-architect/scripts/plugin_config/test/test_entry_point.rb

Acceptance criteria

  1. Given the converted tests, when the suite runs, then no test outside a *_bin_smoke_test.rb file starts a plugin bin/ or hooks/ script as a subprocess.
  2. Given each bin and hook, when its smoke test runs, then it boots with plain ruby and exits 0 on --help or on empty valid input.
  3. Given the converted tests, when they run, then they pass with the same assertions as before.

Owner sketch

PluginConfig::Cli.run(argv, Invocation.for_test).

Origin

  • Trigger: ruby plugins/os-sdlc/tests/all.rb took 65.8 s against a 60 s budget. About 70% of summed test time is tests that start our own bin scripts with Open3.
  • Improvised this session: none
  • Chain: suite over budget ← tests start our own Ruby bin, hook, or CLI as a subprocess (Ruby boot cost per call) ← no rule says to call the in-process entry (Jared ruling, 2026-10-25; habit, no ADR)
  • Root candidate: none found; searched Open3, subprocess, in-process, bin_test, run_bin, Boot.run, ProcessIO
  • Where: plugins/cc-architect/scripts/plugin_config/test
  • Session: 01c29715-c945-43b4-86fc-6c5fc6c4dd3f
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/01c29715-c945-43b4-86fc-6c5fc6c4dd3f.jsonl
## Problem Four cc-architect test files under `plugins/cc-architect/scripts/plugin_config/test/` start the script with `Open3.capture3('ruby', SCRIPT_PATH, ...)`: `test_entry_point` (7 tests), `test_validate_entry_point` (3), `test_cli_invocation_seam` (7), and `test_runtime_verifier` (8). ## Approach Call `PluginConfig::Cli.run(argv, Invocation.for_test)` in place of each spawn. Behavior is unchanged. The existing suite is the proof. Each bin or hook keeps exactly one smoke test, in a file named `<bin>_bin_smoke_test.rb`. The smoke test runs it as a subprocess to prove the plain-ruby boot and the shebang. Calls to external tools (git, rubocop) stay as subprocess calls. Required work: 1. Convert the four test files to call `PluginConfig::Cli.run(argv, Invocation.for_test)`. 2. Add one `<script>_bin_smoke_test.rb` file per script. 3. Remove the spawn from the converted tests — check: absent `SCRIPT_PATH` in `plugins/cc-architect/scripts/plugin_config/test/test_entry_point.rb` ## Acceptance criteria 1. Given the converted tests, when the suite runs, then no test outside a `*_bin_smoke_test.rb` file starts a plugin `bin/` or `hooks/` script as a subprocess. 2. Given each bin and hook, when its smoke test runs, then it boots with plain ruby and exits 0 on `--help` or on empty valid input. 3. Given the converted tests, when they run, then they pass with the same assertions as before. ## Owner sketch `PluginConfig::Cli.run(argv, Invocation.for_test)`. ## Origin - Trigger: `ruby plugins/os-sdlc/tests/all.rb` took 65.8 s against a 60 s budget. About 70% of summed test time is tests that start our own bin scripts with Open3. - Improvised this session: none - Chain: suite over budget ← tests start our own Ruby bin, hook, or CLI as a subprocess (Ruby boot cost per call) ← no rule says to call the in-process entry (Jared ruling, 2026-10-25; habit, no ADR) - Root candidate: none found; searched Open3, subprocess, in-process, bin_test, run_bin, Boot.run, ProcessIO - Where: plugins/cc-architect/scripts/plugin_config/test - Session: 01c29715-c945-43b4-86fc-6c5fc6c4dd3f - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/01c29715-c945-43b4-86fc-6c5fc6c4dd3f.jsonl
Author
Owner

Work started in /os-sdlc:fast-batch fast-batch-15, branch fast-batch-15.

Work started in /os-sdlc:fast-batch fast-batch-15, branch fast-batch-15.
Author
Owner

Resolution

Done: cc-architect plugin_config and validate_marketplaces tests call their entries in-process; one smoke test per script.

Evidence: Finding H daaadaa3; fix R13 cc456125. Suites at c9f5db8f: os-sdlc 2701 runs 0 failures (53.1 s, budget 60 s), os 47, os-backlog 327, os-aidd-lint 491, os-adr 111, os-me 399, cc-architect plugin_config 106, all green. Merged to main c9f5db8f, pushed be5d2c5d. Batch state and rulings: docs/crc/os-sdlc/fast-batch-15/.

Follow-ups: #1337 (cop; it must decide the cc-architect smoke-file naming test_*_bin_smoke.rb). Dropped: the ModuleLength [114/100] on the moved ValidateMarketplaces module (ruling R23: code move only).

## Resolution **Done:** cc-architect plugin_config and validate_marketplaces tests call their entries in-process; one smoke test per script. **Evidence:** Finding H daaadaa3; fix R13 cc456125. Suites at c9f5db8f: os-sdlc 2701 runs 0 failures (53.1 s, budget 60 s), os 47, os-backlog 327, os-aidd-lint 491, os-adr 111, os-me 399, cc-architect plugin_config 106, all green. Merged to main c9f5db8f, pushed be5d2c5d. Batch state and rulings: docs/crc/os-sdlc/fast-batch-15/. **Follow-ups:** #1337 (cop; it must decide the cc-architect smoke-file naming test_*_bin_smoke.rb). Dropped: the ModuleLength [114/100] on the moved ValidateMarketplaces module (ruling R23: code move only).
jared closed this issue 2026-10-26 21:21:29 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jared/cc-os#1336
No description provided.