Repository navigation
test: cover selectPoolSandbox empty-pod-list branch - #70
Merged
Merged
Conversation
Add a unit test for the branch in select-sandbox.ts that throws a plain
Error("no Running pods for pool selector ...") when a pool selector is
configured but listPoolPods returns an empty list. This branch was
previously untested: the existing null-return test passes an empty list
only through the no-selector fallback path and never reaches the guard.
The test asserts the rejection is a plain Error, is distinct from
SandboxPoolSaturatedError, and carries the exact message.
Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
5 tasks done
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.
Closes #56.
Follow-up from P2 (#46, PR #53).
harness/src/select-sandbox.tsthrows a plainError("no Running pods for pool selector ...")when a pool selector is configured butlistPoolPodsreturns an empty list. This branch was previously untested — the existing null-return test passes an empty list only through the no-selector fallback path (returningnull) and never reaches the guard on line 59.Change
Add one unit test to
harness/test/select-sandbox.test.tsthat:KAGENTI_SANDBOX_POOL_SELECTORand stubslistPods: async () => []ErrorSandboxPoolSaturatedErrorno Running pods for pool selector 'app=sandbox'The exact-message assertion also serves as the branch guard: nothing else in the module emits that string, so a pass proves the empty-list branch executed.
Verification
vitest run test/select-sandbox.test.ts→ 6 passed (5 existing + new)tsc --noEmittypecheck → cleanNo dependency or source changes; test-only.
Assisted-By: Claude Code