Skip to content

Commit

Permalink
test: account for 'Parse' kind of db in acceptance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lewis-od committed Oct 14, 2022
1 parent a515318 commit 7a117d7
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions internal/services/cosmos/cosmosdb_account_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@ import (
type CosmosDBAccountResource struct{}

func TestAccCosmosDBAccount_basic_global_boundedStaleness(t *testing.T) {
testAccCosmosDBAccount_basicWith(t, documentdb.DatabaseAccountKindGlobalDocumentDB, documentdb.DefaultConsistencyLevelBoundedStaleness)
testAccCosmosDBAccount_basicDocumentDbWith(t, documentdb.DefaultConsistencyLevelBoundedStaleness)
}

func TestAccCosmosDBAccount_basic_global_consistentPrefix(t *testing.T) {
testAccCosmosDBAccount_basicWith(t, documentdb.DatabaseAccountKindGlobalDocumentDB, documentdb.DefaultConsistencyLevelConsistentPrefix)
testAccCosmosDBAccount_basicDocumentDbWith(t, documentdb.DefaultConsistencyLevelConsistentPrefix)
}

func TestAccCosmosDBAccount_basic_global_eventual(t *testing.T) {
testAccCosmosDBAccount_basicWith(t, documentdb.DatabaseAccountKindGlobalDocumentDB, documentdb.DefaultConsistencyLevelEventual)
testAccCosmosDBAccount_basicDocumentDbWith(t, documentdb.DefaultConsistencyLevelEventual)
}

func TestAccCosmosDBAccount_basic_global_session(t *testing.T) {
testAccCosmosDBAccount_basicWith(t, documentdb.DatabaseAccountKindGlobalDocumentDB, documentdb.DefaultConsistencyLevelSession)
testAccCosmosDBAccount_basicDocumentDbWith(t, documentdb.DefaultConsistencyLevelSession)
}

func TestAccCosmosDBAccount_basic_global_strong(t *testing.T) {
testAccCosmosDBAccount_basicWith(t, documentdb.DatabaseAccountKindGlobalDocumentDB, documentdb.DefaultConsistencyLevelStrong)
testAccCosmosDBAccount_basicDocumentDbWith(t, documentdb.DefaultConsistencyLevelStrong)
}

func TestAccCosmosDBAccount_basic_mongo_boundedStaleness(t *testing.T) {
Expand Down Expand Up @@ -183,6 +183,21 @@ func testAccCosmosDBAccount_basicWith(t *testing.T, kind documentdb.DatabaseAcco
data.ResourceTest(t, r, []acceptance.TestStep{
{
Config: r.basic(data, kind, consistency),
Check: acceptance.ComposeAggregateTestCheckFunc(
checkAccCosmosDBAccount_basic(data, consistency, 1),
),
},
data.ImportStep(),
})
}

func testAccCosmosDBAccount_basicDocumentDbWith(t *testing.T, consistency documentdb.DefaultConsistencyLevel) {
data := acceptance.BuildTestData(t, "azurerm_cosmosdb_account", "test")
r := CosmosDBAccountResource{}

data.ResourceTest(t, r, []acceptance.TestStep{
{
Config: r.basic(data, documentdb.DatabaseAccountKindGlobalDocumentDB, consistency),
Check: acceptance.ComposeAggregateTestCheckFunc(
checkAccCosmosDBAccount_basic(data, consistency, 1),
checkAccCosmosDBAccount_sql(data),
Expand Down

0 comments on commit 7a117d7

Please sign in to comment.