From 251fb935ff39520482a5436b19bc04352ea25db7 Mon Sep 17 00:00:00 2001 From: Ethan Koenig Date: Thu, 11 May 2017 11:32:43 -0400 Subject: [PATCH] Don't recreate database in integration tests (#1697) --- integrations/integration_test.go | 7 +------ models/fixtures/protected_branch.yml | 1 + 2 files changed, 2 insertions(+), 6 deletions(-) create mode 100644 models/fixtures/protected_branch.yml diff --git a/integrations/integration_test.go b/integrations/integration_test.go index 1bac2c196420..88b4614b7621 100644 --- a/integrations/integration_test.go +++ b/integrations/integration_test.go @@ -79,9 +79,6 @@ func initIntegrationTest() { if err != nil { log.Fatalf("sql.Open: %v", err) } - if _, err = db.Exec("DROP DATABASE IF EXISTS testgitea"); err != nil { - log.Fatalf("db.drop db: %v", err) - } if _, err = db.Exec("CREATE DATABASE IF NOT EXISTS testgitea"); err != nil { log.Fatalf("db.Exec: %v", err) } @@ -100,9 +97,7 @@ func initIntegrationTest() { defer rows.Close() if rows.Next() { - if _, err = db.Exec("DROP DATABASE testgitea"); err != nil { - log.Fatalf("db.drop db: %v", err) - } + break } if _, err = db.Exec("CREATE DATABASE testgitea"); err != nil { log.Fatalf("db.Exec: %v", err) diff --git a/models/fixtures/protected_branch.yml b/models/fixtures/protected_branch.yml new file mode 100644 index 000000000000..ca780a73aa0c --- /dev/null +++ b/models/fixtures/protected_branch.yml @@ -0,0 +1 @@ +[] # empty