diff --git a/tests/sqlite.ini.tmpl b/tests/sqlite.ini.tmpl index 04566d39d4..277916a539 100644 --- a/tests/sqlite.ini.tmpl +++ b/tests/sqlite.ini.tmpl @@ -4,7 +4,8 @@ RUN_MODE = prod [database] DB_TYPE = sqlite3 -PATH = :memory: +PATH = tests/{{TEST_TYPE}}/gitea-{{TEST_TYPE}}-sqlite/gitea.db +SQLITE_JOURNAL_MODE = MEMORY [indexer] REPO_INDEXER_ENABLED = true diff --git a/tests/test_utils.go b/tests/test_utils.go index d6516dd99a..cd52a4dd97 100644 --- a/tests/test_utils.go +++ b/tests/test_utils.go @@ -175,6 +175,9 @@ func InitTest(requireGitea bool) { log.Fatal("db.Exec: CREATE SCHEMA: %v", err) } } + + case setting.Database.Type.IsSQLite3(): + setting.Database.Path = ":memory:" } routers.InitWebInstalled(graceful.GetManager().HammerContext())