summaryrefslogtreecommitdiffstats
path: root/models/unit_tests.go
diff options
context:
space:
mode:
authorEthan Koenig <ethantkoenig@gmail.com>2017-11-27 02:29:48 -0800
committerLauris BH <lauris@nix.lv>2017-11-27 12:29:48 +0200
commit1028ef2defd94a64f2433b07fe5d93681864cebb (patch)
treedb3268002ced50e19d2313ae1d429d876528fcde /models/unit_tests.go
parent8b5877265951095bbc3c9ff2727f6679ba6db247 (diff)
downloadgitea-1028ef2defd94a64f2433b07fe5d93681864cebb.tar.gz
gitea-1028ef2defd94a64f2433b07fe5d93681864cebb.zip
Don't print SQL in unit tests (#2995)
* Add GITEA_UNIT_TESTS_VERBOSE environment variable to enable printing SQL
Diffstat (limited to 'models/unit_tests.go')
-rw-r--r--models/unit_tests.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/models/unit_tests.go b/models/unit_tests.go
index f7a06bf0ef..7f8e86fb8f 100644
--- a/models/unit_tests.go
+++ b/models/unit_tests.go
@@ -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)
}