Template
1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo synced 2024-11-24 10:46:10 +01:00

Fix setting.AppPath for integration tests

This commit is contained in:
Ethan Koenig 2017-06-09 14:13:46 -04:00
parent 4a3f40460b
commit e9b1b908ee

View file

@ -14,6 +14,7 @@ import (
"net/http/cookiejar"
"net/url"
"os"
"path"
"strings"
"testing"
@ -63,9 +64,11 @@ func initIntegrationTest() {
fmt.Println("Environment variable $GITEA_CONF not set")
os.Exit(1)
}
if os.Getenv("GITEA_ROOT") == "" {
if giteaRoot := os.Getenv("GITEA_ROOT"); giteaRoot == "" {
fmt.Println("Environment variable $GITEA_ROOT not set")
os.Exit(1)
} else {
setting.AppPath = path.Join(giteaRoot, "gitea")
}
setting.NewContext()