1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-08-07 22:02:56 +03:00

add slow flag to integration tests

This commit is contained in:
Jesse Duffield
2022-08-14 20:47:09 +10:00
parent e875d6b448
commit b2ae651686
7 changed files with 27 additions and 14 deletions

View File

@@ -23,14 +23,19 @@ import (
// If invoked directly, you can specify tests to run by passing their names as positional arguments
func RunCLI(testNames []string) {
func RunCLI(testNames []string, slow bool) {
keyPressDelay := tryConvert(os.Getenv("KEY_PRESS_DELAY"), 0)
if slow {
keyPressDelay = SLOW_KEY_PRESS_DELAY
}
err := components.RunTests(
getTestsToRun(testNames),
log.Printf,
runCmdInTerminal,
runAndPrintError,
getModeFromEnv(),
tryConvert(os.Getenv("KEY_PRESS_DELAY"), 0),
keyPressDelay,
)
if err != nil {
log.Print(err.Error())
@@ -39,7 +44,7 @@ func RunCLI(testNames []string) {
func runAndPrintError(test *components.IntegrationTest, f func() error) {
if err := f(); err != nil {
log.Print(err.Error())
log.Fatalf(err.Error())
}
}