chore: Refactor test setup for Gin framework
- Removed redundant `gin.SetMode(gin.TestMode)` calls from individual test files. - Introduced a centralized `TestMain` function in `testmain_test.go` to set the Gin mode for all tests. - Ensured consistent test environment setup across various handler test files.
This commit is contained in:
@@ -251,7 +251,6 @@ func TestConfigArchiveValidator_RequiredFiles(t *testing.T) {
|
||||
// TestImportConfig_Validation tests the enhanced ImportConfig handler with validation.
|
||||
func TestImportConfig_Validation(t *testing.T) {
|
||||
t.Parallel()
|
||||
gin.SetMode(gin.TestMode)
|
||||
|
||||
db := OpenTestDB(t)
|
||||
tmpDir := t.TempDir()
|
||||
@@ -320,7 +319,6 @@ func TestImportConfig_Validation(t *testing.T) {
|
||||
// TestImportConfig_Rollback tests backup restoration on validation failure.
|
||||
func TestImportConfig_Rollback(t *testing.T) {
|
||||
t.Parallel()
|
||||
gin.SetMode(gin.TestMode)
|
||||
|
||||
db := OpenTestDB(t)
|
||||
tmpDir := t.TempDir()
|
||||
|
||||
Reference in New Issue
Block a user