1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-04-11 11:42:12 +02:00
This commit is contained in:
Jesse Duffield 2022-08-11 21:21:46 +10:00
parent ae798157d2
commit 1ef6f4c0e1
4 changed files with 8 additions and 8 deletions

@ -1 +1 @@
see pkg/integration/README.md see new docs [here](https://github.com/jesseduffield/lazygit/blob/master/pkg/integration/README.md)

@ -42,7 +42,7 @@ type (
logf func(format string, formatArgs ...interface{}) logf func(format string, formatArgs ...interface{})
) )
func RunTestsNew( func RunTests(
logf logf, logf logf,
runCmd func(cmd *exec.Cmd) error, runCmd func(cmd *exec.Cmd) error,
fnWrapper func(test *helpers.Test, f func() error), fnWrapper func(test *helpers.Test, f func() error),
@ -82,14 +82,14 @@ func RunTestsNew(
findOrCreateDir(testPath) findOrCreateDir(testPath)
prepareIntegrationTestDir(actualDir) prepareIntegrationTestDir(actualDir)
findOrCreateDir(actualRepoDir) findOrCreateDir(actualRepoDir)
err := createFixtureNew(test, actualRepoDir, rootDir) err := createFixture(test, actualRepoDir, rootDir)
if err != nil { if err != nil {
return err return err
} }
configDir := filepath.Join(testPath, "used_config") configDir := filepath.Join(testPath, "used_config")
cmd, err := getLazygitCommandNew(test, testPath, rootDir) cmd, err := getLazygitCommand(test, testPath, rootDir)
if err != nil { if err != nil {
return err return err
} }
@ -229,7 +229,7 @@ func compareSnapshots(logf logf, configDir string, actualDir string, expectedDir
return nil return nil
} }
func createFixtureNew(test *helpers.Test, actualDir string, rootDir string) error { func createFixture(test *helpers.Test, actualDir string, rootDir string) error {
if err := os.Chdir(actualDir); err != nil { if err := os.Chdir(actualDir); err != nil {
panic(err) panic(err)
} }
@ -249,7 +249,7 @@ func createFixtureNew(test *helpers.Test, actualDir string, rootDir string) erro
return nil return nil
} }
func getLazygitCommandNew(test *helpers.Test, testPath string, rootDir string) (*exec.Cmd, error) { func getLazygitCommand(test *helpers.Test, testPath string, rootDir string) (*exec.Cmd, error) {
osCommand := oscommands.NewDummyOSCommand() osCommand := oscommands.NewDummyOSCommand()
templateConfigDir := filepath.Join(rootDir, "test", "default_test_config") templateConfigDir := filepath.Join(rootDir, "test", "default_test_config")

@ -31,7 +31,7 @@ func TestIntegration(t *testing.T) {
parallelIndex := tryConvert(os.Getenv("PARALLEL_INDEX"), 0) parallelIndex := tryConvert(os.Getenv("PARALLEL_INDEX"), 0)
testNumber := 0 testNumber := 0
err := RunTestsNew( err := RunTests(
t.Logf, t.Logf,
runCmdHeadless, runCmdHeadless,
func(test *helpers.Test, f func() error) { func(test *helpers.Test, f func() error) {

@ -39,7 +39,7 @@ func main() {
return test.Name() return test.Name()
}) })
err := integration.RunTestsNew( err := integration.RunTests(
log.Printf, log.Printf,
runCmdInTerminal, runCmdInTerminal,
func(test *helpers.Test, f func() error) { func(test *helpers.Test, f func() error) {