From 4580a372f5afb10922c99fd322aac42069331b37 Mon Sep 17 00:00:00 2001 From: Leo Antoli <430982+lantoli@users.noreply.github.com> Date: Wed, 17 Apr 2024 12:11:43 +0200 Subject: [PATCH] chore: Single Github Action for migration and acceptance tests (#2156) * run mig tests in acc tests * remove mig tests workflow * add provider_version to job name * change CIDRs * serial tests --- .github/workflows/acceptance-tests-runner.yml | 77 ++- .github/workflows/acceptance-tests.yml | 22 +- .github/workflows/code-health.yml | 5 - .github/workflows/migration-tests.yml | 582 ------------------ .github/workflows/test-suite.yml | 26 +- ...source_network_container_migration_test.go | 15 +- ...e_project_ip_access_list_migration_test.go | 13 +- 7 files changed, 95 insertions(+), 645 deletions(-) delete mode 100644 .github/workflows/migration-tests.yml diff --git a/.github/workflows/acceptance-tests-runner.yml b/.github/workflows/acceptance-tests-runner.yml index 3f898e388c..249c8c3922 100644 --- a/.github/workflows/acceptance-tests-runner.yml +++ b/.github/workflows/acceptance-tests-runner.yml @@ -9,6 +9,10 @@ on: description: 'Terraform version to use, e.g. 1.6.x, empty for latest' type: string required: true + provider_version: + description: 'Previous MongoDB Atlas Provider version to use in Migration tests, e.g. 1.14.0, empty for latest' + type: string + required: false test_group: description: 'Test group to run, e.g. advanced_cluster, empty for all' type: string @@ -103,13 +107,30 @@ env: TF_ACC: 1 TF_LOG: ${{ vars.LOG_LEVEL }} ACCTEST_TIMEOUT: ${{ vars.ACCTEST_TIMEOUT }} - ACCTEST_REGEX_RUN: "^TestAcc" + # Only Migration tests are run when testing a specific previous provider version instead of the latest one + ACCTEST_REGEX_RUN: ${{ inputs.provider_version == '' && '^Test(Acc|Mig)' || '^TestMig' }} MONGODB_ATLAS_BASE_URL: ${{ inputs.mongodb_atlas_base_url }} MONGODB_ATLAS_ORG_ID: ${{ inputs.mongodb_atlas_org_id }} MONGODB_ATLAS_PUBLIC_KEY: ${{ secrets.mongodb_atlas_public_key }} MONGODB_ATLAS_PRIVATE_KEY: ${{ secrets.mongodb_atlas_private_key }} jobs: + + get-provider-version: + runs-on: ubuntu-latest + outputs: + provider_version: ${{ inputs.provider_version || steps.get_last_release.outputs.last_provider_version }} + steps: + - name: Checkout + uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 + - name: Get Last Release + id: get_last_release + shell: bash + run: | + LAST_RELEASE=$(curl -sSfL -X GET https://api.github.com/repos/mongodb/terraform-provider-mongodbatlas/releases/latest | jq -r '.tag_name | ltrimstr("v")') + echo "Last release: $LAST_RELEASE" + echo "last_provider_version=${LAST_RELEASE}" >> "${GITHUB_OUTPUT}" + change-detection: runs-on: ubuntu-latest env: @@ -215,7 +236,7 @@ jobs: - 'internal/service/encryptionatrest/*.go' cluster_outage_simulation: - needs: [ change-detection ] + needs: [ change-detection, get-provider-version ] if: ${{ needs.change-detection.outputs.cluster_outage_simulation == 'true' || inputs.test_group == 'cluster_outage_simulation' }} runs-on: ubuntu-latest steps: @@ -231,11 +252,12 @@ jobs: terraform_wrapper: false - name: Acceptance Tests env: + MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} ACCTEST_PACKAGES: ./internal/service/clusteroutagesimulation run: make testacc advanced_cluster: - needs: [ change-detection ] + needs: [ change-detection, get-provider-version ] if: ${{ needs.change-detection.outputs.advanced_cluster == 'true' || inputs.test_group == 'advanced_cluster' }} runs-on: ubuntu-latest steps: @@ -251,11 +273,12 @@ jobs: terraform_wrapper: false - name: Acceptance Tests env: + MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} ACCTEST_PACKAGES: ./internal/service/advancedcluster run: make testacc cluster: - needs: [ change-detection ] + needs: [ change-detection, get-provider-version ] if: ${{ needs.change-detection.outputs.cluster == 'true' || inputs.test_group == 'cluster' }} runs-on: ubuntu-latest steps: @@ -271,13 +294,14 @@ jobs: terraform_wrapper: false - name: Acceptance Tests env: + MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} ACCTEST_PACKAGES: | ./internal/service/cluster ./internal/service/globalclusterconfig run: make testacc search_deployment: - needs: [ change-detection ] + needs: [ change-detection, get-provider-version ] if: ${{ needs.change-detection.outputs.search_deployment == 'true' || inputs.test_group == 'search_deployment' }} runs-on: ubuntu-latest steps: @@ -293,11 +317,12 @@ jobs: terraform_wrapper: false - name: Acceptance Tests env: + MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} ACCTEST_PACKAGES: ./internal/service/searchdeployment run: make testacc stream: - needs: [ change-detection ] + needs: [ change-detection, get-provider-version ] if: ${{ needs.change-detection.outputs.stream == 'true' || inputs.test_group == 'stream' }} runs-on: ubuntu-latest steps: @@ -314,13 +339,14 @@ jobs: - name: Acceptance Tests env: MONGODB_ATLAS_ENABLE_PREVIEW: "true" + MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} ACCTEST_PACKAGES: | ./internal/service/streaminstance ./internal/service/streamconnection run: make testacc generic: # Acceptance tests that do not use any time-consuming resource (example: cluster) - needs: [ change-detection ] + needs: [ change-detection, get-provider-version ] if: ${{ needs.change-detection.outputs.generic == 'true' || inputs.test_group == 'generic' }} runs-on: ubuntu-latest steps: @@ -338,13 +364,14 @@ jobs: env: MONGODB_ATLAS_PROJECT_OWNER_ID: ${{ inputs.mongodb_atlas_project_owner_id }} CA_CERT: ${{ secrets.ca_cert }} + MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} ACCTEST_PACKAGES: | ./internal/service/backupcompliancepolicy ./internal/service/auditing ./internal/service/x509authenticationdatabaseuser run: make testacc backup: - needs: [ change-detection ] + needs: [ change-detection, get-provider-version ] if: ${{ needs.change-detection.outputs.backup == 'true' || inputs.test_group == 'backup' }} runs-on: ubuntu-latest steps: @@ -361,6 +388,7 @@ jobs: - name: Acceptance Tests env: MONGODB_ATLAS_PROJECT_OWNER_ID: ${{ inputs.mongodb_atlas_project_owner_id }} + MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} ACCTEST_PACKAGES: | ./internal/service/onlinearchive ./internal/service/cloudbackupschedule @@ -370,7 +398,7 @@ jobs: ./internal/service/cloudbackupsnapshotrestorejob run: make testacc project: - needs: [ change-detection ] + needs: [ change-detection, get-provider-version ] if: ${{ needs.change-detection.outputs.project == 'true' || inputs.test_group == 'project' }} runs-on: ubuntu-latest steps: @@ -396,6 +424,7 @@ jobs: AWS_SECURITY_GROUP_2: ${{ vars.AWS_SECURITY_GROUP_2 }} AWS_VPC_CIDR_BLOCK: ${{ vars.AWS_VPC_CIDR_BLOCK }} AWS_VPC_ID: ${{ vars.AWS_VPC_ID }} + MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} ACCTEST_PACKAGES: | ./internal/service/project ./internal/service/projectipaccesslist @@ -403,7 +432,7 @@ jobs: ./internal/service/projectinvitation run: make testacc serverless: - needs: [ change-detection ] + needs: [ change-detection, get-provider-version ] if: ${{ needs.change-detection.outputs.serverless == 'true' || inputs.test_group == 'serverless' }} runs-on: ubuntu-latest steps: @@ -421,13 +450,14 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.aws_access_key_id }} AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_access_key }} + MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} ACCTEST_PACKAGES: | ./internal/service/serverlessinstance ./internal/service/privatelinkendpointserverless ./internal/service/privatelinkendpointserviceserverless run: make testacc network: - needs: [ change-detection ] + needs: [ change-detection, get-provider-version ] if: ${{ needs.change-detection.outputs.network == 'true' || inputs.test_group == 'network' }} runs-on: ubuntu-latest steps: @@ -453,6 +483,7 @@ jobs: AWS_SECURITY_GROUP_2: ${{ vars.AWS_SECURITY_GROUP_2 }} AWS_VPC_CIDR_BLOCK: ${{ vars.AWS_VPC_CIDR_BLOCK }} AWS_VPC_ID: ${{ vars.AWS_VPC_ID }} + MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} ACCTEST_PACKAGES: | ./internal/service/networkcontainer ./internal/service/networkpeering @@ -462,7 +493,7 @@ jobs: ./internal/service/privatelinkendpointservicedatafederationonlinearchive run: make testacc config: - needs: [ change-detection ] + needs: [ change-detection, get-provider-version ] if: ${{ needs.change-detection.outputs.config == 'true' || inputs.test_group == 'config' }} runs-on: ubuntu-latest steps: @@ -486,6 +517,7 @@ jobs: AWS_REGION: ${{ vars.AWS_REGION_LOWERCASE }} AWS_ACCESS_KEY_ID: ${{ secrets.aws_access_key_id }} AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_access_key }} + MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} ACCTEST_PACKAGES: | ./internal/service/alertconfiguration ./internal/service/atlasuser @@ -504,7 +536,7 @@ jobs: run: make testacc assume_role: - needs: [ change-detection] + needs: [ change-detection, get-provider-version ] if: ${{ needs.change-detection.outputs.assume_role == 'true' || inputs.test_group == 'assume_role' }} runs-on: ubuntu-latest steps: @@ -538,11 +570,12 @@ jobs: AWS_ACCESS_KEY_ID: ${{ steps.sts-assume-role.outputs.aws_access_key_id }} AWS_SECRET_ACCESS_KEY: ${{ steps.sts-assume-role.outputs.aws_secret_access_key }} AWS_SESSION_TOKEN: ${{ steps.sts-assume-role.outputs.AWS_SESSION_TOKEN }} + MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} ACCTEST_PACKAGES: ./internal/provider run: make testacc search_index: - needs: [ change-detection ] + needs: [ change-detection, get-provider-version ] if: ${{ needs.change-detection.outputs.search_index == 'true' || inputs.test_group == 'search_index' }} runs-on: ubuntu-latest steps: @@ -558,11 +591,12 @@ jobs: terraform_wrapper: false - name: Acceptance Tests env: + MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} ACCTEST_PACKAGES: ./internal/service/searchindex run: make testacc federated: - needs: [ change-detection ] + needs: [ change-detection, get-provider-version ] if: ${{ needs.change-detection.outputs.federated == 'true' || inputs.test_group == 'federated' }} runs-on: ubuntu-latest steps: @@ -589,6 +623,7 @@ jobs: AWS_REGION: ${{ vars.aws_region_federation }} AWS_ACCESS_KEY_ID: ${{ secrets.aws_access_key_id }} AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_access_key }} + MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} ACCTEST_PACKAGES: | ./internal/service/federatedsettingsidentityprovider ./internal/service/federateddatabaseinstance @@ -597,7 +632,7 @@ jobs: ./internal/service/federatedquerylimit run: make testacc data_lake: - needs: [ change-detection ] + needs: [ change-detection, get-provider-version ] if: ${{ needs.change-detection.outputs.data_lake == 'true' || inputs.test_group == 'data_lake' }} runs-on: ubuntu-latest steps: @@ -613,10 +648,11 @@ jobs: terraform_wrapper: false - name: Acceptance Tests env: + MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} ACCTEST_PACKAGES: ./internal/service/datalakepipeline run: make testacc ldap: - needs: [ change-detection ] + needs: [ change-detection, get-provider-version ] if: ${{ needs.change-detection.outputs.ldap == 'true' || inputs.test_group == 'ldap' }} runs-on: ubuntu-latest steps: @@ -637,12 +673,13 @@ jobs: MONGODB_ATLAS_LDAP_PASSWORD: ${{ secrets.mongodb_atlas_ldap_password }} MONGODB_ATLAS_LDAP_PORT: ${{ secrets.mongodb_atlas_ldap_port }} MONGODB_ATLAS_LDAP_CA_CERTIFICATE: ${{ secrets.mongodb_atlas_ldap_ca_certificate }} + MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} ACCTEST_PACKAGES: | ./internal/service/ldapconfiguration ./internal/service/ldapverify run: make testacc encryption: - needs: [ change-detection ] + needs: [ change-detection, get-provider-version ] if: ${{ needs.change-detection.outputs.encryption == 'true' || inputs.test_group == 'encryption' }} runs-on: ubuntu-latest steps: @@ -658,10 +695,11 @@ jobs: terraform_wrapper: false - name: Acceptance Tests env: + MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} ACCTEST_PACKAGES: ./internal/service/encryptionatrest run: make testacc event_trigger: - needs: [ change-detection ] + needs: [ change-detection, get-provider-version ] if: ${{ needs.change-detection.outputs.event_trigger == 'true' || inputs.test_group == 'event_trigger' }} runs-on: ubuntu-latest steps: @@ -677,5 +715,6 @@ jobs: terraform_wrapper: false - name: Acceptance Tests env: + MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} ACCTEST_PACKAGES: ./internal/service/eventtrigger run: make testacc diff --git a/.github/workflows/acceptance-tests.yml b/.github/workflows/acceptance-tests.yml index be780f6a61..6791e915fb 100644 --- a/.github/workflows/acceptance-tests.yml +++ b/.github/workflows/acceptance-tests.yml @@ -9,6 +9,10 @@ on: description: 'Terraform version to use, e.g. 1.6.x, empty for latest' type: string required: false + provider_version: + description: 'Previous MongoDB Atlas Provider version to use in Migration tests, e.g. 1.14.0, empty for latest' + type: string + required: false atlas_cloud_env: description: 'Atlas cloud environment used, can be either `dev` or `qa`, empty for `dev`' type: string @@ -27,19 +31,22 @@ on: description: 'Terraform version to use, e.g. 1.6.x, empty for latest' type: string required: false - ref: - description: 'The branch, tag or SHA where tests will run, e.g. v1.14.0, empty for default branch' + provider_version: + description: 'Previous MongoDB Atlas Provider version to use in Migration tests, e.g. 1.14.0, empty for latest' type: string - required: false + required: false atlas_cloud_env: description: 'Atlas cloud environment used, can be either `dev` or `qa`, empty for `dev`' type: string required: false - - + ref: + description: 'The branch, tag or SHA where tests will run, e.g. v1.14.0, empty for default branch' + type: string + required: false + jobs: - acc-tests: - name: acc-tests-${{ inputs.terraform_version || 'latest' }}-${{ inputs.atlas_cloud_env || 'dev' }} + tests: + name: tests-${{ inputs.terraform_version || 'latest' }}-${{ inputs.provider_version || 'latest' }}-${{ inputs.atlas_cloud_env || 'dev' }} uses: ./.github/workflows/acceptance-tests-runner.yml secrets: mongodb_atlas_public_key: ${{ inputs.atlas_cloud_env == 'qa' && secrets.MONGODB_ATLAS_PUBLIC_KEY_CLOUD_QA || secrets.MONGODB_ATLAS_PUBLIC_KEY_CLOUD_DEV }} @@ -59,6 +66,7 @@ jobs: with: terraform_version: ${{ inputs.terraform_version || vars.TF_VERSION_LATEST }} + provider_version: ${{ inputs.provider_version }} ref: ${{ inputs.ref }} test_group: ${{ inputs.test_group }} aws_region_federation: ${{ vars.AWS_REGION_FEDERATION }} diff --git a/.github/workflows/code-health.yml b/.github/workflows/code-health.yml index 88a63128d2..34b66b757a 100644 --- a/.github/workflows/code-health.yml +++ b/.github/workflows/code-health.yml @@ -70,8 +70,3 @@ jobs: needs: [build, lint, shellcheck, unit-test, website-lint] secrets: inherit uses: ./.github/workflows/acceptance-tests.yml - call-migration-tests-workflow: - needs: [build, lint, shellcheck, unit-test, website-lint] - secrets: inherit - uses: ./.github/workflows/migration-tests.yml - diff --git a/.github/workflows/migration-tests.yml b/.github/workflows/migration-tests.yml deleted file mode 100644 index cd1be24ea1..0000000000 --- a/.github/workflows/migration-tests.yml +++ /dev/null @@ -1,582 +0,0 @@ -name: 'Migration Tests' - -# Used for running migration tests, either triggered manually or called by other workflows. -on: - workflow_dispatch: - inputs: - terraform_version: - description: 'Terraform version to use, e.g. 1.6.x, empty for latest' - type: string - required: false - provider_version: - description: 'Previous MongoDB Atlas Provider version to use, e.g. 1.14.0, empty for latest' - type: string - required: false - test_group: - description: 'Test group to run, e.g. advanced_cluster, empty for all' - type: string - required: false - workflow_call: # workflow runs after Test Suite or code-health - inputs: - terraform_version: - description: 'Terraform version to use, e.g. 1.6.x, empty for latest' - type: string - required: false - provider_version: - description: 'Previous MongoDB Atlas Provider version to use, e.g. 1.14.0, empty for latest' - type: string - required: false - -env: - terraform_version: ${{ inputs.terraform_version || vars.TF_VERSION_LATEST }} - TF_ACC: 1 - TF_LOG: ${{ vars.LOG_LEVEL }} - ACCTEST_TIMEOUT: ${{ vars.ACCTEST_TIMEOUT }} - ACCTEST_REGEX_RUN: "^TestMig" - MONGODB_ATLAS_BASE_URL: ${{ vars.MONGODB_ATLAS_BASE_URL }} - MONGODB_ATLAS_ORG_ID: ${{ vars.MONGODB_ATLAS_ORG_ID_CLOUD_DEV }} - MONGODB_ATLAS_PUBLIC_KEY: ${{ secrets.MONGODB_ATLAS_PUBLIC_KEY_CLOUD_DEV }} - MONGODB_ATLAS_PRIVATE_KEY: ${{ secrets.MONGODB_ATLAS_PRIVATE_KEY_CLOUD_DEV }} - -jobs: - get-provider-version: - runs-on: ubuntu-latest - outputs: - provider_version: ${{ inputs.provider_version || steps.get_last_release.outputs.last_provider_version }} - steps: - - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - name: Get Last Release - id: get_last_release - shell: bash - run: | - LAST_RELEASE=$(curl -sSfL -X GET https://api.github.com/repos/mongodb/terraform-provider-mongodbatlas/releases/latest | jq -r '.tag_name | ltrimstr("v")') - echo "Last release: $LAST_RELEASE" - echo "last_provider_version=${LAST_RELEASE}" >> "${GITHUB_OUTPUT}" - - change-detection: - runs-on: ubuntu-latest - env: - mustTrigger: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.test_group == '') }} - outputs: - project: ${{ steps.filter.outputs.project == 'true' || env.mustTrigger == 'true' }} - config: ${{ steps.filter.outputs.config == 'true' || env.mustTrigger == 'true' }} - advanced_cluster: ${{ steps.filter.outputs.advanced_cluster == 'true' || env.mustTrigger == 'true' }} - backup: ${{ steps.filter.outputs.backup == 'true' || env.mustTrigger == 'true' }} - stream: ${{ steps.filter.outputs.stream == 'true' || env.mustTrigger == 'true' }} - federated: ${{ steps.filter.outputs.federated == 'true' || env.mustTrigger == 'true' }} - search_deployment: ${{ steps.filter.outputs.search_deployment == 'true' || env.mustTrigger == 'true' }} - generic: ${{ steps.filter.outputs.generic == 'true' || env.mustTrigger == 'true' }} - network: ${{ steps.filter.outputs.network == 'true' || env.mustTrigger == 'true' }} - encryption: ${{ steps.filter.outputs.encryption == 'true' || env.mustTrigger == 'true' }} - serverless: ${{ steps.filter.outputs.serverless == 'true' || env.mustTrigger == 'true' }} - data_lake: ${{ steps.filter.outputs.data_lake == 'true' || env.mustTrigger == 'true' }} - cluster_outage_simulation: ${{ steps.filter.outputs.cluster_outage_simulation == 'true' || env.mustTrigger == 'true' }} - cluster: ${{ steps.filter.outputs.cluster == 'true' || env.mustTrigger == 'true' }} - ldap: ${{ steps.filter.outputs.ldap == 'true' || env.mustTrigger == 'true' }} - search_index: ${{ steps.filter.outputs.search_index == 'true' || env.mustTrigger == 'true' }} - steps: - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 - id: filter - if: ${{ inputs.test_group == '' && env.mustTrigger == 'false' }} - with: - filters: | - project: - - 'internal/service/project/*.go' - - 'internal/service/projectipaccesslist/*.go' - - 'internal/service/accesslistapikey/*.go' - - 'internal/service/projectinvitation/*.go' - config: - - 'internal/service/alertconfiguration/*.go' - - 'internal/service/atlasuser/*.go' - - 'internal/service/databaseuser/*.go' - - 'internal/service/projectapikey/*.go' - - 'internal/service/apikey/*.go' - - 'internal/service/teams/*.go' - - 'internal/service/cloudprovideraccess/*.go' - - 'internal/service/customdbrole/*.go' - - 'internal/service/maintenancewindow/*.go' - - 'internal/service/customdnsconfigurationclusteraws/*.go' - - 'internal/service/rolesorgid/*.go' - - 'internal/service/orginvitation/*.go' - - 'internal/service/organization/*.go' - - 'internal/service/thirdpartyintegration/*.go' - backup: - - 'internal/service/onlinearchive/*.go' - - 'internal/service/cloudbackupschedule/*.go' - - 'internal/service/cloudbackupsnapshot/*.go' - - 'internal/service/cloudbackupsnapshotexportbucket/*.go' - - 'internal/service/cloudbackupsnapshotexportjob/*.go' - - 'internal/service/cloudbackupsnapshotrestorejob/*.go' - advanced_cluster: - - 'internal/service/advancedcluster/*.go' - stream: - - 'internal/service/streaminstance/*.go' - - 'internal/service/streamconnection/*.go' - federated: - - 'internal/service/federatedsettingsidentityprovider/*.go' - - 'internal/service/federateddatabaseinstance/*.go' - - 'internal/service/federatedsettingsorgconfig/*.go' - - 'internal/service/federatedsettingsorgrolemapping/*.go' - - 'internal/service/federatedquerylimit/*.go' - search_deployment: - - 'internal/service/searchdeployment/*.go' - generic: - - 'internal/service/backupcompliancepolicy/*.go' - - 'internal/service/auditing/*.go' - - 'internal/service/x509authenticationdatabaseuser/*.go' - network: - - 'internal/service/networkcontainer/*.go' - - 'internal/service/networkpeering/*.go' - - 'internal/service/privateendpointregionalmode/*.go' - - 'internal/service/privatelinkendpoint/*.go' - - 'internal/service/privatelinkendpointservice/*.go' - - 'internal/service/privatelinkendpointservicedatafederationonlinearchive/*.go' - encryption: - - 'internal/service/encryptionatrest/*.go' - serverless: - - 'internal/service/serverlessinstance/*.go' - - 'internal/service/privatelinkendpointserverless/*.go' - - 'internal/service/privatelinkendpointserviceserverless/*.go' - data_lake: - - 'internal/service/datalakepipeline/*.go' - cluster_outage_simulation: - - 'internal/service/clusteroutagesimulation/*.go' - cluster: - - 'internal/service/cluster/*.go' - - 'internal/service/globalclusterconfig/*.go' - ldap: - - 'internal/service/ldapconfiguration/*.go' - - 'internal/service/ldapverify/*.go' - search_index: - - 'internal/service/searchindex/*.go' - - project: - needs: [ change-detection, get-provider-version ] - if: ${{ needs.change-detection.outputs.project == 'true' || inputs.test_group == 'project' }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 - with: - go-version-file: 'go.mod' - - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 - with: - terraform_version: ${{ env.terraform_version }} - terraform_wrapper: false - - name: Migration Tests - env: - MONGODB_ATLAS_PROJECT_OWNER_ID: ${{ vars.MONGODB_ATLAS_PROJECT_OWNER_ID }} - MONGODB_ATLAS_TEAMS_IDS: ${{ vars.MONGODB_ATLAS_TEAMS_IDS }} - MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} - AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_REGION: ${{ vars.AWS_REGION }} - AWS_SECURITY_GROUP_1: ${{ vars.AWS_SECURITY_GROUP_1 }} - AWS_SECURITY_GROUP_2: ${{ vars.AWS_SECURITY_GROUP_2 }} - AWS_VPC_CIDR_BLOCK: ${{ vars.AWS_VPC_CIDR_BLOCK }} - AWS_VPC_ID: ${{ vars.AWS_VPC_ID }} - ACCTEST_PACKAGES: | - ./internal/service/project - ./internal/service/projectipaccesslist - ./internal/service/accesslistapikey - ./internal/service/projectinvitation - run: make testacc - - config: - needs: [ change-detection, get-provider-version ] - if: ${{ needs.change-detection.outputs.config == 'true' || inputs.test_group == 'config' }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 - with: - go-version-file: 'go.mod' - - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 - with: - terraform_version: ${{ env.terraform_version }} - terraform_wrapper: false - - name: Migration Tests - env: - MONGODB_ATLAS_PROJECT_OWNER_ID: ${{ vars.MONGODB_ATLAS_PROJECT_OWNER_ID }} - MONGODB_ATLAS_USERNAME: ${{ vars.MONGODB_ATLAS_USERNAME_CLOUD_DEV }} - AZURE_ATLAS_APP_ID: ${{vars.AZURE_ATLAS_APP_ID}} - AZURE_SERVICE_PRINCIPAL_ID: ${{vars.AZURE_SERVICE_PRINCIPAL_ID}} - AZURE_TENANT_ID: ${{vars.AZURE_TENANT_ID}} - AWS_REGION: ${{ vars.AWS_REGION_LOWERCASE }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY_ID }} - MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} - ACCTEST_PACKAGES: | - ./internal/service/alertconfiguration - ./internal/service/atlasuser - ./internal/service/databaseuser - ./internal/service/projectapikey - ./internal/service/apikey - ./internal/service/teams - ./internal/service/cloudprovideraccess - ./internal/service/customdbrole - ./internal/service/maintenancewindow - ./internal/service/customdnsconfigurationclusteraws - ./internal/service/rolesorgid - ./internal/service/orginvitation - ./internal/service/organization - ./internal/service/thirdpartyintegration - run: make testacc - - backup: - needs: [ change-detection, get-provider-version ] - if: ${{ needs.change-detection.outputs.backup == 'true' || inputs.test_group == 'backup' }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 - with: - go-version-file: 'go.mod' - - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 - with: - terraform_version: ${{ env.terraform_version }} - terraform_wrapper: false - - name: Migration Tests - env: - MONGODB_ATLAS_PROJECT_OWNER_ID: ${{ vars.MONGODB_ATLAS_PROJECT_OWNER_ID }} - MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} - ACCTEST_PACKAGES: | - ./internal/service/onlinearchive - ./internal/service/cloudbackupschedule - ./internal/service/cloudbackupsnapshot - ./internal/service/cloudbackupsnapshotexportbucket - ./internal/service/cloudbackupsnapshotexportjob - ./internal/service/cloudbackupsnapshotrestorejob - run: make testacc - - advanced_cluster: - needs: [ change-detection, get-provider-version ] - if: ${{ needs.change-detection.outputs.advanced_cluster == 'true' || inputs.test_group == 'advanced_cluster' }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 - with: - go-version-file: 'go.mod' - - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 - with: - terraform_version: ${{ env.terraform_version }} - terraform_wrapper: false - - name: Migration Tests - env: - MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} - ACCTEST_PACKAGES: ./internal/service/advancedcluster - run: make testacc - - stream: - needs: [ change-detection, get-provider-version ] - if: ${{ needs.change-detection.outputs.stream == 'true' || inputs.test_group == 'stream' }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 - with: - go-version-file: 'go.mod' - - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 - with: - terraform_version: ${{ env.terraform_version }} - terraform_wrapper: false - - name: Migration Tests - env: - MONGODB_ATLAS_ENABLE_PREVIEW: "true" - # can be removed when MONGODB_ATLAS_LAST_VERSION supports the new MONGODB_ATLAS_ENABLE_PREVIEW flag - MONGODB_ATLAS_ENABLE_BETA: "true" - MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} - ACCTEST_PACKAGES: | - ./internal/service/streaminstance - ./internal/service/streamconnection - run: make testacc - - federated: - needs: [ change-detection, get-provider-version ] - if: ${{ needs.change-detection.outputs.federated == 'true' || inputs.test_group == 'federated' }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 - with: - go-version-file: 'go.mod' - - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 - with: - terraform_version: ${{ env.terraform_version }} - terraform_wrapper: false - - name: Migration Tests - env: - MONGODB_ATLAS_FEDERATION_SETTINGS_ID: ${{ vars.MONGODB_ATLAS_FEDERATION_SETTINGS_ID }} - MONGODB_ATLAS_FEDERATED_OKTA_IDP_ID: ${{ vars.MONGODB_ATLAS_FEDERATED_OKTA_IDP_ID }} - MONGODB_ATLAS_FEDERATED_IDP_ID: ${{ vars.MONGODB_ATLAS_FEDERATED_IDP_ID }} - MONGODB_ATLAS_FEDERATED_OIDC_IDP_ID: ${{ vars.MONGODB_ATLAS_FEDERATED_OIDC_IDP_ID }} - MONGODB_ATLAS_FEDERATED_SSO_URL: ${{ vars.MONGODB_ATLAS_FEDERATED_SSO_URL }} - MONGODB_ATLAS_FEDERATED_ISSUER_URI: ${{ vars.MONGODB_ATLAS_FEDERATED_ISSUER_URI }} - MONGODB_ATLAS_FEDERATED_ORG_ID: ${{ vars.MONGODB_ATLAS_FEDERATED_ORG_ID }} - AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET_FEDERATION }} - AWS_REGION: ${{ vars.AWS_REGION_FEDERATION }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} - ACCTEST_PACKAGES: | - ./internal/service/federatedsettingsidentityprovider - ./internal/service/federateddatabaseinstance - ./internal/service/federatedsettingsorgconfig - ./internal/service/federatedsettingsorgrolemapping - ./internal/service/federatedquerylimit - run: make testacc - - search_deployment: - needs: [ change-detection, get-provider-version ] - if: ${{ needs.change-detection.outputs.search_deployment == 'true' || inputs.test_group == 'search_deployment' }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 - with: - go-version-file: 'go.mod' - - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 - with: - terraform_version: ${{ env.terraform_version }} - terraform_wrapper: false - - name: Migration Tests - env: - MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} - ACCTEST_PACKAGES: ./internal/service/searchdeployment - run: make testacc - - generic: - needs: [ change-detection, get-provider-version ] - if: ${{ needs.change-detection.outputs.generic == 'true' || inputs.test_group == 'generic' }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 - with: - go-version-file: 'go.mod' - - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 - with: - terraform_version: ${{ env.terraform_version }} - terraform_wrapper: false - - name: Migration Tests - env: - MONGODB_ATLAS_PROJECT_OWNER_ID: ${{ vars.MONGODB_ATLAS_PROJECT_OWNER_ID }} - CA_CERT: ${{ secrets.CA_CERT }} - MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} - ACCTEST_PACKAGES: | - ./internal/service/backupcompliancepolicy - ./internal/service/auditing - ./internal/service/x509authenticationdatabaseuser - run: make testacc - - network: - needs: [ change-detection, get-provider-version ] - if: ${{ needs.change-detection.outputs.network == 'true' || inputs.test_group == 'network' }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 - with: - go-version-file: 'go.mod' - - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 - with: - terraform_version: ${{ env.terraform_version }} - terraform_wrapper: false - - name: Migration Tests - env: - MONGODB_ATLAS_PRIVATE_ENDPOINT_ID: ${{ secrets.MONGODB_ATLAS_PRIVATE_ENDPOINT_ID }} - MONGODB_ATLAS_PRIVATE_ENDPOINT_DNS_NAME: ${{ secrets.MONGODB_ATLAS_PRIVATE_ENDPOINT_DNS_NAME }} - AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_REGION: ${{ vars.AWS_REGION }} - AWS_SECURITY_GROUP_1: ${{ vars.AWS_SECURITY_GROUP_1 }} - AWS_SECURITY_GROUP_2: ${{ vars.AWS_SECURITY_GROUP_2 }} - AWS_VPC_CIDR_BLOCK: ${{ vars.AWS_VPC_CIDR_BLOCK }} - AWS_VPC_ID: ${{ vars.AWS_VPC_ID }} - MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} - ACCTEST_PACKAGES: | - ./internal/service/networkcontainer - ./internal/service/networkpeering - ./internal/service/privateendpointregionalmode - ./internal/service/privatelinkendpoint - ./internal/service/privatelinkendpointservice - ./internal/service/privatelinkendpointservicedatafederationonlinearchive - run: make testacc - encryption: - needs: [ change-detection, get-provider-version ] - if: ${{ needs.change-detection.outputs.encryption == 'true' || inputs.test_group == 'encryption' }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 - with: - go-version-file: 'go.mod' - - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 - with: - terraform_version: ${{ env.terraform_version }} - terraform_wrapper: false - - name: Migration Tests - env: - MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} - ACCTEST_PACKAGES: ./internal/service/encryptionatrest - run: make testacc - serverless: - needs: [ change-detection, get-provider-version ] - if: ${{ needs.change-detection.outputs.serverless == 'true' || inputs.test_group == 'serverless' }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 - with: - go-version-file: 'go.mod' - - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 - with: - terraform_version: ${{ env.terraform_version }} - terraform_wrapper: false - - name: Migration Tests - env: - AWS_ACCESS_KEY_ID: ${{ secrets.aws_access_key_id }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_access_key }} - MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} - ACCTEST_PACKAGES: | - ./internal/service/serverlessinstance - ./internal/service/privatelinkendpointserverless - ./internal/service/privatelinkendpointserviceserverless - run: make testacc - data_lake: - needs: [ change-detection, get-provider-version ] - if: ${{ needs.change-detection.outputs.data_lake == 'true' || inputs.test_group == 'data_lake' }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 - with: - go-version-file: 'go.mod' - - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 - with: - terraform_version: ${{ env.terraform_version }} - terraform_wrapper: false - - name: Migration Tests - env: - MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} - ACCTEST_PACKAGES: ./internal/service/datalakepipeline - run: make testacc - cluster_outage_simulation: - needs: [ change-detection, get-provider-version ] - if: ${{ needs.change-detection.outputs.cluster_outage_simulation == 'true' || inputs.test_group == 'cluster_outage_simulation' }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 - with: - go-version-file: 'go.mod' - - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 - with: - terraform_version: ${{ env.terraform_version }} - terraform_wrapper: false - - name: Migration Tests - env: - MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} - ACCTEST_PACKAGES: ./internal/service/clusteroutagesimulation - run: make testacc - cluster: - needs: [ change-detection, get-provider-version ] - if: ${{ needs.change-detection.outputs.cluster == 'true' || inputs.test_group == 'cluster' }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 - with: - go-version-file: 'go.mod' - - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 - with: - terraform_version: ${{ env.terraform_version }} - terraform_wrapper: false - - name: Migration Tests - env: - MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} - ACCTEST_PACKAGES: | - ./internal/service/cluster - ./internal/service/globalclusterconfig - run: make testacc - ldap: - needs: [ change-detection, get-provider-version ] - if: ${{ needs.change-detection.outputs.ldap == 'true' || inputs.test_group == 'ldap' }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 - with: - go-version-file: 'go.mod' - - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 - with: - terraform_version: ${{ env.terraform_version }} - terraform_wrapper: false - - name: Migration Tests - env: - MONGODB_ATLAS_LDAP_HOSTNAME: ${{ secrets.MONGODB_ATLAS_LDAP_HOSTNAME }} - MONGODB_ATLAS_LDAP_USERNAME: ${{ secrets.MONGODB_ATLAS_LDAP_USERNAME }} - MONGODB_ATLAS_LDAP_PASSWORD: ${{ secrets.MONGODB_ATLAS_LDAP_PASSWORD }} - MONGODB_ATLAS_LDAP_CA_CERTIFICATE: ${{ secrets.MONGODB_ATLAS_LDAP_CA_CERTIFICATE }} - MONGODB_ATLAS_LDAP_PORT: ${{ secrets.MONGODB_ATLAS_LDAP_PORT }} - MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} - ACCTEST_PACKAGES: | - ./internal/service/ldapconfiguration - ./internal/service/ldapverify - run: make testacc - search_index: - needs: [ change-detection, get-provider-version ] - if: ${{ needs.change-detection.outputs.search_index == 'true' || inputs.test_group == 'search_index' }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 - with: - go-version-file: 'go.mod' - - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 - with: - terraform_version: ${{ env.terraform_version }} - terraform_wrapper: false - - name: Migration Tests - env: - MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} - ACCTEST_PACKAGES: ./internal/service/searchindex - run: make testacc - \ No newline at end of file diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index 00fa2af636..d54402df72 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -48,7 +48,7 @@ jobs: secrets: inherit uses: ./.github/workflows/cleanup-test-env.yml - mig-tests: + tests: needs: [clean-before, versions] if: ${{ !cancelled() }} strategy: @@ -57,37 +57,23 @@ jobs: matrix: terraform_version: ${{ fromJSON(needs.versions.outputs.terraform_matrix) }} provider_version: ${{ fromJSON(needs.versions.outputs.provider_matrix) }} - name: mig-tests-${{ matrix.terraform_version || 'latest' }}-${{ matrix.provider_version || 'latest' }} - secrets: inherit - uses: ./.github/workflows/migration-tests.yml - with: - terraform_version: ${{ matrix.terraform_version }} - provider_version: ${{ matrix.provider_version }} - - acc-tests: - needs: [clean-before, versions] - if: ${{ !cancelled() }} - strategy: - max-parallel: 1 - fail-fast: false - matrix: - terraform_version: ${{ fromJSON(needs.versions.outputs.terraform_matrix) }} - name: acc-tests-${{ matrix.terraform_version || 'latest' }} + name: tests-${{ matrix.terraform_version || 'latest' }}-${{ matrix.provider_version || 'latest' }} secrets: inherit uses: ./.github/workflows/acceptance-tests.yml with: terraform_version: ${{ matrix.terraform_version }} + provider_version: ${{ matrix.provider_version }} atlas_cloud_env: ${{ inputs.atlas_cloud_env }} clean-after: - needs: [mig-tests, acc-tests] + needs: tests if: ${{ !cancelled() }} secrets: inherit uses: ./.github/workflows/cleanup-test-env.yml slack-notification: - needs: [mig-tests, acc-tests, clean-after] - if: ${{ !cancelled() && github.event_name == 'schedule' && (needs.mig-tests.result == 'failure' || needs.acc-tests.result == 'failure')}} + needs: [tests, clean-after] + if: ${{ !cancelled() && github.event_name == 'schedule' && needs.tests.result == 'failure'}} runs-on: ubuntu-latest steps: - name: Send Slack message diff --git a/internal/service/networkcontainer/resource_network_container_migration_test.go b/internal/service/networkcontainer/resource_network_container_migration_test.go index b7457f913b..0258e4e67a 100644 --- a/internal/service/networkcontainer/resource_network_container_migration_test.go +++ b/internal/service/networkcontainer/resource_network_container_migration_test.go @@ -13,13 +13,14 @@ import ( func TestMigNetworkContainer_basicAWS(t *testing.T) { var ( - projectID = acc.ProjectIDExecution(t) // No mig.ProjectIDGlobal because network container + projectID = acc.ProjectIDExecution(t) randInt = acctest.RandIntRange(0, 255) cidrBlock = fmt.Sprintf("10.8.%d.0/24", randInt) config = configBasic(projectID, cidrBlock, constant.AWS, "US_EAST_1") ) - resource.ParallelTest(t, resource.TestCase{ + // Serial so it doesn't conflict with TestAccNetworkContainer_basicAWS + resource.Test(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t) }, CheckDestroy: checkDestroy, Steps: []resource.TestStep{ @@ -35,13 +36,14 @@ func TestMigNetworkContainer_basicAWS(t *testing.T) { func TestMigNetworkContainer_basicAzure(t *testing.T) { var ( - projectID = acc.ProjectIDExecution(t) // No mig.ProjectIDGlobal because network container + projectID = acc.ProjectIDExecution(t) randInt = acctest.RandIntRange(0, 255) cidrBlock = fmt.Sprintf("10.8.%d.0/24", randInt) config = configBasic(projectID, cidrBlock, constant.AZURE, "US_EAST_2") ) - resource.ParallelTest(t, resource.TestCase{ + // Serial so it doesn't conflict with TestAccNetworkContainer_basicAzure + resource.Test(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t) }, CheckDestroy: checkDestroy, Steps: []resource.TestStep{ @@ -57,13 +59,14 @@ func TestMigNetworkContainer_basicAzure(t *testing.T) { func TestMigNetworkContainer_basicGCP(t *testing.T) { var ( - projectID = acc.ProjectIDExecution(t) // No mig.ProjectIDGlobal because network container + projectID = acc.ProjectIDExecution(t) randInt = acctest.RandIntRange(0, 255) gcpCidrBlock = fmt.Sprintf("10.%d.0.0/18", randInt) config = configBasic(projectID, gcpCidrBlock, constant.GCP, "") ) - resource.ParallelTest(t, resource.TestCase{ + // Serial so it doesn't conflict with TestAccNetworkContainer_basicGCP + resource.Test(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t) }, CheckDestroy: checkDestroy, Steps: []resource.TestStep{ diff --git a/internal/service/projectipaccesslist/resource_project_ip_access_list_migration_test.go b/internal/service/projectipaccesslist/resource_project_ip_access_list_migration_test.go index ad523099a3..6ea5b910aa 100644 --- a/internal/service/projectipaccesslist/resource_project_ip_access_list_migration_test.go +++ b/internal/service/projectipaccesslist/resource_project_ip_access_list_migration_test.go @@ -12,8 +12,8 @@ import ( func TestMigProjectIPAccessList_settingIPAddress(t *testing.T) { var ( - projectID = mig.ProjectIDGlobal(t) - ipAddress = acc.RandomIP(179, 154, 226) + projectID = acc.ProjectIDExecution(t) + ipAddress = acc.RandomIP(180, 154, 226) comment = fmt.Sprintf("TestAcc for ipAddress (%s)", ipAddress) config = configWithIPAddress(projectID, ipAddress, comment) ) @@ -34,8 +34,8 @@ func TestMigProjectIPAccessList_settingIPAddress(t *testing.T) { func TestMigProjectIPAccessList_settingCIDRBlock(t *testing.T) { var ( - projectID = mig.ProjectIDGlobal(t) - cidrBlock = acc.RandomIP(179, 154, 226) + "/32" + projectID = acc.ProjectIDExecution(t) + cidrBlock = acc.RandomIP(180, 154, 226) + "/32" comment = fmt.Sprintf("TestAcc for cidrBlock (%s)", cidrBlock) config = configWithCIDRBlock(projectID, cidrBlock, comment) ) @@ -56,7 +56,7 @@ func TestMigProjectIPAccessList_settingCIDRBlock(t *testing.T) { func TestMigProjectIPAccessList_settingAWSSecurityGroup(t *testing.T) { var ( - projectID = acc.ProjectIDExecution(t) // No mig.ProjectIDGlobal because network container + projectID = acc.ProjectIDExecution(t) awsSGroup = os.Getenv("AWS_SECURITY_GROUP_1") vpcID = os.Getenv("AWS_VPC_ID") vpcCIDRBlock = os.Getenv("AWS_VPC_CIDR_BLOCK") @@ -67,7 +67,8 @@ func TestMigProjectIPAccessList_settingAWSSecurityGroup(t *testing.T) { config = configWithAWSSecurityGroup(projectID, providerName, vpcID, awsAccountID, vpcCIDRBlock, awsRegion, awsSGroup, comment) ) - resource.ParallelTest(t, resource.TestCase{ + // Serial so it doesn't conflict with TestAccProjectIPAccessList_settingAWSSecurityGroup + resource.Test(t, resource.TestCase{ PreCheck: func() { mig.PreCheckPeeringEnvAWS(t) }, CheckDestroy: checkDestroy, Steps: []resource.TestStep{