2018-03-21 19:43:21 +00:00
|
|
|
// Copyright 2016-2018, Pulumi Corporation. All rights reserved.
|
2017-10-31 01:33:03 +00:00
|
|
|
|
|
|
|
package tests
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"os"
|
|
|
|
"testing"
|
|
|
|
|
2023-10-18 10:52:54 +00:00
|
|
|
"github.com/pulumi/pulumi/sdk/v3/go/common/env"
|
2017-10-31 01:33:03 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestMain(m *testing.M) {
|
2018-02-21 05:05:57 +00:00
|
|
|
// Disable stack backups for tests to avoid filling up ~/.pulumi/backups with unnecessary
|
|
|
|
// backups of test stacks.
|
2024-01-30 15:53:10 +00:00
|
|
|
disableCheckpointBackups := env.DIYBackendDisableCheckpointBackups.Var().Name()
|
2023-10-18 10:52:54 +00:00
|
|
|
if err := os.Setenv(disableCheckpointBackups, "1"); err != nil {
|
|
|
|
fmt.Printf("error setting env var '%s': %v\n", disableCheckpointBackups, err)
|
2018-02-21 05:05:57 +00:00
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
|
2017-10-31 01:33:03 +00:00
|
|
|
code := m.Run()
|
|
|
|
os.Exit(code)
|
|
|
|
}
|