Skip to content

test: Updates all test workflows to use advanced_cluster TPF implementation #3580

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

Open
wants to merge 9 commits into
base: CLOUDP-320243-dev-2.0.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions .github/workflows/acceptance-tests-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

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?

type: string
required: false
test_name:
Expand All @@ -26,7 +26,7 @@ on:
type: string
required: false
reduced_tests:
description: 'If run only minimum tests for advanced_cluster, e.g. in PRs'
description: 'If run only minimum tests for advanced_cluster_tpf, e.g. in PRs'
type: boolean
required: false
default: false
Expand Down Expand Up @@ -241,7 +241,6 @@ jobs:
env:
mustTrigger: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.test_group == '' ) }}
outputs: # ensure resources are sorted alphabetically
advanced_cluster: ${{ steps.filter.outputs.advanced_cluster == 'true' || env.mustTrigger == 'true' }}
advanced_cluster_tpf: ${{ steps.filter.outputs.advanced_cluster_tpf == 'true' || env.mustTrigger == 'true' }}
assume_role: ${{ steps.filter.outputs.assume_role == 'true' || env.mustTrigger == 'true' }}
autogen: ${{ steps.filter.outputs.autogen == 'true' || env.mustTrigger == 'true' }}
Expand Down Expand Up @@ -274,9 +273,6 @@ jobs:
if: ${{ inputs.test_group == '' && env.mustTrigger == 'false' }}
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'
Expand Down Expand Up @@ -408,7 +404,6 @@ jobs:
HTTP_MOCKER_CAPTURE: 'true'
ACCTEST_REGEX_RUN: ${{ inputs.reduced_tests && '^TestAccMockable' || env.ACCTEST_REGEX_RUN }}
ACCTEST_PACKAGES: |
./internal/service/advancedcluster
./internal/service/advancedclustertpf
run: make testacc

Expand Down Expand Up @@ -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.

run: make testacc

assume_role:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code-health.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ jobs:
secrets: inherit
uses: ./.github/workflows/acceptance-tests.yml
with:
reduced_tests: false
reduced_tests: true
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you clarify here the why?

6 changes: 0 additions & 6 deletions internal/config/preview_provider_v2.go

This file was deleted.

84 changes: 0 additions & 84 deletions internal/service/advancedcluster/move_state_test.go

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/hashicorp/terraform-plugin-testing/knownvalue"
"github.com/hashicorp/terraform-plugin-testing/plancheck"
"github.com/hashicorp/terraform-plugin-testing/tfjsonpath"

"github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/unit"
)

Expand All @@ -14,7 +15,6 @@ var (
repSpec1 = tfjsonpath.New("replication_specs").AtSliceIndex(1)
regionConfig0 = repSpec0.AtMapKey("region_configs").AtSliceIndex(0)
regionConfig1 = repSpec1.AtMapKey("region_configs").AtSliceIndex(0)
mockConfig = unit.MockConfigAdvancedClusterTPF
)

func autoScalingKnownValue(computeEnabled, diskEnabled, scaleDown bool, minInstanceSize, maxInstanceSize string) knownvalue.Check {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package advancedcluster_test
package advancedclustertpf_test

import (
"os"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package advancedcluster_test
package advancedclustertpf_test

import (
"errors"
"fmt"
"net/http"
"os"
Expand Down Expand Up @@ -62,6 +63,7 @@ var (
configServerManagementModeFixedToDedicated = "FIXED_TO_DEDICATED"
configServerManagementModeAtlasManaged = "ATLAS_MANAGED"
mockConfig = unit.MockConfigAdvancedClusterTPF
errGeneric = errors.New("generic")
)

func TestGetReplicationSpecAttributesFromOldAPI(t *testing.T) {
Expand Down
Loading
Loading