mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-05-16 11:19:11 +00:00
26 lines
556 B
Go
26 lines
556 B
Go
package api
|
|
|
|
import (
|
|
"os"
|
|
"strconv"
|
|
"testing"
|
|
|
|
"github.com/rs/zerolog"
|
|
"github.com/rs/zerolog/log"
|
|
"golang.org/x/crypto/bcrypt"
|
|
)
|
|
|
|
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()
|
|
code := m.Run()
|
|
_ = os.RemoveAll(dataDir)
|
|
os.Exit(code)
|
|
}
|