From 0a5fc21b69fd6eaa26db0babe0fbc4b473af9526 Mon Sep 17 00:00:00 2001 From: Maxime Duchene-Savard Date: Thu, 3 Apr 2025 09:09:23 -0400 Subject: [PATCH] travaux --- .gitignore | 2 ++ apis/auth_endpoints_test.go | 5 ++--- db/db_test.go | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 55b1150..3c5ba60 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /frontend/node_modules/ /frontend/dist/ +clortho.db +clortho diff --git a/apis/auth_endpoints_test.go b/apis/auth_endpoints_test.go index bacdcfd..9b1c5bf 100644 --- a/apis/auth_endpoints_test.go +++ b/apis/auth_endpoints_test.go @@ -16,19 +16,18 @@ import ( func TestMain(m *testing.M) { // Set up test database file - os.Setenv("CLORTHO_DB_FILE", "test_clortho.db") + os.Setenv("CLORTHO_DB_FILE", "clortho_test.db") // Global setup fmt.Println("Setting up resources...") db.InitDb() + defer db.ResetDb() exitCode := m.Run() // Run all tests // Global teardown fmt.Println("Cleaning up resources...") - db.ResetDb() - os.Exit(exitCode) } diff --git a/db/db_test.go b/db/db_test.go index f580ba3..f64a772 100644 --- a/db/db_test.go +++ b/db/db_test.go @@ -8,8 +8,8 @@ import ( // Test to check if all expected tables exist in the database func TestTablesExist(t *testing.T) { // Set up test database file - os.Setenv("CLORTHO_DB_FILE", "test_clortho.db") - defer os.Remove("test_clortho.db") // Cleanup after test + os.Setenv("CLORTHO_DB_FILE", "clortho_test.db") + defer os.Remove("clortho_test.db") // Cleanup after test // Initialize database err := InitDb()