Skip to content

test(coderd): run the TestPostChats model and org rejections on one server - #30975

Draft
ibetitsmike wants to merge 2 commits into
mainfrom
mike/coderd-post-chats-shared-fixture
Draft

ibetitsmike wants to merge 2 commits into
mainfrom
mike/coderd-post-chats-shared-fixture

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

TestPostChats started a full coderd and AI Bridge daemon for each of its 34 subtests. This PR adds a Rejects table 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, and NonMemberOrganization. Each case creates its own state in prepare and returns the caller.

Four rejection subtests keep their own servers because they need or change state that the cases share: MissingDefaultModelConfig needs a default org with no model, ProviderDisabledDefaultModelRejected disables the default model's provider, DeniedSameOrganizationDefaultIsRejected adds a second default model to the org, and AgentsAccessDefaultRole rewrites org roles.

Why it is safe

  • Cases keep the old subtest names, callers, status, and message checks, and now also check the exact Detail (empty where the old subtests did not check it).
  • I mutated 11 lines in postChats and 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
  • the same run with -race: pass
  • go test -overlay mutant runs against the old and new test files: results above
  • go vet ./coderd and golangci-lint run ./coderd/...: clean; the pre-commit hook passed

Stack

The stack runs every isolated TestPostChats rejection case on one shared server instead of one server per case.

  1. test(coderd): run the TestPostChats model and org rejections on one server #30975 Model and organization rejection cases (this PR)
  2. test(coderd): run the TestPostChats workspace, input, and MCP rejections on one server #30976 Workspace, request input, and MCP server rejection cases

Xum, an AI agent, opened this PR for @ibetitsmike and wrote this description.

…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.
@ibetitsmike
ibetitsmike added this pull request to stack #30977 October 18, 2026 16:11
@ibetitsmike ibetitsmike changed the title mike/coderd post chats shared fixture test(coderd): run the TestPostChats model and org rejections on one server Oct 18, 2026
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T17:09:22.282695Z aef161c Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: ae572bad9a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

Xum, an AI agent, posted this comment for @ibetitsmike.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: aef161cb2e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant