1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-15 00:15:32 +02:00

allow two attempts on CI

This commit is contained in:
Jesse Duffield
2022-09-16 22:31:46 -07:00
parent 850a82784a
commit 6dca3e1766
4 changed files with 19 additions and 1 deletions

View File

@ -42,6 +42,7 @@ func RunTests(
testWrapper func(test *IntegrationTest, f func() error),
mode Mode,
keyPressDelay int,
maxAttempts int,
) error {
projectRootDir := utils.GetLazygitRootDirectory()
err := os.Chdir(projectRootDir)
@ -63,7 +64,19 @@ func RunTests(
filepath.Join(testDir, test.Name()),
)
return runTest(test, paths, projectRootDir, logf, runCmd, mode, keyPressDelay)
for i := 0; i < maxAttempts; i++ {
err := runTest(test, paths, projectRootDir, logf, runCmd, mode, keyPressDelay)
if err != nil {
if i == maxAttempts-1 {
return err
}
logf("retrying test %s", test.Name())
} else {
break
}
}
return nil
})
}