From 0a02fb3c4fc241aca54e4ec62e4029e6db3be3f9 Mon Sep 17 00:00:00 2001 From: Ethan Koenig Date: Mon, 30 Jan 2017 09:22:04 -0500 Subject: [PATCH] Windows compatibility for unit tests (#800) --- models/setup_for_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/models/setup_for_test.go b/models/setup_for_test.go index c3e5c3aa5..fd5a180ae 100644 --- a/models/setup_for_test.go +++ b/models/setup_for_test.go @@ -7,6 +7,7 @@ package models import ( "fmt" "os" + "path/filepath" "testing" "code.gitea.io/gitea/modules/setting" @@ -30,8 +31,8 @@ func TestMain(m *testing.M) { setting.RunUser = "runuser" setting.SSH.Port = 3000 setting.SSH.Domain = "try.gitea.io" - setting.RepoRootPath = "/tmp/repos" - setting.AppDataPath = "/tmp/appdata" + setting.RepoRootPath = filepath.Join(os.TempDir(), "repos") + setting.AppDataPath = filepath.Join(os.TempDir(), "appdata") os.Exit(m.Run()) }