mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 19:00:54 +00:00
Merge pull request #1794 from youngsterxyf/issue1789
fix issue1789: when testing, load config explicitly and forcibly
This commit is contained in:
commit
3ac90df5fa
1
beego.go
1
beego.go
@ -89,5 +89,6 @@ func TestBeegoInit(ap string) {
|
|||||||
os.Setenv("BEEGO_RUNMODE", "test")
|
os.Setenv("BEEGO_RUNMODE", "test")
|
||||||
appConfigPath = filepath.Join(ap, "conf", "app.conf")
|
appConfigPath = filepath.Join(ap, "conf", "app.conf")
|
||||||
os.Chdir(ap)
|
os.Chdir(ap)
|
||||||
|
LoadAppConfig(appConfigProvider, appConfigPath)
|
||||||
initBeforeHTTPRun()
|
initBeforeHTTPRun()
|
||||||
}
|
}
|
||||||
|
@ -316,10 +316,6 @@ func LoadAppConfig(adapterName, configPath string) error {
|
|||||||
return fmt.Errorf("the target config file: %s don't exist", configPath)
|
return fmt.Errorf("the target config file: %s don't exist", configPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
if absConfigPath == appConfigPath {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
appConfigPath = absConfigPath
|
appConfigPath = absConfigPath
|
||||||
appConfigProvider = adapterName
|
appConfigProvider = adapterName
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user