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:
parent
dc812f8ba5
commit
14ca111f33
3 changed files with 75 additions and 1 deletions
|
@ -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{}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue