mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-11-29 22:48:24 +02:00
Use args struct for RunTests
There were too many position arguments
This commit is contained in:
@@ -29,17 +29,17 @@ func RunCLI(testNames []string, slow bool, sandbox bool, waitForDebugger bool, r
|
||||
inputDelay = SLOW_INPUT_DELAY
|
||||
}
|
||||
|
||||
err := components.RunTests(
|
||||
getTestsToRun(testNames),
|
||||
log.Printf,
|
||||
runCmdInTerminal,
|
||||
runAndPrintFatalError,
|
||||
sandbox,
|
||||
waitForDebugger,
|
||||
raceDetector,
|
||||
inputDelay,
|
||||
1,
|
||||
)
|
||||
err := components.RunTests(components.RunTestArgs{
|
||||
Tests: getTestsToRun(testNames),
|
||||
Logf: log.Printf,
|
||||
RunCmd: runCmdInTerminal,
|
||||
TestWrapper: runAndPrintFatalError,
|
||||
Sandbox: sandbox,
|
||||
WaitForDebugger: waitForDebugger,
|
||||
RaceDetector: raceDetector,
|
||||
InputDelay: inputDelay,
|
||||
MaxAttempts: 1,
|
||||
})
|
||||
if err != nil {
|
||||
log.Print(err.Error())
|
||||
}
|
||||
|
||||
@@ -30,11 +30,11 @@ func TestIntegration(t *testing.T) {
|
||||
raceDetector := os.Getenv("LAZYGIT_RACE_DETECTOR") != ""
|
||||
testNumber := 0
|
||||
|
||||
err := components.RunTests(
|
||||
tests.GetTests(),
|
||||
t.Logf,
|
||||
runCmdHeadless,
|
||||
func(test *components.IntegrationTest, f func() error) {
|
||||
err := components.RunTests(components.RunTestArgs{
|
||||
Tests: tests.GetTests(),
|
||||
Logf: t.Logf,
|
||||
RunCmd: runCmdHeadless,
|
||||
TestWrapper: func(test *components.IntegrationTest, f func() error) {
|
||||
defer func() { testNumber += 1 }()
|
||||
if testNumber%parallelTotal != parallelIndex {
|
||||
return
|
||||
@@ -52,13 +52,13 @@ func TestIntegration(t *testing.T) {
|
||||
assert.NoError(t, err)
|
||||
})
|
||||
},
|
||||
false,
|
||||
false,
|
||||
raceDetector,
|
||||
0,
|
||||
Sandbox: false,
|
||||
WaitForDebugger: false,
|
||||
RaceDetector: raceDetector,
|
||||
InputDelay: 0,
|
||||
// Allow two attempts at each test to get around flakiness
|
||||
2,
|
||||
)
|
||||
MaxAttempts: 2,
|
||||
})
|
||||
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
@@ -385,17 +385,17 @@ func quit(g *gocui.Gui, v *gocui.View) error {
|
||||
}
|
||||
|
||||
func runTuiTest(test *components.IntegrationTest, sandbox bool, waitForDebugger bool, raceDetector bool, inputDelay int) {
|
||||
err := components.RunTests(
|
||||
[]*components.IntegrationTest{test},
|
||||
log.Printf,
|
||||
runCmdInTerminal,
|
||||
runAndPrintError,
|
||||
sandbox,
|
||||
waitForDebugger,
|
||||
raceDetector,
|
||||
inputDelay,
|
||||
1,
|
||||
)
|
||||
err := components.RunTests(components.RunTestArgs{
|
||||
Tests: []*components.IntegrationTest{test},
|
||||
Logf: log.Printf,
|
||||
RunCmd: runCmdInTerminal,
|
||||
TestWrapper: runAndPrintError,
|
||||
Sandbox: sandbox,
|
||||
WaitForDebugger: waitForDebugger,
|
||||
RaceDetector: raceDetector,
|
||||
InputDelay: inputDelay,
|
||||
MaxAttempts: 1,
|
||||
})
|
||||
if err != nil {
|
||||
log.Println(err.Error())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user