Skip to content

Commit

Permalink
make the test rely solely on its own data
Browse files Browse the repository at this point in the history
  • Loading branch information
sagilaufer1992 committed Oct 25, 2023
1 parent 5644f44 commit 06c25f8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tests/integration/025_notifications/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,14 @@ resource "env0_notification" "test_notification_2" {
value = "https://someurl2.com"
}

data "env0_notifications" "all_notifications" {}
data "env0_notifications" "all_notifications" {
depends_on = [env0_notification.test_notification_1, env0_notification.test_notification_2]
}

data "env0_notification" "test_notification_1" {
name = data.env0_notifications.all_notifications.names[index(data.env0_notifications.all_notifications.names, env0_notification.test_notification_1.name)]
}

data "env0_notification" "notification" {
for_each = toset(data.env0_notifications.all_notifications.names)
name = each.value
data "env0_notification" "test_notification_2" {
name = data.env0_notifications.all_notifications.names[index(data.env0_notifications.all_notifications.names, env0_notification.test_notification_2.name)]
}

0 comments on commit 06c25f8

Please sign in to comment.