From 00a265f5fdec671bcd826e62a704f78d9c9fc8b3 Mon Sep 17 00:00:00 2001 From: Chaim Platonov Date: Mon, 26 Aug 2024 12:50:48 +0300 Subject: [PATCH] Chore: move env test is flaky - use never deployed env (#943) --- tests/integration/012_environment/main.tf | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/integration/012_environment/main.tf b/tests/integration/012_environment/main.tf index 10ae4797..a1dc4426 100644 --- a/tests/integration/012_environment/main.tf +++ b/tests/integration/012_environment/main.tf @@ -55,7 +55,7 @@ resource "env0_environment" "example" { depends_on = [env0_template_project_assignment.assignment] force_destroy = true name = "environment-${random_string.random.result}" - project_id = var.second_run ? env0_project.test_project2.id : env0_project.test_project.id + project_id = env0_project.test_project.id template_id = env0_template.template.id configuration { name = "environment configuration variable" @@ -67,6 +67,15 @@ resource "env0_environment" "example" { drift_detection_cron = var.second_run ? "*/5 * * * *" : "*/10 * * * *" } +resource "env0_environment" "move_environment" { + depends_on = [env0_template_project_assignment.assignment] + force_destroy = true + name = "environment-move-${random_string.random.result}" + project_id = var.second_run ? env0_project.test_project2.id : env0_project.test_project.id + template_id = env0_template.template.id + prevent_auto_deploy = true +} + resource "env0_custom_role" "custom_role1" { name = "custom-role-${random_string.random.result}" permissions = [ @@ -240,7 +249,10 @@ resource "env0_variable_set" "variable_set2" { } resource "env0_environment" "workflow-environment" { - depends_on = [env0_template_project_assignment.assignment_workflow, env0_template_project_assignment.assignment_sub_environment_null_template] + depends_on = [ + env0_template_project_assignment.assignment_workflow, + env0_template_project_assignment.assignment_sub_environment_null_template + ] force_destroy = true name = "environment-workflow-${random_string.random.result}" project_id = env0_project.test_project.id