Skip to content

Commit 0a02fb3

Browse files
ethantkoeniglunny
authored andcommitted
Windows compatibility for unit tests (#800)
1 parent 2eb15f4 commit 0a02fb3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

models/setup_for_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ package models
77
import (
88
"fmt"
99
"os"
10+
"path/filepath"
1011
"testing"
1112

1213
"code.gitea.io/gitea/modules/setting"
@@ -30,8 +31,8 @@ func TestMain(m *testing.M) {
3031
setting.RunUser = "runuser"
3132
setting.SSH.Port = 3000
3233
setting.SSH.Domain = "try.gitea.io"
33-
setting.RepoRootPath = "/tmp/repos"
34-
setting.AppDataPath = "/tmp/appdata"
34+
setting.RepoRootPath = filepath.Join(os.TempDir(), "repos")
35+
setting.AppDataPath = filepath.Join(os.TempDir(), "appdata")
3536

3637
os.Exit(m.Run())
3738
}

0 commit comments

Comments
 (0)