summaryrefslogtreecommitdiffstats
path: root/integrations/integration_test.go
diff options
context:
space:
mode:
authorEthan Koenig <ethantkoenig@gmail.com>2017-06-09 22:27:13 -0400
committerEthan Koenig <ethantkoenig@gmail.com>2017-06-09 22:27:13 -0400
commit23d0735f906498ca273b7cac399e9c8f0a0f08e8 (patch)
tree70d5f4669408098a9eadf13100ee559defd940f2 /integrations/integration_test.go
parente9b1b908ee7c5b0722f6bce51aef4519990fae0b (diff)
downloadgitea-23d0735f906498ca273b7cac399e9c8f0a0f08e8.tar.gz
gitea-23d0735f906498ca273b7cac399e9c8f0a0f08e8.zip
Absolute path for setting.CustomConf
Diffstat (limited to 'integrations/integration_test.go')
-rw-r--r--integrations/integration_test.go16
1 files changed, 11 insertions, 5 deletions
diff --git a/integrations/integration_test.go b/integrations/integration_test.go
index a0271ce6bf..77a5a2b727 100644
--- a/integrations/integration_test.go
+++ b/integrations/integration_test.go
@@ -60,15 +60,21 @@ func TestMain(m *testing.M) {
}
func initIntegrationTest() {
- if setting.CustomConf = os.Getenv("GITEA_CONF"); setting.CustomConf == "" {
- fmt.Println("Environment variable $GITEA_CONF not set")
+ giteaRoot := os.Getenv("GITEA_ROOT")
+ if giteaRoot == "" {
+ fmt.Println("Environment variable $GITEA_ROOT not set")
os.Exit(1)
}
- if giteaRoot := os.Getenv("GITEA_ROOT"); giteaRoot == "" {
- fmt.Println("Environment variable $GITEA_ROOT not set")
+ setting.AppPath = path.Join(giteaRoot, "gitea")
+
+ giteaConf := os.Getenv("GITEA_CONF")
+ if giteaConf == "" {
+ fmt.Println("Environment variable $GITEA_CONF not set")
os.Exit(1)
+ } else if !path.IsAbs(giteaConf) {
+ setting.CustomConf = path.Join(giteaRoot, giteaConf)
} else {
- setting.AppPath = path.Join(giteaRoot, "gitea")
+ setting.CustomConf = giteaConf
}
setting.NewContext()