From aea3c7d6e86894a3324eba25d29c5006d3a24a54 Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Thu, 14 Nov 2024 15:37:50 +0100 Subject: [PATCH] test: use memory for integration and journal for migration --- tests/sqlite.ini.tmpl | 3 ++- tests/test_utils.go | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) 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())