1
mirror of https://github.com/rclone/rclone synced 2024-11-25 02:47:14 +01:00

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
This commit is contained in:
Dan McArdle 2024-04-11 11:52:03 -04:00 committed by Nick Craig-Wood
parent 4ab235c06c
commit ad605ee356

View File

@ -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)