Challenge the subprocess test in project_test_path_default_test.rb #923
Labels
No labels
P0
P1
P2
P3
bug
category/code-change
category/cross-repo
category/eval-run
category/investigation
category/no-test-target
category/owner-ruling
category/prose-artifact
category/recurring-chore
category/structure
category/umbrella
crc-refactor
create
delete
enhancement
filed-by/agent
filed-by/user
frozen
lint-rule
needs-info
needs-triage
next
plugin/cc-architect
plugin/os
plugin/os-adr
plugin/os-aidd-lint
plugin/os-backlog
plugin/os-context
plugin/os-doc-hygiene
plugin/os-sdlc
plugin/os-vault
project/cc-os
ready-for-agent
ready-for-human
recurring
review
rule-proposal
update
waiting
wayfinder:grilling
wayfinder:map
wayfinder:map
wayfinder:research
wayfinder:task
wayfinder:task
wontfix
worklist/deviations
worklist/lint-rule
worklist/new-implement-build
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/cc-os#923
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Jared 2026-10-03: "Now I think we should be challenging the slow test."
The test
test_project_config_writes_spec_test_path_when_only_spec_dir_existsinplugins/os-sdlc/tests/model/project_test_path_default_test.rb:43starts a child process:Open3.capture3(File.expand_path("../../bin/os-sdlc", __dir__), "project-config", "widgets", chdir: dir).Jared treats the slow test as a symptom that something is wrong with the test.
This ticket needs a design ruling from Jared: delete the test, or reshape it.
Observed
Commit
5d0a1cd6(#860) changed the test from one subprocess to another subprocess.Before
5d0a1cd6it ranruby -I lib -ewith a script that builtOsSdlc::Project::ConfigCommand(child process, not in-process).Jared's premise was that the test built
ConfigCommandin-process.That premise is false: both versions spawn a child process.
The only change is that the child now boots
bin/os-sdlcand goes throughOnboarding.start.The test discards the exit status and stdout, and asserts only
written["test_path"] == "spec"(line 52).The whole file runs in 0.24 s (4 runs);
ruby -Itests -Ilib tests/model/project_test_path_default_test.rbtakes 0.92 s wall time. The slowness is therefore a subprocess boot cost, not a long test.Reproduce
n/a: test-design challenge, nothing to reproduce.
Approach
Challenge the test with Jared's questions, then rule: delete or reshape.
project-configwritestest_path: specwhen onlyspec/exists.plugins/os-sdlc/tests/controller/project/cli_project_config_test.rb:40(test_project_config_detects_spec_directory_and_writes_test_path) createsspec/and assertstest_path: "spec"throughProject::Config.load. It looks like a duplicate in-process test of the same behavior.ConfigCommandto reach one detection rule (ConfigCommand#with_detected_test_path,plugins/os-sdlc/lib/os_sdlc/command/project/config_command.rb:28). The same file also holds threeProject::Config.loaddefault tests (lines 8-39) that need no subprocess.plugins/os-sdlc/tests/controller/project/cli_project_config_help_test.rb:66callsOsSdlc::Project::Onboarding.start(argv, invocation: io)in-process with aProcessIObuilt overStringIO. This test uses a real subprocess instead, and the file is also intests/model/while its subject is a controller/command.Onboarding.startpattern, or move it beside the other project-config controller tests. State the reason with the ruling.Required work: none beyond the acceptance criteria.
Acceptance criteria
plugins/os-sdlc/tests/model/project_test_path_default_test.rbruns, then no test in it starts a child process.Origin
5d0a1cd6) kept a subprocess and moved it tobin/os-sdlc← the original test (before #860) already used a subprocess (DESIGN: no ADR; fileplugins/os-sdlc/tests/model/project_test_path_default_test.rb)VERDICT: CREATE