mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-23 01:24:00 +01:00
Don't recreate database in integration tests (#1697)
This commit is contained in:
parent
ddb63a7897
commit
251fb935ff
2 changed files with 2 additions and 6 deletions
|
@ -79,9 +79,6 @@ func initIntegrationTest() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("sql.Open: %v", err)
|
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 {
|
if _, err = db.Exec("CREATE DATABASE IF NOT EXISTS testgitea"); err != nil {
|
||||||
log.Fatalf("db.Exec: %v", err)
|
log.Fatalf("db.Exec: %v", err)
|
||||||
}
|
}
|
||||||
|
@ -100,9 +97,7 @@ func initIntegrationTest() {
|
||||||
defer rows.Close()
|
defer rows.Close()
|
||||||
|
|
||||||
if rows.Next() {
|
if rows.Next() {
|
||||||
if _, err = db.Exec("DROP DATABASE testgitea"); err != nil {
|
break
|
||||||
log.Fatalf("db.drop db: %v", err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if _, err = db.Exec("CREATE DATABASE testgitea"); err != nil {
|
if _, err = db.Exec("CREATE DATABASE testgitea"); err != nil {
|
||||||
log.Fatalf("db.Exec: %v", err)
|
log.Fatalf("db.Exec: %v", err)
|
||||||
|
|
1
models/fixtures/protected_branch.yml
Normal file
1
models/fixtures/protected_branch.yml
Normal file
|
@ -0,0 +1 @@
|
||||||
|
[] # empty
|
Loading…
Reference in a new issue