From 06f57962e821f7706e43b173373e46b6bdccad5e Mon Sep 17 00:00:00 2001 From: Piotr Truszkowski Date: Tue, 14 May 2024 10:42:33 +0200 Subject: [PATCH] fix tests: adding "terraform-default-" and kubeclt v1.30.0 --- spacelift/data_aws_integration_attachment_test.go | 2 +- spacelift/data_aws_role_test.go | 4 ++-- spacelift/data_azure_integration_attachment_test.go | 2 +- spacelift/data_context_attachment_test.go | 2 +- spacelift/data_environment_variable_test.go | 2 +- spacelift/data_gcp_service_account_test.go | 2 +- spacelift/data_module_test.go | 2 +- spacelift/data_mounted_file_test.go | 2 +- spacelift/data_stack_test.go | 2 +- spacelift/data_webhook_test.go | 2 +- spacelift/resource_aws_role_test.go | 6 +++--- spacelift/resource_context_attachment_test.go | 4 ++-- spacelift/resource_environment_variable_test.go | 2 +- spacelift/resource_gcp_service_account_test.go | 4 ++-- spacelift/resource_module_test.go | 8 ++++---- spacelift/resource_mounted_file_test.go | 2 +- spacelift/resource_policy_attachment_test.go | 4 ++-- spacelift/resource_stack_test.go | 4 ++-- spacelift/resource_webhook_test.go | 2 +- 19 files changed, 29 insertions(+), 29 deletions(-) diff --git a/spacelift/data_aws_integration_attachment_test.go b/spacelift/data_aws_integration_attachment_test.go index 0c6b8e2b..4449e810 100644 --- a/spacelift/data_aws_integration_attachment_test.go +++ b/spacelift/data_aws_integration_attachment_test.go @@ -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"), ), }}) diff --git a/spacelift/data_aws_role_test.go b/spacelift/data_aws_role_test.go index a99334f4..d7d2a94e 100644 --- a/spacelift/data_aws_role_test.go +++ b/spacelift/data_aws_role_test.go @@ -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")), @@ -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")), diff --git a/spacelift/data_azure_integration_attachment_test.go b/spacelift/data_azure_integration_attachment_test.go index 398e110d..d1c1782b 100644 --- a/spacelift/data_azure_integration_attachment_test.go +++ b/spacelift/data_azure_integration_attachment_test.go @@ -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"), ), }}) diff --git a/spacelift/data_context_attachment_test.go b/spacelift/data_context_attachment_test.go index c6fa2e4d..c058bda8 100644 --- a/spacelift/data_context_attachment_test.go +++ b/spacelift/data_context_attachment_test.go @@ -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"), ), diff --git a/spacelift/data_environment_variable_test.go b/spacelift/data_environment_variable_test.go index ed8e501d..bdf6ef6c 100644 --- a/spacelift/data_environment_variable_test.go +++ b/spacelift/data_environment_variable_test.go @@ -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"), diff --git a/spacelift/data_gcp_service_account_test.go b/spacelift/data_gcp_service_account_test.go index 6649c196..d4a81d1e 100644 --- a/spacelift/data_gcp_service_account_test.go +++ b/spacelift/data_gcp_service_account_test.go @@ -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-default-test-module-%s", randomID))), Attribute("service_account_email", IsNotEmpty()), SetEquals("token_scopes", "https://www.googleapis.com/auth/compute"), AttributeNotPresent("stack_id"), diff --git a/spacelift/data_module_test.go b/spacelift/data_module_test.go index 205b8ade..3f4f5db4 100644 --- a/spacelift/data_module_test.go +++ b/spacelift/data_module_test.go @@ -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")), diff --git a/spacelift/data_mounted_file_test.go b/spacelift/data_mounted_file_test.go index f44d98aa..25f53500 100644 --- a/spacelift/data_mounted_file_test.go +++ b/spacelift/data_mounted_file_test.go @@ -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"), diff --git a/spacelift/data_stack_test.go b/spacelift/data_stack_test.go index 2720b73a..61483d60 100644 --- a/spacelift/data_stack_test.go +++ b/spacelift/data_stack_test.go @@ -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", Equals("1.30.0")), ), }}) }) diff --git a/spacelift/data_webhook_test.go b/spacelift/data_webhook_test.go index dc37b996..28317584 100644 --- a/spacelift/data_webhook_test.go +++ b/spacelift/data_webhook_test.go @@ -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"), ), }}) diff --git a/spacelift/resource_aws_role_test.go b/spacelift/resource_aws_role_test.go index 1592081a..d8e49436 100644 --- a/spacelift/resource_aws_role_test.go +++ b/spacelift/resource_aws_role_test.go @@ -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()), @@ -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, }, }) @@ -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"), diff --git a/spacelift/resource_context_attachment_test.go b/spacelift/resource_context_attachment_test.go index 53d15bdc..eb2c9f6d 100644 --- a/spacelift/resource_context_attachment_test.go +++ b/spacelift/resource_context_attachment_test.go @@ -91,14 +91,14 @@ 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"), ), }, { ResourceName: resourceName, ImportState: true, - ImportStateId: fmt.Sprintf("test-context-%s/test-module-%s", randomID, randomID), + ImportStateId: fmt.Sprintf("test-context-%s/terraform-default-test-module-%s", randomID, randomID), ImportStateVerify: true, }}) }) diff --git a/spacelift/resource_environment_variable_test.go b/spacelift/resource_environment_variable_test.go index e67ffe8f..a69b1dfb 100644 --- a/spacelift/resource_environment_variable_test.go +++ b/spacelift/resource_environment_variable_test.go @@ -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"), diff --git a/spacelift/resource_gcp_service_account_test.go b/spacelift/resource_gcp_service_account_test.go index 29343aad..a3c80054 100644 --- a/spacelift/resource_gcp_service_account_test.go +++ b/spacelift/resource_gcp_service_account_test.go @@ -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, }, }) diff --git a/spacelift/resource_module_test.go b/spacelift/resource_module_test.go index dc2cefc8..2d094fd2 100644 --- a/spacelift/resource_module_test.go +++ b/spacelift/resource_module_test.go @@ -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")), @@ -95,7 +95,7 @@ func TestModuleResource(t *testing.T) { Config: config("test-root/ab"), Check: Resource( "spacelift_module.test", - Attribute("id", Equals(fmt.Sprintf("project-root-%s", randomID))), + Attribute("id", Equals(fmt.Sprintf("terraform-papaya-project-root-%s", randomID))), Attribute("administrative", Equals("true")), Attribute("branch", Equals("master")), Attribute("description", Equals("description")), @@ -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")), @@ -342,7 +342,7 @@ func TestModuleResourceSpace(t *testing.T) { Config: config("test-root/ab"), Check: Resource( "spacelift_module.test", - Attribute("id", Equals(fmt.Sprintf("project-root-%s", randomID))), + Attribute("id", Equals(fmt.Sprintf("terraform-papaya-project-root-%s", randomID))), Attribute("administrative", Equals("true")), Attribute("branch", Equals("master")), Attribute("description", Equals("description")), diff --git a/spacelift/resource_mounted_file_test.go b/spacelift/resource_mounted_file_test.go index 89cf3a3f..3bdf0e32 100644 --- a/spacelift/resource_mounted_file_test.go +++ b/spacelift/resource_mounted_file_test.go @@ -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")), ), }, diff --git a/spacelift/resource_policy_attachment_test.go b/spacelift/resource_policy_attachment_test.go index bccff131..836c0d77 100644 --- a/spacelift/resource_policy_attachment_test.go +++ b/spacelift/resource_policy_attachment_test.go @@ -81,13 +81,13 @@ 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))), ), }, { ResourceName: resourceName, ImportState: true, - ImportStateId: fmt.Sprintf("my-first-policy-%s/test-module-%s", randomID, randomID), + ImportStateId: fmt.Sprintf("my-first-policy-%s/terraform-default-test-module-%s", randomID, randomID), ImportStateVerify: true, }, }) diff --git a/spacelift/resource_stack_test.go b/spacelift/resource_stack_test.go index df4935e8..d2cf2c41 100644 --- a/spacelift/resource_stack_test.go +++ b/spacelift/resource_stack_test.go @@ -488,7 +488,7 @@ func TestStackResource(t *testing.T) { resourceName, Attribute("id", StartsWith("provider-test-stack")), Attribute("kubernetes.0.namespace", Equals("")), - Attribute("kubernetes.0.kubectl_version", Equals("1.23.5")), + Attribute("kubernetes.0.kubectl_version", Equals("1.30.0")), Attribute("ansible.#", Equals("0")), Attribute("pulumi.#", Equals("0")), Attribute("cloudformation.#", Equals("0")), @@ -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", Equals("1.30.0")), Attribute("ansible.#", Equals("0")), Attribute("pulumi.#", Equals("0")), Attribute("cloudformation.#", Equals("0")), diff --git a/spacelift/resource_webhook_test.go b/spacelift/resource_webhook_test.go index c9c54211..51178958 100644 --- a/spacelift/resource_webhook_test.go +++ b/spacelift/resource_webhook_test.go @@ -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, }, })