Skip to content

Commit

Permalink
mig.ProjectIDGlobal (#2068)
Browse files Browse the repository at this point in the history
  • Loading branch information
lantoli authored Mar 25, 2024
1 parent 13e4c80 commit 7ec51b7
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ import (
"testing"

"github.com/hashicorp/terraform-plugin-testing/helper/resource"
"github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc"
"github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/mig"
)

func TestMigConfigRSAlertConfiguration_withNotificationsMetricThreshold(t *testing.T) {
var (
projectID = acc.ProjectIDExecution(t)
projectID = mig.ProjectIDGlobal(t)
config = configBasicRS(projectID, true)
)

Expand All @@ -34,7 +33,7 @@ func TestMigConfigRSAlertConfiguration_withNotificationsMetricThreshold(t *testi

func TestMigConfigRSAlertConfiguration_withThreshold(t *testing.T) {
var (
projectID = acc.ProjectIDExecution(t)
projectID = mig.ProjectIDGlobal(t)
config = configWithThresholdUpdated(projectID, true, 1)
)

Expand All @@ -60,7 +59,7 @@ func TestMigConfigRSAlertConfiguration_withThreshold(t *testing.T) {

func TestMigConfigRSAlertConfiguration_withEmptyOptionalBlocks(t *testing.T) {
var (
projectID = acc.ProjectIDExecution(t)
projectID = mig.ProjectIDGlobal(t)
config = configWithEmptyOptionalBlocks(projectID)
)

Expand All @@ -87,7 +86,7 @@ func TestMigConfigRSAlertConfiguration_withEmptyOptionalBlocks(t *testing.T) {

func TestMigConfigRSAlertConfiguration_withMultipleMatchers(t *testing.T) {
var (
projectID = acc.ProjectIDExecution(t)
projectID = mig.ProjectIDGlobal(t)
config = configWithMatchers(projectID, true, false, true,
map[string]interface{}{
"fieldName": "TYPE_NAME",
Expand Down Expand Up @@ -121,7 +120,7 @@ func TestMigConfigRSAlertConfiguration_withMultipleMatchers(t *testing.T) {

func TestMigConfigRSAlertConfiguration_withEmptyOptionalAttributes(t *testing.T) {
var (
projectID = acc.ProjectIDExecution(t)
projectID = mig.ProjectIDGlobal(t)
config = configWithEmptyOptionalAttributes(projectID)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

func TestMigConfigRSDatabaseUser_Basic(t *testing.T) {
var (
projectID = acc.ProjectIDExecution(t)
projectID = mig.ProjectIDGlobal(t)
username = acc.RandomName()
config = acc.ConfigDatabaseUserBasic(projectID, username, "atlasAdmin", "First Key", "First value")
)
Expand All @@ -40,7 +40,7 @@ func TestMigConfigRSDatabaseUser_Basic(t *testing.T) {

func TestMigConfigRSDatabaseUser_withX509TypeCustomer(t *testing.T) {
var (
projectID = acc.ProjectIDExecution(t)
projectID = mig.ProjectIDGlobal(t)
username = acc.RandomLDAPName()
x509Type = "CUSTOMER"
config = acc.ConfigDatabaseUserWithX509Type(projectID, username, x509Type, "atlasAdmin", "First Key", "First value")
Expand All @@ -66,7 +66,7 @@ func TestMigConfigRSDatabaseUser_withX509TypeCustomer(t *testing.T) {
}
func TestMigConfigRSDatabaseUser_withAWSIAMType(t *testing.T) {
var (
projectID = acc.ProjectIDExecution(t)
projectID = mig.ProjectIDGlobal(t)
username = acc.RandomIAMUser()
config = acc.ConfigDatabaseUserWithAWSIAMType(projectID, username, "atlasAdmin", "First Key", "First value")
)
Expand All @@ -92,7 +92,7 @@ func TestMigConfigRSDatabaseUser_withAWSIAMType(t *testing.T) {

func TestMigConfigRSDatabaseUser_withLabels(t *testing.T) {
var (
projectID = acc.ProjectIDExecution(t)
projectID = mig.ProjectIDGlobal(t)
username = acc.RandomName()
config = acc.ConfigDatabaseUserWithLabels(projectID, username, "atlasAdmin",
[]admin.ComponentLabel{
Expand Down Expand Up @@ -131,7 +131,7 @@ func TestMigConfigRSDatabaseUser_withLabels(t *testing.T) {

func TestMigConfigRSDatabaseUser_withEmptyLabels(t *testing.T) {
var (
projectID = acc.ProjectIDExecution(t)
projectID = mig.ProjectIDGlobal(t)
username = acc.RandomName()
config = acc.ConfigDatabaseUserWithLabels(projectID, username, "atlasAdmin", nil)
)
Expand All @@ -157,7 +157,7 @@ func TestMigConfigRSDatabaseUser_withEmptyLabels(t *testing.T) {

func TestMigConfigRSDatabaseUser_withRoles(t *testing.T) {
var (
projectID = acc.ProjectIDExecution(t)
projectID = mig.ProjectIDGlobal(t)
username = acc.RandomName()
password = acc.RandomName()
config = acc.ConfigDatabaseUserWithRoles(projectID, username, password,
Expand Down Expand Up @@ -197,7 +197,7 @@ func TestMigConfigRSDatabaseUser_withRoles(t *testing.T) {

func TestMigConfigRSDatabaseUser_withScopes(t *testing.T) {
var (
projectID = acc.ProjectIDExecution(t)
projectID = mig.ProjectIDGlobal(t)
userScopeName = acc.RandomName()
username = acc.RandomName()
password = acc.RandomName()
Expand Down Expand Up @@ -234,7 +234,7 @@ func TestMigConfigRSDatabaseUser_withScopes(t *testing.T) {

func TestMigConfigRSDatabaseUser_withEmptyScopes(t *testing.T) {
var (
projectID = acc.ProjectIDExecution(t)
projectID = mig.ProjectIDGlobal(t)
username = acc.RandomName()
password = acc.RandomName()
config = acc.ConfigDatabaseUserWithScopes(projectID, username, password, "atlasAdmin", nil)
Expand All @@ -261,7 +261,7 @@ func TestMigConfigRSDatabaseUser_withEmptyScopes(t *testing.T) {

func TestMigConfigRSDatabaseUser_withLDAPAuthType(t *testing.T) {
var (
projectID = acc.ProjectIDExecution(t)
projectID = mig.ProjectIDGlobal(t)
username = acc.RandomLDAPName()
config = acc.ConfigDatabaseUserWithLDAPAuthType(projectID, username, "atlasAdmin", "First Key", "First value")
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

func TestMigNetworkContainer_basicAWS(t *testing.T) {
var (
projectID = acc.ProjectIDExecution(t)
projectID = acc.ProjectIDExecution(t) // No mig.ProjectIDGlobal because network container
randInt = acctest.RandIntRange(0, 255)
cidrBlock = fmt.Sprintf("10.8.%d.0/24", randInt)
config = configBasic(projectID, cidrBlock, constant.AWS, "US_EAST_1")
Expand All @@ -35,7 +35,7 @@ func TestMigNetworkContainer_basicAWS(t *testing.T) {

func TestMigNetworkContainer_basicAzure(t *testing.T) {
var (
projectID = acc.ProjectIDExecution(t)
projectID = acc.ProjectIDExecution(t) // No mig.ProjectIDGlobal because network container
randInt = acctest.RandIntRange(0, 255)
cidrBlock = fmt.Sprintf("10.8.%d.0/24", randInt)
config = configBasic(projectID, cidrBlock, constant.AZURE, "US_EAST_2")
Expand All @@ -57,7 +57,7 @@ func TestMigNetworkContainer_basicAzure(t *testing.T) {

func TestMigNetworkContainer_basicGCP(t *testing.T) {
var (
projectID = acc.ProjectIDExecution(t)
projectID = acc.ProjectIDExecution(t) // No mig.ProjectIDGlobal because network container
randInt = acctest.RandIntRange(0, 255)
gcpCidrBlock = fmt.Sprintf("10.%d.0.0/18", randInt)
config = configBasic(projectID, gcpCidrBlock, constant.GCP, "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

func TestMigNetworkPrivatelinkEndpointServiceDataFederationOnlineArchive_basic(t *testing.T) {
var (
projectID = acc.ProjectIDExecution(t)
projectID = acc.ProjectIDExecution(t) // No mig.ProjectIDGlobal because private link endpoint
endpointID = os.Getenv("MONGODB_ATLAS_PRIVATE_ENDPOINT_ID")
config = resourceConfigBasic(projectID, endpointID, comment)
)
Expand Down

0 comments on commit 7ec51b7

Please sign in to comment.