mongodb / terraform-provider-mongodbatlas

Terraform MongoDB Atlas Provider: Deploy, update, and manage MongoDB Atlas infrastructure as code through HashiCorp Terraform
https://registry.terraform.io/providers/mongodb/mongodbatlas
Mozilla Public License 2.0
230 stars 167 forks source link

chore: Improves test coverage for cloud_provider_access_authorization. #2260

Closed marcosuma closed 1 month ago

marcosuma commented 1 month ago

Description

In https://github.com/mongodb/terraform-provider-mongodbatlas/actions/runs/8994019768 we noticed that cloud_provider_access_authorization tests are not robust enough and a bug introduced in it was spotted with other tests workflows in the Test Suite (that are using cloud_provider_access_authorization).

So I worked backwards from the test that was able to trigger the bug and I added the test features to make sure cloud_provider_access_authorization tests are more robust. In a nutshell, feature_ids are empty if there isn't federated database (or something similar) associated to it. That's why I am adding it.

One might argue that this is similar to the test in federated_database_instance, but in reality it shouldn't be a concern. Practically these resources are almost always touched independently, so it's better to keep tests in both of them

Link to any related issue(s): https://jira.mongodb.org/browse/CLOUDP-248348

Type of change:

Required Checklist:

Further comments

oarbusi commented 1 month ago

Curious to know where we fixed the bug? Cannot see any changes to the resource or data source

@EspenAlbert the fix was done in this PR