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 6e97566 commit b7c7488
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions internal/testutil/acc/atlas.go
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 b7c7488

Please sign in to comment.