mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-26 12:27:06 +00:00 
			
		
		
		
	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:
		| @@ -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{} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 zeripath
					zeripath