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:
authorSami Hiltunen <shiltunen@gitlab.com>2021-09-24 11:03:04 +0300
committerSami Hiltunen <shiltunen@gitlab.com>2021-10-19 13:06:53 +0300
commit1eaea6bf3000bfbf924468e34387a04f699142e1 (patch)
tree17a3ad168cb210b57d32bc8a9f27fd2d4e90cbb7
parentf545c95bd35b98d0c27fff7623e39deeb16eb900 (diff)
Include repository ID with replication jobs in per repo elector tests
PerRepositoryElector's tests do not currently set up a repository id in the replication jobs. This updates the test suite to include a repository id in the replication jobs set up.
-rw-r--r--internal/praefect/nodes/per_repository_test.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/internal/praefect/nodes/per_repository_test.go b/internal/praefect/nodes/per_repository_test.go
index b37071251..3e12e95fe 100644
--- a/internal/praefect/nodes/per_repository_test.go
+++ b/internal/praefect/nodes/per_repository_test.go
@@ -510,7 +510,14 @@ func TestPerRepositoryElector(t *testing.T) {
}
for _, event := range tc.existingJobs {
- _, err := db.ExecContext(ctx,
+ repositoryID, err := rs.GetRepositoryID(ctx, event.Job.VirtualStorage, event.Job.RelativePath)
+ if err != nil {
+ require.Equal(t, commonerr.NewRepositoryNotFoundError(event.Job.VirtualStorage, event.Job.RelativePath), err)
+ }
+
+ event.Job.RepositoryID = repositoryID
+
+ _, err = db.ExecContext(ctx,
"INSERT INTO replication_queue (state, job) VALUES ($1, $2)",
event.State, event.Job,
)