Skip to content

Commit

Permalink
simplify TestMainExecution conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
lantoli committed Mar 13, 2024
1 parent 68030d6 commit 1d0fe09
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions internal/testutil/acc/atlas.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@ import (

// TestMainExecution must be called from TestMain in the test package if ProjectIDExecution is going to be used.
func TestMainExecution(m *testing.M) {
if !InUnitTest() {
atlasInfo.init = true
atlasInfo.resourceName = resourceName()
}
atlasInfo.init = true
atlasInfo.resourceName = resourceName()

exitCode := m.Run()

if !InUnitTest() && atlasInfo.needsDeletion {
if atlasInfo.needsDeletion {
fmt.Printf("Deleting execution project: %s, resource: %s\n", atlasInfo.projectName, atlasInfo.resourceName)
deleteProject(atlasInfo.projectID)
}
Expand Down

0 comments on commit 1d0fe09

Please sign in to comment.