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

Fix: make cloud_credentials data test isolated #721

Merged
merged 9 commits into from
Oct 4, 2023

Conversation

GiliFaroEnv0
Copy link
Contributor

Issue & Steps to Reproduce / Feature Request
since we run our tests in parallel other tests that create env0_aws_credentials resources interfere with this test

Solution
Isolate the test and only use resources from the same test

Comment on lines 27 to 32
data "env0_aws_credentials" "aws_credentials1" {
name = data.env0_cloud_credentials.aws_credentials.names[index(data.env0_cloud_credentials.aws_credentials.names, env0_aws_credentials.aws_cred1.name)]
}

data "env0_aws_credentials" "aws_credentials2" {
name = data.env0_cloud_credentials.aws_credentials.names[index(data.env0_cloud_credentials.aws_credentials.names, env0_aws_credentials.aws_cred2.name)]
Copy link
Contributor

Choose a reason for hiding this comment

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

First time seeing this format. does it work like for_each?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nope its the opposite ,
you take a list and search in the list for a specific value

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@liranfarage89 liranfarage89 left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions bot added ready to merge PR approved - can be merged once the PR owner is ready and removed pending final review labels Oct 4, 2023
@GiliFaroEnv0 GiliFaroEnv0 merged commit 2c1c6d7 into main Oct 4, 2023
@GiliFaroEnv0 GiliFaroEnv0 deleted the fix-isolate-credentials-test branch October 4, 2023 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix integration-tests provider ready to merge PR approved - can be merged once the PR owner is ready
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants