Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Fargher <jfargher@gitlab.com>2021-09-21 02:26:42 +0300
committerJames Fargher <jfargher@gitlab.com>2021-09-22 02:34:59 +0300
commit08d5c87e82077384d294c9c9d9dbfb8438aeb115 (patch)
treecb2fae335a3019be8223e7bbe5b6780691296dbb
parentf2cce7919360bf87366841344b1c4778083c0bcc (diff)
Use `require.NoDirExists` to test directories in cleanup RPC
`require.NoFileExists` specifically checks for files. It does not consider directories files, so these tests were not working as expected.
-rw-r--r--internal/gitaly/service/repository/cleanup_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/gitaly/service/repository/cleanup_test.go b/internal/gitaly/service/repository/cleanup_test.go
index feb3de6c4..3e8b2ce0b 100644
--- a/internal/gitaly/service/repository/cleanup_test.go
+++ b/internal/gitaly/service/repository/cleanup_test.go
@@ -74,8 +74,8 @@ func TestCleanupDeletesStaleWorktrees(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, c)
- require.NoFileExists(t, worktreeCheckoutPath)
- require.NoFileExists(t, worktreePath)
+ require.NoDirExists(t, worktreeCheckoutPath)
+ require.NoDirExists(t, worktreePath)
}
})
}
@@ -141,7 +141,7 @@ func TestCleanupDisconnectedWorktrees(t *testing.T) {
// cleanup should prune the disconnected worktree administrative files
_, err = client.Cleanup(ctx, req)
require.NoError(t, err)
- require.NoFileExists(t, worktreeAdminPath)
+ require.NoDirExists(t, worktreeAdminPath)
// if the worktree administrative files are pruned, then we should be able
// to checkout another worktree at the same path