diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-09-25 20:13:18 +0800 |
---|---|---|
committer | Antoine GIRARD <sapk@users.noreply.github.com> | 2019-09-25 14:13:18 +0200 |
commit | a8c024043ca7a762c29e3ed97b791df541b219d9 (patch) | |
tree | cae62a5a902695acf9cd82b5981c381850872c20 /integrations/integration_test.go | |
parent | c05b89a5aaea7c3a7db9b602693556cde725a30f (diff) | |
download | gitea-a8c024043ca7a762c29e3ed97b791df541b219d9.tar.gz gitea-a8c024043ca7a762c29e3ed97b791df541b219d9.zip |
Improve integration tests (#8276)
* improve integration tests
* fix Makefile
* improve makefile and integration docs
Diffstat (limited to 'integrations/integration_test.go')
-rw-r--r-- | integrations/integration_test.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/integrations/integration_test.go b/integrations/integration_test.go index e4d506ee7d..897315f2ae 100644 --- a/integrations/integration_test.go +++ b/integrations/integration_test.go @@ -131,7 +131,7 @@ func initIntegrationTest() { if err != nil { log.Fatalf("sql.Open: %v", err) } - if _, err = db.Exec("CREATE DATABASE IF NOT EXISTS testgitea"); err != nil { + if _, err = db.Exec(fmt.Sprintf("CREATE DATABASE IF NOT EXISTS %s", setting.Database.Name)); err != nil { log.Fatalf("db.Exec: %v", err) } case setting.Database.UsePostgreSQL: @@ -150,7 +150,7 @@ func initIntegrationTest() { if rows.Next() { break } - if _, err = db.Exec("CREATE DATABASE testgitea"); err != nil { + if _, err = db.Exec(fmt.Sprintf("CREATE DATABASE %s", setting.Database.Name)); err != nil { log.Fatalf("db.Exec: %v", err) } case setting.Database.UseMSSQL: @@ -160,7 +160,7 @@ func initIntegrationTest() { if err != nil { log.Fatalf("sql.Open: %v", err) } - if _, err := db.Exec("If(db_id(N'gitea') IS NULL) BEGIN CREATE DATABASE gitea; END;"); err != nil { + if _, err := db.Exec(fmt.Sprintf("If(db_id(N'%s') IS NULL) BEGIN CREATE DATABASE %s; END;", setting.Database.Name, setting.Database.Name)); err != nil { log.Fatalf("db.Exec: %v", err) } defer db.Close() |