From fec1c038ffa650b58cf5aa0b2f89c3725d3d7e64 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sat, 21 Feb 2026 22:08:50 +0100 Subject: [PATCH] fix: use in-memory SQLite and log temp directory cleanup in test:e2e Switch from file-based SQLite to VIKUNJA_DATABASE_PATH=memory which uses file::memory:?cache=shared. Also add a visible log line when cleaning up the temp directory so the teardown sequence is clear. --- magefile.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/magefile.go b/magefile.go index 52fa2d991..6c51df546 100644 --- a/magefile.go +++ b/magefile.go @@ -476,18 +476,22 @@ func (Test) E2E(args string) error { } } - // Create temp directory for the SQLite DB and file uploads + // Create temp directory for file uploads and rootpath tmpDir, err := os.MkdirTemp("", "vikunja-e2e-*") if err != nil { return fmt.Errorf("failed to create temp dir: %w", err) } - defer os.RemoveAll(tmpDir) + defer func() { + fmt.Println("\n--- Cleaning up temp directory ---") + os.RemoveAll(tmpDir) + }() if err := os.MkdirAll(filepath.Join(tmpDir, "files"), 0o755); err != nil { return fmt.Errorf("failed to create files dir: %w", err) } // Start the API server — all config via env vars, no config file + // Uses in-memory SQLite (no DB file on disk) fmt.Println("\n--- Starting API server ---") apiCmd := exec.Command("./vikunja", "web") apiCmd.Env = append(os.Environ(), @@ -497,7 +501,7 @@ func (Test) E2E(args string) error { fmt.Sprintf("VIKUNJA_SERVICE_ROOTPATH=%s", tmpDir), "VIKUNJA_SERVICE_JWTSECRET=e2e-test-jwt-secret-do-not-use-in-production", "VIKUNJA_DATABASE_TYPE=sqlite", - fmt.Sprintf("VIKUNJA_DATABASE_PATH=%s", filepath.Join(tmpDir, "vikunja-e2e.db")), + "VIKUNJA_DATABASE_PATH=memory", fmt.Sprintf("VIKUNJA_FILES_BASEPATH=%s", filepath.Join(tmpDir, "files")), "VIKUNJA_LOG_LEVEL=WARNING", "VIKUNJA_MAILER_ENABLED=false",