Skip to content

fix(cli): handle version mismatch re MatchedProvisioners response #15682

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 9 commits into from
Nov 29, 2024
Prev Previous commit
Next Next commit
use ptytest instead of a strings.Builder to assert cli output
  • Loading branch information
johnstcn committed Nov 29, 2024
commit bbb2861fbb47c9cc8f1d689a08e2216b29e60028
11 changes: 5 additions & 6 deletions cli/templatepush_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -536,11 +536,9 @@ func TestTemplatePush(t *testing.T) {

templateName := strings.ReplaceAll(testutil.GetRandomName(t), "_", "-")

var output strings.Builder
inv, root := clitest.New(t, "templates", "push", templateName, "-d", tempDir, "--yes")
inv.Stdout = &output
inv.Stderr = &output
clitest.SetupConfig(t, templateAdmin, root)
pty := ptytest.New(t).Attach(inv)

ctx := testutil.Context(t, testutil.WaitShort)
now := dbtime.Now()
Expand All @@ -563,12 +561,13 @@ func TestTemplatePush(t *testing.T) {
}
return assert.EqualValues(t, wantTags, jobs[0].Tags)
}, testutil.WaitShort, testutil.IntervalFast)
cancel()
<-done

if tt.expectOutput != "" {
require.Contains(t, output.String(), tt.expectOutput)
pty.ExpectMatch(tt.expectOutput)
}

cancel()
<-done
})
}
})
Expand Down
Loading