Skip to content

test(coderd): test chat workspace functions through their tools - #32433

Draft
ethanndickson wants to merge 2 commits into
mainfrom
ethan/chat-workspace-tool-tests
Draft

ethanndickson wants to merge 2 commits into
mainfrom
ethan/chat-workspace-tool-tests

Conversation

@ethanndickson

@ethanndickson ethanndickson commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Closes CODAGT-292
Relates to CODAGT-1607

coderd/export_test.go re-exported chatCreateWorkspace, chatStartWorkspace, chatStopWorkspace and chatRenderTemplateParameters, just so four tests could call them directly. This PR removes those tests and their aliases, and the last alias in that file goes in the next PR in the stack.

The start and stop tests only checked which template version the build ends up on, so that decision is now a pure function, resolveChatStartVersion, with a table test. chatStopWorkspace was just the start function without that decision, so both tools now share chatBuildWorkspace. As a result, a stop reads the template and the latest build too, even though it doesn't use them. I think that's fine, as wsbuilder reads both anyway. TestStartWorkspaceTool_EndToEnd now requires the active version, so we still know the result makes it into the build.

chatRenderTemplateParameters keeps a direct test, it's just an internal one now, against a database instead of a whole coderd. It no longer checks the owner default, as that's already tested in the renderer and in the tool. The bind failure test needs a real transaction, so it moves to chatd and runs through the create_workspace tool.

@linear-code

linear-code Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

CODAGT-292

CODAGT-1607

chatStartWorkspace and chatStopWorkspace become one function,
chatBuildWorkspace, and the active version decision moves to
resolveChatStartVersion, which has a table test.
chatRenderTemplateParameters gets a direct internal test. The start
end-to-end test proves the call site, so the stop and read_template
end-to-end tests are removed.

This branch was successfully deployed

1 active deployment
main — fd193ac3 Deployed Nov 19, 2026 by ethanndickson via cla #260210
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