Skip to content

Conversation

maastha
Copy link
Collaborator

@maastha maastha commented Aug 11, 2025

Description

Test suite run: https://github.com/mongodb/terraform-provider-mongodbatlas/actions/runs/16890016640

This PR also addresses all remaining code changes mentioned in CLOUDP-336437

Link to any related issue(s): CLOUDP-336437

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. A migration guide must be created or updated if the new feature will go in a major version.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected). Please, add the "breaking change" label to the PR. A migration guide must be created or updated.
  • This change requires a documentation update
  • Documentation fix/enhancement

Required Checklist:

  • I have signed the MongoDB CLA
  • I have read the contributing guides
  • 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 have added appropriate changelog entries.
  • If changes include removal or addition of 3rd party GitHub actions, I updated our internal document. Reach out to the APIx Integration slack channel to get access to the internal document.

Further comments

@maastha maastha changed the base branch from master to CLOUDP-320243-dev-2.0.0 August 11, 2025 13:19
@maastha
Copy link
Collaborator Author

maastha commented Aug 12, 2025

failing check is unrelated to this PR

@maastha maastha marked this pull request as ready for review August 12, 2025 15:48
@Copilot Copilot AI review requested due to automatic review settings August 12, 2025 15:48
@maastha maastha requested a review from a team as a code owner August 12, 2025 15:48
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes test suite failures by addressing HCL configuration generation issues and test compatibility problems. The changes focus on correcting Terraform configuration syntax and ensuring proper test execution.

  • Updates HCL configuration generation to use TupleVal instead of ListVal for better type flexibility
  • Fixes Terraform configuration syntax in test files to use proper assignment operators
  • Adds version compatibility checks for migration tests

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
internal/testutil/acc/config_cluster.go Refactors variable names, fixes indentation, and changes from ListVal to TupleVal for replication specs
internal/serviceapi/searchdeploymentapi/resource_test.go Updates cluster configuration syntax from block to assignment format
internal/service/clusteroutagesimulation/resource_test.go Adds blank line for import formatting
internal/service/clusteroutagesimulation/resource_migration_test.go Adds version compatibility checks for migration tests
.github/workflows/code-health.yml Changes reduced_tests flag to true for workflow optimization

@maastha maastha changed the title test: Fix test suite failures test: Updates all test workflows to use advanced_cluster TPF implementation Aug 12, 2025
Copy link
Collaborator

@EspenAlbert EspenAlbert left a comment

Choose a reason for hiding this comment

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

Where did the advanced_cluster acceptance tests go? I cannot find them in the tree: internal/service/advancedcluster/resource_advanced_cluster_test.go found them in resource_test in tpf package

Copy link
Collaborator

@EspenAlbert EspenAlbert left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -14,7 +14,7 @@ on:
type: string
required: false
test_group:
description: 'Test group to run, e.g. advanced_cluster, empty for all'
description: 'Test group to run, e.g. advanced_cluster_tpf, empty for all'
Copy link
Member

@lantoli lantoli Aug 13, 2025

Choose a reason for hiding this comment

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

what about renaming all occurences in this file from advanced_cluster_tpf to advanced_cluster as that's the only one now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I thought that would be done later as part of the cleanup when we finally delete advancedcluster? but no strong opinion, will update

Copy link
Member

Choose a reason for hiding this comment

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

ah, ok, the cleanup was more about the service folders but i see your point here, feel free to keep it as it is if you prefer that

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updated now

@@ -436,7 +431,7 @@ jobs:
MONGODB_ATLAS_LAST_1X_VERSION: ${{ inputs.mongodb_atlas_last_1x_version }}
ACCTEST_REGEX_RUN: '^TestMig'
ACCTEST_PACKAGES: |
./internal/service/advancedcluster
./internal/service/advancedclustertpf
Copy link
Member

Choose a reason for hiding this comment

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

do we still need advanced_cluster_tpf_mig_from_sdkv2 tests? Maybe we can remove it, and remove logic associated with env.var MONGODB_ATLAS_TEST_SDKV2_TO_TPF from the code.

Copy link
Collaborator Author

@maastha maastha Aug 14, 2025

Choose a reason for hiding this comment

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

I recommended in the team to keep these for at least a couple next releases until we have a better idea of adoption & may also help us understand if we need to handle any additional scenarios that might come up based on changes in the next releases

}
rcMap["auto_scaling"] = cty.ObjectVal(map[string]cty.Value{
"disk_gb_enabled": cty.BoolVal(asDisk.GetEnabled()),
})
}

nodeSpec := rc.GetElectableSpecs()
es := rc.GetElectableSpecs()
Copy link
Member

Choose a reason for hiding this comment

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

are these changes related with test workflow changes?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

not exactly, these were to fix one of the tests

@@ -14,7 +14,7 @@ on:
type: string
required: false
test_group:
description: 'Test group to run, e.g. advanced_cluster, empty for all'
description: 'Test group to run, e.g. advanced_cluster_tpf, empty for all'
Copy link
Collaborator

Choose a reason for hiding this comment

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

curious about the context: why do we still need to specify the _tpf?

Copy link
Member

Choose a reason for hiding this comment

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

i made a similar comment, we can remove tpf now that it's the only test group

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updated

@@ -275,9 +274,6 @@ jobs:
with:
filters: |
advanced_cluster:
- 'internal/service/advancedcluster/!(*_test).go' # matches any adv_cluster file change except test files
- 'internal/service/advancedclustertpf/common*.go'
advanced_cluster_tpf:
- 'internal/service/advancedclustertpf/*.go'
- 'internal/service/advancedcluster/*_test.go'
Copy link
Member

@lantoli lantoli Aug 14, 2025

Choose a reason for hiding this comment

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

is there any test in adv_cluster (without tpf) or we can delete filter path 'internal/service/advancedcluster/*_test.go' ?

we're only running package ./internal/service/advancedclustertpf so I think it's ok to delete the filter path

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed 'internal/service/advancedcluster/*_test.go' ty!

@maastha maastha merged commit 5517239 into CLOUDP-320243-dev-2.0.0 Aug 14, 2025
43 checks passed
@maastha maastha deleted the CLOUDP-336437-fix-test-suite branch August 14, 2025 12:52
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.

4 participants