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

Chore: move env test is flaky - use never deployed env #943

Merged
merged 2 commits into from
Aug 26, 2024
Merged
Changes from all 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
16 changes: 14 additions & 2 deletions tests/integration/012_environment/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ resource "env0_environment" "example" {
depends_on = [env0_template_project_assignment.assignment]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this environment still necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. tomer just added the move part here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the original purpose of the test was to test different types / settings of environments, and here there was an attempt to kill 2 birds with one stone by testing both regular deployment and move environment. so I think it is still needed for the original purpose

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"
Expand All @@ -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 = [
Expand Down Expand Up @@ -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
Expand Down
Loading