Skip to content

Commit

Permalink
test: skip instead of fatal for team ids missing (#544)
Browse files Browse the repository at this point in the history
  • Loading branch information
gssbzn committed Aug 27, 2021
1 parent e8944c5 commit 07590e1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions mongodbatlas/data_source_mongodbatlas_project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func TestAccDataSourceMongoDBAtlasProject_byID(t *testing.T) {
orgID := os.Getenv("MONGODB_ATLAS_ORG_ID")
teamsIds := strings.Split(os.Getenv("MONGODB_ATLAS_TEAMS_IDS"), ",")
if len(teamsIds) < 2 {
t.Fatal("`MONGODB_ATLAS_TEAMS_IDS` must have 2 team ids for this acceptance testing")
t.Skip("`MONGODB_ATLAS_TEAMS_IDS` must have 2 team ids for this acceptance testing")
}

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

resource.ParallelTest(t, resource.TestCase{
Expand Down
4 changes: 2 additions & 2 deletions mongodbatlas/data_source_mongodbatlas_projects_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func TestAccDataSourceMongoDBAtlasProjects_basic(t *testing.T) {
orgID := os.Getenv("MONGODB_ATLAS_ORG_ID")
teamsIds := strings.Split(os.Getenv("MONGODB_ATLAS_TEAMS_IDS"), ",")
if len(teamsIds) < 2 {
t.Fatal("`MONGODB_ATLAS_TEAMS_IDS` must have 2 team ids for this acceptance testing")
t.Skip("`MONGODB_ATLAS_TEAMS_IDS` must have 2 team ids for this acceptance testing")
}

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

resource.Test(t, resource.TestCase{
Expand Down
2 changes: 1 addition & 1 deletion mongodbatlas/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func SkipTestExtCred(t *testing.T) {

func checkTeamsIds(t *testing.T) {
if os.Getenv("MONGODB_ATLAS_TEAMS_IDS") == "" {
t.Fatal("`MONGODB_ATLAS_TEAMS_IDS` must be set for Projects acceptance testing")
t.Skip("`MONGODB_ATLAS_TEAMS_IDS` must be set for Projects acceptance testing")
}
}

Expand Down
2 changes: 1 addition & 1 deletion mongodbatlas/resource_mongodbatlas_project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestAccResourceMongoDBAtlasProject_basic(t *testing.T) {
teamsIds = strings.Split(os.Getenv("MONGODB_ATLAS_TEAMS_IDS"), ",")
)
if len(teamsIds) < 3 {
t.Fatal("`MONGODB_ATLAS_TEAMS_IDS` must have 3 team ids for this acceptance testing")
t.Skip("`MONGODB_ATLAS_TEAMS_IDS` must have 3 team ids for this acceptance testing")
}

resource.ParallelTest(t, resource.TestCase{
Expand Down

0 comments on commit 07590e1

Please sign in to comment.