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

* Add GITEA_UNIT_TESTS_VERBOSE environment variable to enable printing SQL
tokarchuk/v1.17
Ethan Koenig 7 years ago committed by Lauris BH
parent 8b58772659
commit 1028ef2def
  1. 3
      models/unit_tests.go

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

Loading…
Cancel
Save