feat: add test cases to existing test run via updateTestRun#333
feat: add test cases to existing test run via updateTestRun#333SavioBS629 wants to merge 2 commits into
Conversation
SavioBS629
left a comment
There was a problem hiding this comment.
Claude Code Review (automated) — 2 inline finding(s). Full report in the PR comment below. Verdict: Passed.
| */ | ||
| const TestCaseSelectionSchema = z.object({ | ||
| test_case_ids: z.array(z.string()).describe("Test case IDs, e.g. TC-123"), | ||
| configuration_ids: z |
There was a problem hiding this comment.
[Medium] No .min(1) on test_case_ids — empty selection fires a no-op PATCH reported as success
hasTestCases only checks the outer add_test_cases array length, so add_test_cases: [{ test_case_ids: [] }] fires a real PATCH to /test-cases with an empty selection and returns "...(added 0); changes apply asynchronously." as if it did something — a real API side effect masquerading as a no-op.
Suggestion: Add .min(1) to test_case_ids (and consider it on add_test_cases), and/or filter empty selections before building the request body.
| configuration_ids: z | |
| test_case_ids: z | |
| .array(z.string()) | |
| .min(1) | |
| .describe("Test case IDs, e.g. TC-123"), |
Reviewer: stack:code-reviewer
| }, | ||
| }; | ||
|
|
||
| const tmBaseUrl = await getTMBaseURL(config); |
There was a problem hiding this comment.
[Medium] Duplicate getTMBaseURL round-trips when both concerns are supplied
Both updateTestRunMetadata and this helper call getTMBaseURL(config) independently. The module-level cache in tm-base-url.ts is intentionally skipped in REMOTE_MCP mode, so a call supplying both name/run_state and add_test_cases runs the region-discovery probe twice — doubling latency/API load, and letting the two sub-requests theoretically land on different regions if one probe flakes.
Suggestion: Resolve tmBaseUrl once in the updateTestRun dispatcher and pass it into both helpers; optionally Promise.all the two independent PATCHes.
Reviewer: stack:code-reviewer
Claude Code PR ReviewPR: #333 • Head: SummarySplits Review Table
Findings
Non-blocking notes
Raised by other reviewers (not independently confirmed)None — no human reviewer comments on this PR. Verdict: PASS — the refactor and new capability are correct with a solid test suite and no security/regression issues; the two Medium items (double base-URL resolution in remote mode, empty-selection validation gap) and the Low test/dedup items are recommended before merge but non-gating. |
No description provided.