Skip to content

Commit 07590e1

Browse files
authored
test: skip instead of fatal for team ids missing (#544)
1 parent e8944c5 commit 07590e1

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

mongodbatlas/data_source_mongodbatlas_project_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func TestAccDataSourceMongoDBAtlasProject_byID(t *testing.T) {
1616
orgID := os.Getenv("MONGODB_ATLAS_ORG_ID")
1717
teamsIds := strings.Split(os.Getenv("MONGODB_ATLAS_TEAMS_IDS"), ",")
1818
if len(teamsIds) < 2 {
19-
t.Fatal("`MONGODB_ATLAS_TEAMS_IDS` must have 2 team ids for this acceptance testing")
19+
t.Skip("`MONGODB_ATLAS_TEAMS_IDS` must have 2 team ids for this acceptance testing")
2020
}
2121

2222
resource.ParallelTest(t, resource.TestCase{
@@ -50,7 +50,7 @@ func TestAccDataSourceMongoDBAtlasProject_byName(t *testing.T) {
5050
orgID := os.Getenv("MONGODB_ATLAS_ORG_ID")
5151
teamsIds := strings.Split(os.Getenv("MONGODB_ATLAS_TEAMS_IDS"), ",")
5252
if len(teamsIds) < 2 {
53-
t.Fatal("`MONGODB_ATLAS_TEAMS_IDS` must have 2 team ids for this acceptance testing")
53+
t.Skip("`MONGODB_ATLAS_TEAMS_IDS` must have 2 team ids for this acceptance testing")
5454
}
5555

5656
resource.ParallelTest(t, resource.TestCase{

mongodbatlas/data_source_mongodbatlas_projects_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func TestAccDataSourceMongoDBAtlasProjects_basic(t *testing.T) {
1717
orgID := os.Getenv("MONGODB_ATLAS_ORG_ID")
1818
teamsIds := strings.Split(os.Getenv("MONGODB_ATLAS_TEAMS_IDS"), ",")
1919
if len(teamsIds) < 2 {
20-
t.Fatal("`MONGODB_ATLAS_TEAMS_IDS` must have 2 team ids for this acceptance testing")
20+
t.Skip("`MONGODB_ATLAS_TEAMS_IDS` must have 2 team ids for this acceptance testing")
2121
}
2222

2323
resource.Test(t, resource.TestCase{
@@ -51,7 +51,7 @@ func TestAccDataSourceMongoDBAtlasProjects_withPagination(t *testing.T) {
5151
orgID := os.Getenv("MONGODB_ATLAS_ORG_ID")
5252
teamsIds := strings.Split(os.Getenv("MONGODB_ATLAS_TEAMS_IDS"), ",")
5353
if len(teamsIds) < 2 {
54-
t.Fatal("`MONGODB_ATLAS_TEAMS_IDS` must have 2 team ids for this acceptance testing")
54+
t.Skip("`MONGODB_ATLAS_TEAMS_IDS` must have 2 team ids for this acceptance testing")
5555
}
5656

5757
resource.Test(t, resource.TestCase{

mongodbatlas/provider_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ func SkipTestExtCred(t *testing.T) {
171171

172172
func checkTeamsIds(t *testing.T) {
173173
if os.Getenv("MONGODB_ATLAS_TEAMS_IDS") == "" {
174-
t.Fatal("`MONGODB_ATLAS_TEAMS_IDS` must be set for Projects acceptance testing")
174+
t.Skip("`MONGODB_ATLAS_TEAMS_IDS` must be set for Projects acceptance testing")
175175
}
176176
}
177177

mongodbatlas/resource_mongodbatlas_project_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func TestAccResourceMongoDBAtlasProject_basic(t *testing.T) {
2424
teamsIds = strings.Split(os.Getenv("MONGODB_ATLAS_TEAMS_IDS"), ",")
2525
)
2626
if len(teamsIds) < 3 {
27-
t.Fatal("`MONGODB_ATLAS_TEAMS_IDS` must have 3 team ids for this acceptance testing")
27+
t.Skip("`MONGODB_ATLAS_TEAMS_IDS` must have 3 team ids for this acceptance testing")
2828
}
2929

3030
resource.ParallelTest(t, resource.TestCase{

0 commit comments

Comments
 (0)