mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-29 10:57:44 +09:00 
			
		
		
		
	Fix setting.AppPath for integration tests
This commit is contained in:
		| @@ -14,6 +14,7 @@ import ( | |||||||
| 	"net/http/cookiejar" | 	"net/http/cookiejar" | ||||||
| 	"net/url" | 	"net/url" | ||||||
| 	"os" | 	"os" | ||||||
|  | 	"path" | ||||||
| 	"strings" | 	"strings" | ||||||
| 	"testing" | 	"testing" | ||||||
|  |  | ||||||
| @@ -63,9 +64,11 @@ func initIntegrationTest() { | |||||||
| 		fmt.Println("Environment variable $GITEA_CONF not set") | 		fmt.Println("Environment variable $GITEA_CONF not set") | ||||||
| 		os.Exit(1) | 		os.Exit(1) | ||||||
| 	} | 	} | ||||||
| 	if os.Getenv("GITEA_ROOT") == "" { | 	if giteaRoot := os.Getenv("GITEA_ROOT"); giteaRoot == "" { | ||||||
| 		fmt.Println("Environment variable $GITEA_ROOT not set") | 		fmt.Println("Environment variable $GITEA_ROOT not set") | ||||||
| 		os.Exit(1) | 		os.Exit(1) | ||||||
|  | 	} else { | ||||||
|  | 		setting.AppPath = path.Join(giteaRoot, "gitea") | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	setting.NewContext() | 	setting.NewContext() | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user