-
Notifications
You must be signed in to change notification settings - Fork 178
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: Uses noOpCreate to avoid inconsistent result error and fix/enable tests in Ci #2290
chore: Uses noOpCreate to avoid inconsistent result error and fix/enable tests in Ci #2290
Conversation
…ted_settings_connected_org
@EspenAlbert I am trying to understand if the two things are related with each other: |
@marcosuma we have acceptance test for: But no acceptance test running in CI for
Not sure if that answers your question. |
@EspenAlbert it seems like those tests can't be enabled, because I see For sure running those tests locally is a workaround for this PR, make sure that removing |
@marcosuma I have been running the tests locally and found a few issues, I had a meeting with @AgustinBettati and we discussed how to test these. I'm working on enabling some of these tests in the CI and having this PR ready for review. |
Great, let's try to improve testing around this area. Just to confirm (I am still a bit unsure I have fully understood):
|
Confirmed. After removing this check, it would fail on the read since
I have tested successfully 😄 Local run for the
|
...vice/federatedsettingsidentityprovider/resource_federated_settings_identity_provider_test.go
Outdated
Show resolved
Hide resolved
@@ -28,8 +26,7 @@ func TestAccFederatedSettingsOrgDS_basic(t *testing.T) { | |||
resource.TestCheckResourceAttrSet(resourceName, "federation_settings_id"), | |||
resource.TestCheckResourceAttrSet(resourceName, "role_mappings.#"), | |||
resource.TestCheckResourceAttrSet(resourceName, "identity_provider_id"), | |||
resource.TestCheckResourceAttrSet(resourceName, "org_id"), | |||
resource.TestCheckResourceAttr(resourceName, "identity_provider_id", "0oad4fas87jL5Xnk1297"), |
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.
can't be known?
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.
Replaced org_id
with a more specific check (value of org_id
).
Removed identity_provider_id
as it depends on the environment. Could add an env-var for the specific value but seems fragile and overkill 😅
LGTM! Left some minor comments |
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.
LGTM
internal/service/federatedsettingsorgconfig/resource_federated_settings_connected_org_test.go
Outdated
Show resolved
Hide resolved
"github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/mig" | ||
) | ||
|
||
func TestMigFederatedSettingsIdentityProviderRS_basic(t *testing.T) { |
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.
Would make sure once we implement full CRUD we add a migration test. cc: @oarbusi
Description
mongodbatlas_federated_settings_org_config
and refactored and run resource test locallymongodbatlas_federated_settings_identity_provider
Side note: I tried running these, but since the first step is import, the "default" approach won't work. I made some simple attempts, but I didn't find an "easy" way to do them.
This resource is not meant to be imported see docs (will get changed when we implement OIDC fully)
Original error showing:
After refactoring:
Link to any related issue(s): CLOUDP-248069
Type of change:
Required Checklist:
Further comments
mongodbatlas_federated_settings_org_config
test