mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-10 02:25:56 +00:00
Isolate internal/api tests from system data dir
This commit is contained in:
@@ -11,9 +11,16 @@ import (
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
dataDir, err := os.MkdirTemp("", "pulse-internal-api-test-*")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
_ = os.Setenv("PULSE_TEST_BCRYPT_COST", strconv.Itoa(bcrypt.MinCost))
|
||||
_ = os.Setenv("PULSE_UPDATE_SERVER", "http://127.0.0.1:1")
|
||||
_ = os.Setenv("PULSE_DATA_DIR", dataDir)
|
||||
allowLoopbackSSOFetch = true
|
||||
log.Logger = zerolog.Nop()
|
||||
os.Exit(m.Run())
|
||||
code := m.Run()
|
||||
_ = os.RemoveAll(dataDir)
|
||||
os.Exit(code)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user