1
1
mirror of https://github.com/go-gitea/gitea synced 2024-12-22 16:44:26 +00:00

Don't print SQL in unit tests (#2995)

* Add GITEA_UNIT_TESTS_VERBOSE environment variable to enable printing SQL
This commit is contained in:
Ethan Koenig 2017-11-27 02:29:48 -08:00 committed by Lauris BH
parent 8b58772659
commit 1028ef2def

View File

@ -32,7 +32,10 @@ func CreateTestEngine(fixturesDir string) error {
if err = x.StoreEngine("InnoDB").Sync2(tables...); err != nil {
return err
}
x.ShowSQL(true)
switch os.Getenv("GITEA_UNIT_TESTS_VERBOSE") {
case "true", "1":
x.ShowSQL(true)
}
return InitFixtures(&testfixtures.SQLite{}, fixturesDir)
}