Skip to content

Commit

Permalink
fix init test bug
Browse files Browse the repository at this point in the history
  • Loading branch information
trheyi committed Oct 7, 2021
1 parent b51942b commit 6ae845c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
11 changes: 6 additions & 5 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,17 @@ func (cfg *Config) SetDefaults() {

if cfg.RootDB == "" {
cfg.RootDB = cfg.Root + "/db"
cfg.RootDB = strings.TrimPrefix(cfg.RootDB, "fs://")
cfg.RootDB = strings.TrimPrefix(cfg.RootDB, "file://")
}

if cfg.RootUI == "" {
cfg.RootUI = cfg.Root + "/ui"
cfg.RootUI = strings.TrimPrefix(cfg.RootUI, "fs://")
cfg.RootUI = strings.TrimPrefix(cfg.RootUI, "file://")

}

// 过滤数据
cfg.RootDB = strings.TrimPrefix(cfg.RootDB, "fs://")
cfg.RootDB = strings.TrimPrefix(cfg.RootDB, "file://")
cfg.RootUI = strings.TrimPrefix(cfg.RootUI, "fs://")
cfg.RootUI = strings.TrimPrefix(cfg.RootUI, "file://")
}

// SetEnvFile 指定ENV文件
Expand Down
6 changes: 0 additions & 6 deletions global/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ package global

import (
"os"
"path"
"testing"

"github.com/yaoapp/gou"
"github.com/yaoapp/xiang/config"
"github.com/yaoapp/xiang/table"
)

var cfg config.Config
Expand All @@ -17,10 +15,6 @@ func TestMain(m *testing.M) {
// 加载模型等
Load(config.Conf)

// 加载表格(临时)
root := "fs://" + path.Join(Conf.Source, "/app/tables/service.json")
table.Load(root, "service").Reload()

// Run test suites
exitVal := m.Run()

Expand Down

0 comments on commit 6ae845c

Please sign in to comment.