Repository navigation
test(coderd): test chat workspace functions through their tools - #32433
Draft
ethanndickson wants to merge 2 commits into
Draft
ethanndickson wants to merge 2 commits into
ethanndickson wants to merge 2 commits into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes CODAGT-292
Relates to CODAGT-1607
coderd/export_test.gore-exportedchatCreateWorkspace,chatStartWorkspace,chatStopWorkspaceandchatRenderTemplateParameters, 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.chatStopWorkspacewas just the start function without that decision, so both tools now sharechatBuildWorkspace. 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, aswsbuilderreads both anyway.TestStartWorkspaceTool_EndToEndnow requires the active version, so we still know the result makes it into the build.chatRenderTemplateParameterskeeps a direct test, it's just an internal one now, against a database instead of a wholecoderd. 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 tochatdand runs through thecreate_workspacetool.