8000 fix: avoid sharing `echo.Responses` across tests by ethanndickson · Pull Request #17211 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

fix: avoid sharing echo.Responses across tests #17211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 2, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup
  • Loading branch information
ethanndickson committed Apr 2, 2025
commit d7ac581e34085c7f027d00480f68c870079ecaeb
12 changes: 7 additions & 5 deletions cli/restart_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,8 @@ func TestRestart(t *testing.T) {
func TestRestartWithParameters(t *testing.T) {
t.Parallel()

t.Run("DoNotAskForImmutables", func(t *testing.T) {
t.Parallel()

echoResponses := &echo.Responses{
echoResponses := func() *echo.Responses {
return &echo.Responses{
Parse: echo.ParseComplete,
ProvisionPlan: []*proto.Response{
{
Expand All @@ -304,12 +302,16 @@ func TestRestartWithParameters(t *testing.T) {
},
ProvisionApply: echo.ApplyComplete,
}
}

t.Run("DoNotAskForImmutables", func(t *testing.T) {
t.Parallel()

// Create the workspace
client := coderdtest.New(t, &coderdtest.Options{IncludeProvisionerDaemon: true})
owner := coderdtest.CreateFirstUser(t, client)
member, _ := coderdtest.CreateAnotherUser(t, client, owner.OrganizationID)
version := coderdtest.CreateTemplateVersion(t, client, owner.OrganizationID, echoResponses)
version := coderdtest.CreateTemplateVersion(t, client, owner.OrganizationID, echoResponses())
coderdtest.AwaitTemplateVersionJobCompleted(t, client, version.ID)
template := coderdtest.CreateTemplate(t, client, owner.OrganizationID, version.ID)
workspace := coderdtest.CreateWorkspace(t, member, template.ID, func(cwr *codersdk.CreateWorkspaceRequest) {
Expand Down
Loading
0