test(pi): no-prompt branch with --model emits --provider ollama (no -p)#22
Open
hggz wants to merge 2 commits intocapotej:mainfrom
Open
test(pi): no-prompt branch with --model emits --provider ollama (no -p)#22hggz wants to merge 2 commits intocapotej:mainfrom
hggz wants to merge 2 commits intocapotej:mainfrom
Conversation
Covers the `prompt === null` arm of `PiAdapter.buildCommand`. That branch is only reachable when stdin is a TTY, so we allocate a pty via util-linux `script` to fake interactive mode (and skip the test if `script` is unavailable, though it is preinstalled on ubuntu-latest). Asserts: * exit 0 * pi argv contains no stray `-p` * pi argv tail is exactly `pi --provider ollama --model <model>` Pairs with the existing positive (`-p` + `-m`) test to lock down both arms of the no-env-file local-mode logic. Verified locally: 20/20 tests pass.
Owner
|
needs a rebase |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
test(pi): no-prompt branch with --model emits --provider ollama (no -p)
What
Covers the
prompt === nullarm ofPiAdapter.buildCommand— i.e. interactivepiwith-mand no-p:Currently only the prompt+model arm is asserted by the existing test renamed in #16. This PR adds coverage for the no-prompt arm.
Why
That branch is only reachable when
process.stdin.isTTY === true, so a plainspawnSynctest cannot hit it (subprocess stdin is never a TTY). To exercise it, the new test allocates a pty via util-linuxscript:…then strips CR characters from the output and parses the
DOCKER_INVOKEDline as usual. The test self-skips ifcommand -v scriptis unavailable (it is preinstalled onubuntu-latest).The test asserts:
-ppi --provider ollama --model <model>How verified