Repository navigation
test(coderd): run the TestPostChats model and org rejections on one server - #30975
ibetitsmike wants to merge 2 commits into
Conversation
…erver Nine rejection subtests of TestPostChats each started a coderd server and AI Bridge daemon to make one request. Add a Rejects table on one shared server and move the model and organization cases into it. Each case creates its own orgs, users, providers, or configs in prepare.
|
@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. 👍 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". |
TestPostChatsstarted a full coderd and AI Bridge daemon for each of its 34 subtests. This PR adds aRejectstable on one shared server and moves the 9 model and organization rejection subtests into it: the non-default org model cases, disabled, provider-disabled and denied model configs,NilOrganizationID, andNonMemberOrganization. Each case creates its own state inprepareand returns the caller.Four rejection subtests keep their own servers because they need or change state that the cases share:
MissingDefaultModelConfigneeds a default org with no model,ProviderDisabledDefaultModelRejecteddisables the default model's provider,DeniedSameOrganizationDefaultIsRejectedadds a second default model to the org, andAgentsAccessDefaultRolerewrites org roles.Why it is safe
Detail(empty where the old subtests did not check it).postChatsand its model helpers and ran the old and new test files against each one. The old file caught 8 and the new file catches the same 8, each in the case that owns it. The 3 mutants that both survive return the same response through another check: dbauthz hides other-org configs from members, and the provider status check repeats the provider-enabled check.Review focus
Cases run in parallel against one deployment. Each case writes only to its own new orgs, users, providers, or non-default configs. No case changes the default model, its provider, or member roles.
Timing
From 5 alternating runs, the moved subtests took 3.12 s summed (median); the table setup plus its 9 cases take 0.59 s.
Validation
go test ./coderd -run '^TestPostChats$' -count=3: pass-race: passgo test -overlaymutant runs against the old and new test files: results abovego vet ./coderdandgolangci-lint run ./coderd/...: clean; the pre-commit hook passedStack
The stack runs every isolated
TestPostChatsrejection case on one shared server instead of one server per case.