From 1028ef2defd94a64f2433b07fe5d93681864cebb Mon Sep 17 00:00:00 2001 From: Ethan Koenig Date: Mon, 27 Nov 2017 02:29:48 -0800 Subject: [PATCH] Don't print SQL in unit tests (#2995) * Add GITEA_UNIT_TESTS_VERBOSE environment variable to enable printing SQL --- models/unit_tests.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/models/unit_tests.go b/models/unit_tests.go index f7a06bf0e..7f8e86fb8 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) }