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:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2023-08-21 09:09:19 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2023-08-21 09:55:49 +0300
commite9c6f2e7902e161541aa54724d55624d8e6193d2 (patch)
tree8b2e6ba60eb0db546b2451b25eda86db9af0fe41
parent4af2feb4a2c6ec11c49cd95e73fb000b9f903554 (diff)
operations: Enable testing UserRebaseToRef with SHA256
We have ported UserRebaseToRef to use plain Git commands in favor of Git2go, which makes the RPC compatible with the SHA256 object format. Enable testing with it.
-rw-r--r--internal/gitaly/service/operations/rebase_to_ref_test.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/internal/gitaly/service/operations/rebase_to_ref_test.go b/internal/gitaly/service/operations/rebase_to_ref_test.go
index 7f464d0c6..5f703f338 100644
--- a/internal/gitaly/service/operations/rebase_to_ref_test.go
+++ b/internal/gitaly/service/operations/rebase_to_ref_test.go
@@ -1,5 +1,3 @@
-//go:build !gitaly_test_sha256
-
package operations
import (
@@ -29,6 +27,8 @@ func TestUserRebaseToRef_successful(t *testing.T) {
}
func testUserRebaseToRefSuccessful(t *testing.T, ctx context.Context) {
+ skipSHA256WithUserRebaseToRefGit2go(t, ctx)
+
t.Parallel()
ctx, cfg, client := setupOperationsServiceWithoutRepo(t, ctx)
@@ -93,6 +93,8 @@ func TestUserRebaseToRef_failure(t *testing.T) {
}
func testUserRebaseToRefFailure(t *testing.T, ctx context.Context) {
+ skipSHA256WithUserRebaseToRefGit2go(t, ctx)
+
t.Parallel()
ctx, cfg, client := setupOperationsServiceWithoutRepo(t, ctx)
@@ -219,6 +221,8 @@ func TestUserRebaseToRef_conflict(t *testing.T) {
}
func testUserRebaseToRefConflict(t *testing.T, ctx context.Context) {
+ skipSHA256WithUserRebaseToRefGit2go(t, ctx)
+
t.Parallel()
ctx, cfg, client := setupOperationsServiceWithoutRepo(t, ctx)
@@ -261,3 +265,9 @@ func testUserRebaseToRefConflict(t *testing.T, ctx context.Context) {
currentTargetRefOID := gittest.ResolveRevision(t, cfg, repoPath, targetRef)
require.Equal(t, targetRefOID, currentTargetRefOID, "target ref should not change when the rebase fails due to GitError")
}
+
+func skipSHA256WithUserRebaseToRefGit2go(t *testing.T, ctx context.Context) {
+ if gittest.DefaultObjectHash.Format == git.ObjectHashSHA256.Format && featureflag.UserRebaseToRefPureGit.IsDisabled(ctx) {
+ t.Skip("SHA256 repositories are only supported when using the pure Git implementation")
+ }
+}