Skip to content

feat(cli): support non-active template version pushes #7488

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 10 commits into from
Jun 3, 2023
Prev Previous commit
Fix tests
  • Loading branch information
ammario committed Jun 3, 2023
commit eb30242d8d6530017ec179faa425f6650bb48a0b
10 changes: 3 additions & 7 deletions cli/templatepush_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,10 @@ func TestTemplatePush(t *testing.T) {
Parse: echo.ParseComplete,
ProvisionApply: echo.ProvisionComplete,
})
inv, root := clitest.New(t, "templates", "push", template.Name, "--activate", "false", "--directory", source, "--test.provisioner", string(database.ProvisionerTypeEcho), "--name", "example")
inv, root := clitest.New(t, "templates", "push", template.Name, "--activate=false", "--directory", source, "--test.provisioner", string(database.ProvisionerTypeEcho), "--name", "example")
clitest.SetupConfig(t, client, root)
pty := ptytest.New(t).Attach(inv)

execDone := make(chan error)
go func() {
execDone <- inv.Run()
}()
w := clitest.StartWithWaiter(t, inv)

matches := []struct {
match string
Expand All @@ -103,7 +99,7 @@ func TestTemplatePush(t *testing.T) {
pty.WriteLine(m.write)
}

require.NoError(t, <-execDone)
w.RequireSuccess()

// Assert that the template version didn't change.
templateVersions, err := client.TemplateVersionsByTemplate(context.Background(), codersdk.TemplateVersionsByTemplateRequest{
Expand Down