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

remove_all_test.go « repository « service « gitaly « internal - gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: fc44f6114e6f97dd81ccf3f4d2448e0457173fe1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package repository

import (
	"testing"

	"github.com/stretchr/testify/require"
	"gitlab.com/gitlab-org/gitaly/v16/internal/git/gittest"
	"gitlab.com/gitlab-org/gitaly/v16/internal/testhelper"
	"gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb"
)

func TestRemoveAll(t *testing.T) {
	t.Parallel()

	cfg, client := setupRepositoryServiceWithoutRepo(t)
	ctx := testhelper.Context(t)

	_, repo1Path := gittest.CreateRepository(t, ctx, cfg)
	_, repo2Path := gittest.CreateRepository(t, ctx, cfg)

	require.DirExists(t, repo1Path)
	require.DirExists(t, repo1Path)

	_, err := client.RemoveAll(ctx, &gitalypb.RemoveAllRequest{
		StorageName: cfg.Storages[0].Name,
	})
	require.NoError(t, err)

	require.NoDirExists(t, repo1Path)
	require.NoDirExists(t, repo2Path)
}