forked from forgejo/forgejo
Improve integration tests (#8276)
* improve integration tests * fix Makefile * improve makefile and integration docs
This commit is contained in:
parent
c05b89a5aa
commit
a8c024043c
8 changed files with 143 additions and 68 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue