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

chore: Replace PlanOnly tests with PreApply plancheck.ExpectEmptyPlan() as advised in terraform-plugin-testing 1.6.0 #1795

Merged
merged 1 commit into from
Dec 29, 2023

Conversation

AgustinBettati
Copy link
Member

Description

Followup up from CLOUDP-219141

Change was advised in hashicorp/terraform-plugin-testing#256.

Proposed doc changes in migration guide of terraform-plugin-testing 1.6.0, as well as migration test guide, will give the same guidance:

Type of change:

  • Bug fix (non-breaking change which fixes an issue). Please, add the "bug" label to the PR.
  • New feature (non-breaking change which adds functionality). Please, add the "enhancement" label to the PR.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected). Please, add the "breaking change" label to the PR.
  • This change requires a documentation update
  • Documentation fix/enhancement

Required Checklist:

  • I have signed the MongoDB CLA
  • I have read the contribution guidelines
  • I have checked that this change does not generate any credentials and that they are NOT accidentally logged anywhere.
  • I have added tests that prove my fix is effective or that my feature works per HashiCorp requirements
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code
  • If changes include deprecations or removals, I defined an isolated PR with a relevant title as it will be used in the auto-generated changelog.

Further comments

@AgustinBettati AgustinBettati force-pushed the CLOUDP-219141-plan-only branch from 47c8611 to 43a6e52 Compare December 29, 2023 13:50
@@ -1449,7 +1449,8 @@ func TestAccClusterRSCluster_withDefaultBiConnectorAndAdvancedConfiguration_main
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
Config: cfg,
ConfigPlanChecks: resource.ConfigPlanChecks{
PostApplyPreRefresh: []plancheck.PlanCheck{
PreApply: []plancheck.PlanCheck{
acc.DebugPlan(),
Copy link
Member Author

Choose a reason for hiding this comment

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

leaving debug plan check as error message provided by ExpectEmptyPlan is not too helpful.

@AgustinBettati
Copy link
Member Author

failing test TestAccFederatedDatabaseInstance_atlasCluster is not related (cloud-dev failure: region is currently out of capacity)

@AgustinBettati AgustinBettati marked this pull request as ready for review December 29, 2023 15:35
@AgustinBettati AgustinBettati requested a review from a team as a code owner December 29, 2023 15:35
Copy link
Collaborator

@andreaangiolillo andreaangiolillo left a comment

Choose a reason for hiding this comment

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

LGTM

@AgustinBettati AgustinBettati merged commit 55c4f7e into master Dec 29, 2023
@AgustinBettati AgustinBettati deleted the CLOUDP-219141-plan-only branch December 29, 2023 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants