Skip to content
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

Update module id #555

Merged
merged 3 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
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
2 changes: 1 addition & 1 deletion spacelift/data_aws_integration_attachment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func TestAWSIntegrationAttachmentData(t *testing.T) {
Check: Resource(
resourceName,
Attribute("id", IsNotEmpty()),
Attribute("module_id", Equals(fmt.Sprintf("test-module-%s", randomID))),
Attribute("module_id", Equals(fmt.Sprintf("terraform-default-test-module-%s", randomID))),
AttributeNotPresent("stack_id"),
),
}})
Expand Down
4 changes: 2 additions & 2 deletions spacelift/data_aws_role_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func TestAWSRoleData(t *testing.T) {
Check: Resource(
"data.spacelift_aws_role.test",
Attribute("id", IsNotEmpty()),
Attribute("module_id", Equals(fmt.Sprintf("test-module-%s", randomID))),
Attribute("module_id", Equals(fmt.Sprintf("terraform-default-test-module-%s", randomID))),
Attribute("role_arn", Equals("arn:aws:iam::039653571618:role/empty-test-role")),
Attribute("generate_credentials_in_worker", Equals("false")),
Attribute("duration_seconds", Equals("931")),
Expand Down Expand Up @@ -138,7 +138,7 @@ func TestAWSRoleData(t *testing.T) {
Check: Resource(
"data.spacelift_aws_role.test",
Attribute("id", IsNotEmpty()),
Attribute("module_id", Equals(fmt.Sprintf("test-module-%s", randomID))),
Attribute("module_id", Equals(fmt.Sprintf("terraform-default-test-module-%s", randomID))),
Attribute("role_arn", Equals("custom_role_arn")),
Attribute("generate_credentials_in_worker", Equals("true")),
Attribute("external_id", Equals("external@id")),
Expand Down
2 changes: 1 addition & 1 deletion spacelift/data_azure_integration_attachment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func TestAzureIntegrationAttachmentData(t *testing.T) {
Check: Resource(
resourceName,
Attribute("id", IsNotEmpty()),
Attribute("module_id", Equals(fmt.Sprintf("test-module-%s", randomID))),
Attribute("module_id", Equals(fmt.Sprintf("terraform-default-test-module-%s", randomID))),
AttributeNotPresent("stack_id"),
),
}})
Expand Down
2 changes: 1 addition & 1 deletion spacelift/data_context_attachment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func TestContextAttachmentData(t *testing.T) {
Check: Resource(
"data.spacelift_context_attachment.test",
Attribute("id", IsNotEmpty()),
Attribute("module_id", Equals(fmt.Sprintf("test-module-%s", randomID))),
Attribute("module_id", Equals(fmt.Sprintf("terraform-default-test-module-%s", randomID))),
Attribute("priority", Equals("1")),
AttributeNotPresent("stack_id"),
),
Expand Down
2 changes: 1 addition & 1 deletion spacelift/data_environment_variable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func TestEnvironmentVariableData(t *testing.T) {
`, randomID),
Check: Resource(
"data.spacelift_environment_variable.test",
Attribute("module_id", Equals(fmt.Sprintf("test-module-%s", randomID))),
Attribute("module_id", Equals(fmt.Sprintf("terraform-default-test-module-%s", randomID))),
Attribute("value", Equals("is tasty")),
Attribute("write_only", Equals("false")),
AttributeNotPresent("context_id"),
Expand Down
2 changes: 1 addition & 1 deletion spacelift/data_gcp_service_account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func TestGCPServiceAccountData(t *testing.T) {
Check: Resource(
"data.spacelift_gcp_service_account.test",
Attribute("id", IsNotEmpty()),
Attribute("module_id", Equals(fmt.Sprintf("test-module-%s", randomID))),
Attribute("module_id", Equals(fmt.Sprintf("terraform-defautl-test-module-%s", randomID))),
peterdeme marked this conversation as resolved.
Show resolved Hide resolved
Attribute("service_account_email", IsNotEmpty()),
SetEquals("token_scopes", "https://www.googleapis.com/auth/compute"),
AttributeNotPresent("stack_id"),
Expand Down
4 changes: 2 additions & 2 deletions spacelift/data_module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestModuleData(t *testing.T) {
`, randomID),
Check: Resource(
"data.spacelift_module.test",
Attribute("id", Equals(fmt.Sprintf("test-module-%s", randomID))),
Attribute("id", Equals(fmt.Sprintf("terraform-default-test-module-%s", randomID))),
Attribute("administrative", Equals("true")),
Attribute("branch", Equals("master")),
Attribute("description", Equals("description")),
Expand Down Expand Up @@ -117,7 +117,7 @@ func TestModuleDataSpace(t *testing.T) {
`, randomID),
Check: Resource(
"data.spacelift_module.test",
Attribute("id", Equals(fmt.Sprintf("test-module-%s", randomID))),
Attribute("id", Equals(fmt.Sprintf("terraform-default-test-module-%s", randomID))),
Attribute("administrative", Equals("true")),
Attribute("branch", Equals("master")),
Attribute("description", Equals("description")),
Expand Down
2 changes: 1 addition & 1 deletion spacelift/data_mounted_file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func TestMountedFileData(t *testing.T) {
`, randomID),
Check: Resource(
"data.spacelift_mounted_file.test",
Attribute("module_id", Equals(fmt.Sprintf("test-module-%s", randomID))),
Attribute("module_id", Equals(fmt.Sprintf("terraform-default-test-module-%s", randomID))),
Attribute("content", Equals("YmFjb24gaXMgdGFzdHk=")),
Attribute("write_only", Equals("false")),
AttributeNotPresent("context_id"),
Expand Down
2 changes: 1 addition & 1 deletion spacelift/data_stack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func TestStackData(t *testing.T) {
`, randomID),
Check: Resource(
"data.spacelift_stack.test",
Attribute("kubernetes.0.kubectl_version", Equals("1.23.5")),
Attribute("kubernetes.0.kubectl_version", IsNotEmpty()),
),
}})
})
Expand Down
2 changes: 1 addition & 1 deletion spacelift/data_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func TestWebhookData(t *testing.T) {
Attribute("endpoint", Equals("https://bacon.org")),
Attribute("enabled", Equals("true")),
Attribute("secret", Equals("very-very-secret")),
Attribute("module_id", Equals(fmt.Sprintf("test-module-%s", randomID))),
Attribute("module_id", Equals(fmt.Sprintf("terraform-default-test-module-%s", randomID))),
AttributeNotPresent("stack_id"),
),
}})
Expand Down
6 changes: 3 additions & 3 deletions spacelift/resource_aws_role_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func TestAWSRoleResource(t *testing.T) {
Check: Resource(
resourceName,
Attribute("id", IsNotEmpty()),
Attribute("module_id", Equals(fmt.Sprintf("test-module-%s", randomID))),
Attribute("module_id", Equals(fmt.Sprintf("terraform-default-test-module-%s", randomID))),
Attribute("generate_credentials_in_worker", Equals("false")),
Attribute("duration_seconds", Equals("942")),
Attribute("external_id", IsEmpty()),
Expand All @@ -94,7 +94,7 @@ func TestAWSRoleResource(t *testing.T) {
{
ResourceName: resourceName,
ImportState: true,
ImportStateId: fmt.Sprintf("module/test-module-%s", randomID),
ImportStateId: fmt.Sprintf("module/terraform-default-test-module-%s", randomID),
ImportStateVerify: true,
},
})
Expand Down Expand Up @@ -150,7 +150,7 @@ func TestAWSRoleResource(t *testing.T) {
Check: Resource(
"spacelift_aws_role.test",
Attribute("id", IsNotEmpty()),
Attribute("module_id", Equals(fmt.Sprintf("test-module-%s", randomID))),
Attribute("module_id", Equals(fmt.Sprintf("terraform-default-test-module-%s", randomID))),
Attribute("generate_credentials_in_worker", Equals("true")),
Attribute("external_id", IsEmpty()),
AttributeNotPresent("stack_id"),
Expand Down
2 changes: 1 addition & 1 deletion spacelift/resource_context_attachment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func TestContextAttachmentResource(t *testing.T) {
Check: Resource(
"spacelift_context_attachment.test",
Attribute("id", IsNotEmpty()),
Attribute("module_id", Equals(fmt.Sprintf("test-module-%s", randomID))),
Attribute("module_id", Equals(fmt.Sprintf("terraform-default-test-module-%s", randomID))),
AttributeNotPresent("stack_id"),
),
},
Expand Down
2 changes: 1 addition & 1 deletion spacelift/resource_environment_variable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func TestEnvironmentVariableResource(t *testing.T) {
`, randomID),
Check: Resource(
resourceName,
Attribute("module_id", Equals(fmt.Sprintf("test-module-%s", randomID))),
Attribute("module_id", Equals(fmt.Sprintf("terraform-default-test-module-%s", randomID))),
Attribute("value", Equals("4d5d01ea427b10dd483e8fce5b5149fb5a9814e9ee614176b756ca4a65c8f154")),
Attribute("write_only", Equals("true")),
AttributeNotPresent("context_id"),
Expand Down
4 changes: 2 additions & 2 deletions spacelift/resource_gcp_service_account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ func TestGCPServiceAccountResource(t *testing.T) {
Check: Resource(
resourceName,
Attribute("id", IsNotEmpty()),
Attribute("module_id", Equals(fmt.Sprintf("test-module-%s", randomID))),
Attribute("module_id", Equals(fmt.Sprintf("terraform-default-test-module-%s", randomID))),
),
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateId: fmt.Sprintf("module/test-module-%s", randomID),
ImportStateId: fmt.Sprintf("module/terraform-default-test-module-%s", randomID),
ImportStateVerify: true,
},
})
Expand Down
4 changes: 2 additions & 2 deletions spacelift/resource_module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestModuleResource(t *testing.T) {
Config: config("old description", true, false),
Check: Resource(
"spacelift_module.test",
Attribute("id", Equals(fmt.Sprintf("github-module-%s", randomID))),
Attribute("id", Equals(fmt.Sprintf("terraform-default-github-module-%s", randomID))),
Attribute("administrative", Equals("true")),
Attribute("branch", Equals("master")),
Attribute("description", Equals("old description")),
Expand Down Expand Up @@ -286,7 +286,7 @@ func TestModuleResourceSpace(t *testing.T) {
Config: config("old description", true),
Check: Resource(
"spacelift_module.test",
Attribute("id", Equals(fmt.Sprintf("github-module-%s", randomID))),
Attribute("id", Equals(fmt.Sprintf("terraform-default-github-module-%s", randomID))),
Attribute("administrative", Equals("true")),
Attribute("branch", Equals("master")),
Attribute("description", Equals("old description")),
Expand Down
2 changes: 1 addition & 1 deletion spacelift/resource_mounted_file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func TestMountedFileResource(t *testing.T) {
`, randomID),
Check: Resource(
resourceName,
Attribute("module_id", Equals(fmt.Sprintf("test-module-%s", randomID))),
Attribute("module_id", Equals(fmt.Sprintf("terraform-default-test-module-%s", randomID))),
Attribute("write_only", Equals("true")),
),
},
Expand Down
2 changes: 1 addition & 1 deletion spacelift/resource_policy_attachment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func TestPolicyAttachmentResource(t *testing.T) {
resourceName,
Attribute("id", IsNotEmpty()),
Attribute("policy_id", Contains(randomID)),
Attribute("module_id", Equals(fmt.Sprintf("test-module-%s", randomID))),
Attribute("module_id", Equals(fmt.Sprintf("terraform-default-test-module-%s", randomID))),
),
},
{
Expand Down
2 changes: 1 addition & 1 deletion spacelift/resource_stack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ func TestStackResource(t *testing.T) {
resourceName,
Attribute("id", StartsWith("provider-test-stack")),
Attribute("kubernetes.0.namespace", Equals("myapp-prod")),
Attribute("kubernetes.0.kubectl_version", Equals("1.23.5")),
Attribute("kubernetes.0.kubectl_version", IsNotEmpty()),
Attribute("ansible.#", Equals("0")),
Attribute("pulumi.#", Equals("0")),
Attribute("cloudformation.#", Equals("0")),
Expand Down
2 changes: 1 addition & 1 deletion spacelift/resource_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func TestWebhookResource(t *testing.T) {
{
ResourceName: resourceName,
ImportState: true,
ImportStateIdPrefix: fmt.Sprintf("module/test-module-%s/", randomID),
ImportStateIdPrefix: fmt.Sprintf("module/terraform-default-test-module-%s/", randomID),
ImportStateVerify: true,
},
})
Expand Down
Loading