Repository navigation
test(coderd/x/chatd/chattest): table the OpenAI fake positive tests and fail on error streams - #30948
ibetitsmike wants to merge 2 commits into
Conversation
…nd fail on error streams
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review
|
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
The six OpenAI fake positive tests in
openai_test.gobecome three table tests,TestOpenAI_StreamingText,TestOpenAI_NonStreamingTextandTestOpenAI_ToolCalls, each with a Completions API row and a Responses API row. The rows also check more than the old tests did: streaming rows fail on any error part and assert the exact text deltas, and non-streaming rows assert the returned text. The old Responses streaming test passed on a stream that held only an error, and both non-streaming tests checked onlyNoErrorandNotNil.Why it is safe
NoErrorandNotNil.go test -overlay. Seven pass the old test that targets the mutated behavior and fail the new rows: an error-only Responses stream, an error part after the Completions text, an error instead ofresponse.completed, empty non-streaming text in either format, and doubled or dropped Responses deltas. The other five (an error-only Completions stream, doubled Completions deltas, a truncatedOpenAITextChunks, and a dropped tool call in either format) fail both the old tests and the new rows.main.Review focus
The Responses streaming row now uses the same two-choice text chunks as the Completions row, so both formats share one expected delta list.
Validation
go test ./coderd/x/chatd/chattest/ -count=1: okgo vet ./coderd/x/chatd/chattest/: okgolangci-lint run --fix=false ./coderd/x/chatd/chattest/: 0 issuesStack
The stack makes the chattest fake tests fail on wrong output, then drops the fakes' write-only state and shares their response-shape check.