Upgrades to Beego v1.8.0
This commit is contained in:
+10
-3
@@ -4,6 +4,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"sync"
|
||||
"testing"
|
||||
|
||||
"github.com/astaxie/beego"
|
||||
@@ -11,15 +12,21 @@ import (
|
||||
"github.com/cloudsonic/sonic-server/utils"
|
||||
)
|
||||
|
||||
var initSync sync.Once
|
||||
|
||||
func Init(t *testing.T, skipOnShort bool) {
|
||||
conf.LoadFromFile("../tests/sonic-test.toml")
|
||||
if skipOnShort && testing.Short() {
|
||||
t.Skip("skipping test in short mode.")
|
||||
}
|
||||
|
||||
_, file, _, _ := runtime.Caller(0)
|
||||
appPath, _ := filepath.Abs(filepath.Join(filepath.Dir(file), ".."))
|
||||
beego.TestBeegoInit(appPath)
|
||||
confPath, _ := filepath.Abs(filepath.Join(appPath, "tests", "sonic-test.toml"))
|
||||
|
||||
conf.LoadFromFile(confPath)
|
||||
|
||||
initSync.Do(func() {
|
||||
beego.TestBeegoInit(appPath)
|
||||
})
|
||||
|
||||
noLog := os.Getenv("NOLOG")
|
||||
if noLog != "" {
|
||||
|
||||
Reference in New Issue
Block a user