Commit 82fc506e authored by Quang-Minh Nguyen's avatar Quang-Minh Nguyen

Upgrade gitaly image for workhorse integration test

parent 4428eb2a
...@@ -10,7 +10,7 @@ workhorse:verify: ...@@ -10,7 +10,7 @@ workhorse:verify:
.workhorse:test: .workhorse:test:
extends: .workhorse:rules:workhorse extends: .workhorse:rules:workhorse
services: services:
- name: registry.gitlab.com/gitlab-org/build/cng/gitaly:latest - name: registry.gitlab.com/gitlab-org/build/cng/gitaly:master-ubi8
# Disable the hooks so we don't have to stub the GitLab API # Disable the hooks so we don't have to stub the GitLab API
command: ["/usr/bin/env", "GITALY_TESTING_NO_GIT_HOOKS=1", "/scripts/process-wrapper"] command: ["/usr/bin/env", "GITALY_TESTING_NO_GIT_HOOKS=1", "/scripts/process-wrapper"]
alias: gitaly alias: gitaly
......
...@@ -16,6 +16,7 @@ import ( ...@@ -16,6 +16,7 @@ import (
"strings" "strings"
"testing" "testing"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly/v14/proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/v14/proto/go/gitalypb"
...@@ -53,6 +54,10 @@ func realGitalyOkBody(t *testing.T) *api.Response { ...@@ -53,6 +54,10 @@ func realGitalyOkBody(t *testing.T) *api.Response {
return realGitalyAuthResponse(gitOkBody(t)) return realGitalyAuthResponse(gitOkBody(t))
} }
func realGitalyOkBodyWithSidechannel(t *testing.T) *api.Response {
return realGitalyAuthResponse(gitOkBodyWithSidechannel(t))
}
func ensureGitalyRepository(t *testing.T, apiResponse *api.Response) error { func ensureGitalyRepository(t *testing.T, apiResponse *api.Response) error {
ctx, namespace, err := gitaly.NewNamespaceClient(context.Background(), apiResponse.GitalyServer) ctx, namespace, err := gitaly.NewNamespaceClient(context.Background(), apiResponse.GitalyServer)
if err != nil { if err != nil {
...@@ -83,10 +88,18 @@ func ensureGitalyRepository(t *testing.T, apiResponse *api.Response) error { ...@@ -83,10 +88,18 @@ func ensureGitalyRepository(t *testing.T, apiResponse *api.Response) error {
} }
func TestAllowedClone(t *testing.T) { func TestAllowedClone(t *testing.T) {
testAllowedClone(t, realGitalyOkBody(t))
}
func TestAllowedCloneWithSidechannel(t *testing.T) {
gitaly.InitializeSidechannelRegistry(logrus.StandardLogger())
testAllowedClone(t, realGitalyOkBodyWithSidechannel(t))
}
func testAllowedClone(t *testing.T, apiResponse *api.Response) {
skipUnlessRealGitaly(t) skipUnlessRealGitaly(t)
// Create the repository in the Gitaly server // Create the repository in the Gitaly server
apiResponse := realGitalyOkBody(t)
require.NoError(t, ensureGitalyRepository(t, apiResponse)) require.NoError(t, ensureGitalyRepository(t, apiResponse))
// Prepare test server and backend // Prepare test server and backend
...@@ -107,10 +120,18 @@ func TestAllowedClone(t *testing.T) { ...@@ -107,10 +120,18 @@ func TestAllowedClone(t *testing.T) {
} }
func TestAllowedShallowClone(t *testing.T) { func TestAllowedShallowClone(t *testing.T) {
testAllowedShallowClone(t, realGitalyOkBody(t))
}
func TestAllowedShallowCloneWithSidechannel(t *testing.T) {
gitaly.InitializeSidechannelRegistry(logrus.StandardLogger())
testAllowedShallowClone(t, realGitalyOkBodyWithSidechannel(t))
}
func testAllowedShallowClone(t *testing.T, apiResponse *api.Response) {
skipUnlessRealGitaly(t) skipUnlessRealGitaly(t)
// Create the repository in the Gitaly server // Create the repository in the Gitaly server
apiResponse := realGitalyOkBody(t)
require.NoError(t, ensureGitalyRepository(t, apiResponse)) require.NoError(t, ensureGitalyRepository(t, apiResponse))
// Prepare test server and backend // Prepare test server and backend
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment