1
0
Fork 0
forked from forgejo/forgejo

log slow tests (#11487)

* log slow tests

Signed-off-by: Andrew Thornton <art27@cantab.net>

* placate lint

Signed-off-by: Andrew Thornton <art27@cantab.net>

* More lint placation

Co-authored-by: 6543 <6543@obermui.de>

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
zeripath 2020-06-02 02:39:44 +01:00 committed by GitHub
parent dc812f8ba5
commit 14ca111f33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 75 additions and 1 deletions

View file

@ -22,6 +22,7 @@ import (
"runtime"
"strings"
"testing"
"time"
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/base"
@ -66,6 +67,27 @@ func TestMain(m *testing.M) {
mac = routes.NewMacaron()
routes.RegisterRoutes(mac)
// integration test settings...
if setting.Cfg != nil {
testingCfg := setting.Cfg.Section("integration-tests")
slowTest = testingCfg.Key("SLOW_TEST").MustDuration(slowTest)
slowFlush = testingCfg.Key("SLOW_FLUSH").MustDuration(slowFlush)
}
if os.Getenv("GITEA_SLOW_TEST_TIME") != "" {
duration, err := time.ParseDuration(os.Getenv("GITEA_SLOW_TEST_TIME"))
if err == nil {
slowTest = duration
}
}
if os.Getenv("GITEA_SLOW_FLUSH_TIME") != "" {
duration, err := time.ParseDuration(os.Getenv("GITEA_SLOW_FLUSH_TIME"))
if err == nil {
slowFlush = duration
}
}
var helper testfixtures.Helper
if setting.Database.UseMySQL {
helper = &testfixtures.MySQL{}