- Notifications
You must be signed in to change notification settings - Fork923
feat(provisioner): add support for workspace_owner_login_type#15499
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -383,6 +383,8 @@ func TestProvision(t *testing.T) { | ||
ExpectLogContains string | ||
// If Apply is true, then send an Apply request and check we get the same Resources as in Response. | ||
Apply bool | ||
// Some tests may need to be skipped until the relevant provider version is released. | ||
SkipReason string | ||
}{ | ||
{ | ||
Name: "missing-variable", | ||
@@ -703,13 +705,57 @@ func TestProvision(t *testing.T) { | ||
}}, | ||
}, | ||
}, | ||
{ | ||
Name: "workspace-owner-login-type", | ||
SkipReason: "field will be added in provider version 1.1.0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. note: I'm getting the ducks in a row now so that when the provider is released we can lock this in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Nit: I wonder if we could expand this to be more strictly version-dependent? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. That would be wonderful to have! | ||
Files: map[string]string{ | ||
"main.tf": `terraform { | ||
required_providers { | ||
coder = { | ||
source = "coder/coder" | ||
version = "1.1.0" | ||
} | ||
} | ||
} | ||
resource "null_resource" "example" {} | ||
data "coder_workspace_owner" "me" {} | ||
resource "coder_metadata" "example" { | ||
resource_id = null_resource.example.id | ||
item { | ||
key = "login_type" | ||
value = data.coder_workspace_owner.me.login_type | ||
} | ||
} | ||
`, | ||
}, | ||
Request: &proto.PlanRequest{ | ||
Metadata: &proto.Metadata{ | ||
WorkspaceOwnerLoginType: "github", | ||
}, | ||
}, | ||
Response: &proto.PlanComplete{ | ||
Resources: []*proto.Resource{{ | ||
Name: "example", | ||
Type: "null_resource", | ||
Metadata: []*proto.Resource_Metadata{{ | ||
Key: "login_type", | ||
Value: "github", | ||
}}, | ||
}}, | ||
}, | ||
}, | ||
} | ||
for _, testCase := range testCases { | ||
testCase := testCase | ||
t.Run(testCase.Name, func(t *testing.T) { | ||
t.Parallel() | ||
if testCase.SkipReason != "" { | ||
t.Skip(testCase.SkipReason) | ||
} | ||
ctx, api := setupProvisioner(t, nil) | ||
sess := configure(ctx, t, api, &proto.Config{ | ||
TemplateSourceArchive: makeTar(t, testCase.Files), | ||
Large diffs are not rendered by default.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.