-
Notifications
You must be signed in to change notification settings - Fork 15
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
Fix: integration test 025 is not isolated #735
Fix: integration test 025 is not isolated #735
Conversation
depends_on = [env0_notification.test_notification_1, env0_notification.test_notification_2] | ||
} | ||
|
||
data "env0_notification" "test_notification_1" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not just use
locals {
test_notification_1_name = "notification123-${random_string.random.result}-1"
}
data "env0_notification" "my_notification" {
name = locals.test_notification_1_name
}
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we wish to see that the all_notifications
works as expected too, so I suggest we utilize its data, so if it got broken for some reason the test will fail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree with @avnerenv0 .
can be replaced with post condition on the all_notifications
data
postcondition {
condition = contains(self.names, local.test_notification_1_name)
error_message = "One of the notifications not found"
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
used the resource name, and used output for the all_notifications
verification, that it got one of the notifications
…tifications for testing its functionality
Issue & Steps to Reproduce / Feature Request
test
025_notifications
usesall_notifications
, and it fetches data from other tests, such as017_notification
, that may become unavailable during test 025's run.Solution
make the test rely solely on its own data
QA done
ran the test locally to make sure it works on its own. deliberately failing it is much harder, didn't happen sporadically (that we caught) until a few days prior to the PR