From ad605ee35643d4ee937c955b7182eb051d4cede6 Mon Sep 17 00:00:00 2001 From: Dan McArdle Date: Thu, 11 Apr 2024 11:52:03 -0400 Subject: [PATCH] cmd/gitannex: Drop chdir from e2e tests Now that e2e tests are running in parallel, undoing the chdir to the temp dir was causing flaky failures on cleanup. We don't need it anyway because the worrisome subcommands have their working directory controlled by `runInRepo()`. Issue #7625 --- cmd/gitannex/e2e_test.go | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/cmd/gitannex/e2e_test.go b/cmd/gitannex/e2e_test.go index eda888c6b..a9087ae34 100644 --- a/cmd/gitannex/e2e_test.go +++ b/cmd/gitannex/e2e_test.go @@ -225,13 +225,6 @@ func TestEndToEnd(t *testing.T) { t.Run(string(mode), func(t *testing.T) { t.Parallel() - // Create a temp directory and chdir there, just in case. - originalWd, err := os.Getwd() - require.NoError(t, err) - tempDir := t.TempDir() - require.NoError(t, os.Chdir(tempDir)) - t.Cleanup(func() { require.NoError(t, os.Chdir(originalWd)) }) - testingContext := makeE2eTestingContext(t) testingContext.installRcloneGitannexSymlink(t) testingContext.installRcloneConfig(t) @@ -261,13 +254,6 @@ func TestEndToEndRepoLayoutCompat(t *testing.T) { t.Run(string(mode), func(t *testing.T) { t.Parallel() - // Create a temp directory and chdir there, just in case. - originalWd, err := os.Getwd() - require.NoError(t, err) - tempDir := t.TempDir() - require.NoError(t, os.Chdir(tempDir)) - defer func() { require.NoError(t, os.Chdir(originalWd)) }() - tc := makeE2eTestingContext(t) tc.installRcloneGitannexSymlink(t) tc.installRcloneConfig(t)