mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
feat: add cli support for --require-active-version (#10337)
This commit is contained in:
@ -610,7 +610,7 @@ func CreateAnotherUserMutators(t testing.TB, client *codersdk.Client, organizati
|
||||
func createAnotherUserRetry(t testing.TB, client *codersdk.Client, organizationID uuid.UUID, retries int, roles []string, mutators ...func(r *codersdk.CreateUserRequest)) (*codersdk.Client, codersdk.User) {
|
||||
req := codersdk.CreateUserRequest{
|
||||
Email: namesgenerator.GetRandomName(10) + "@coder.com",
|
||||
Username: randomUsername(t),
|
||||
Username: RandomUsername(t),
|
||||
Password: "SomeSecurePassword!",
|
||||
OrganizationID: organizationID,
|
||||
}
|
||||
@ -744,7 +744,7 @@ func CreateWorkspaceBuild(
|
||||
// compatibility with testing. The name assigned is randomly generated.
|
||||
func CreateTemplate(t testing.TB, client *codersdk.Client, organization uuid.UUID, version uuid.UUID, mutators ...func(*codersdk.CreateTemplateRequest)) codersdk.Template {
|
||||
req := codersdk.CreateTemplateRequest{
|
||||
Name: randomUsername(t),
|
||||
Name: RandomUsername(t),
|
||||
VersionID: version,
|
||||
}
|
||||
for _, mut := range mutators {
|
||||
@ -906,7 +906,7 @@ func CreateWorkspace(t testing.TB, client *codersdk.Client, organization uuid.UU
|
||||
t.Helper()
|
||||
req := codersdk.CreateWorkspaceRequest{
|
||||
TemplateID: templateID,
|
||||
Name: randomUsername(t),
|
||||
Name: RandomUsername(t),
|
||||
AutostartSchedule: ptr.Ref("CRON_TZ=US/Central 30 9 * * 1-5"),
|
||||
TTLMillis: ptr.Ref((8 * time.Hour).Milliseconds()),
|
||||
AutomaticUpdates: codersdk.AutomaticUpdatesNever,
|
||||
@ -1170,7 +1170,7 @@ func NewAzureInstanceIdentity(t testing.TB, instanceID string) (x509.VerifyOptio
|
||||
}
|
||||
}
|
||||
|
||||
func randomUsername(t testing.TB) string {
|
||||
func RandomUsername(t testing.TB) string {
|
||||
suffix, err := cryptorand.String(3)
|
||||
require.NoError(t, err)
|
||||
suffix = "-" + suffix
|
||||
|
Reference in New Issue
Block a user