Skip to content
代码片段 群组 项目
提交 7bda30fb 编辑于 作者: Sami Hiltunen's avatar Sami Hiltunen
浏览文件

Send GlRepository to Gitaly in Workhorse tests

Gitaly requires GlRepository to be set in calls that invoke the
hooks. Rails' internal API is disabled in tests so the actual
value doesn't matter though. Fill the value anyway so the
validation passes when sending requests to Gitaly.
上级 7cbb4c78
No related branches found
No related tags found
无相关合并请求
...@@ -174,32 +174,31 @@ func TestAllowedShallowClone(t *testing.T) { ...@@ -174,32 +174,31 @@ func TestAllowedShallowClone(t *testing.T) {
} }
} }
// Disabled because of the broken master func TestAllowedPush(t *testing.T) {
// func TestAllowedPush(t *testing.T) { skipUnlessRealGitaly(t)
// skipUnlessRealGitaly(t)
for _, gitalyAddress := range gitalyAddresses {
// for _, gitalyAddress := range gitalyAddresses { t.Run(gitalyAddress, func(t *testing.T) {
// t.Run(gitalyAddress, func(t *testing.T) { // Create the repository in the Gitaly server
// // Create the repository in the Gitaly server apiResponse := realGitalyOkBody(t, gitalyAddress)
// apiResponse := realGitalyOkBody(t, gitalyAddress) require.NoError(t, ensureGitalyRepository(t, apiResponse))
// require.NoError(t, ensureGitalyRepository(t, apiResponse))
// Prepare the test server and backend
// // Prepare the test server and backend ts := testAuthServer(t, nil, nil, 200, apiResponse)
// ts := testAuthServer(t, nil, nil, 200, apiResponse) ws := startWorkhorseServer(t, ts.URL)
// ws := startWorkhorseServer(t, ts.URL)
// Do the git clone
// // Do the git clone tmpDir := t.TempDir()
// tmpDir := t.TempDir() cloneCmd := exec.Command("git", "clone", fmt.Sprintf("%s/%s", ws.URL, testRepo), tmpDir)
// cloneCmd := exec.Command("git", "clone", fmt.Sprintf("%s/%s", ws.URL, testRepo), tmpDir) runOrFail(t, cloneCmd)
// runOrFail(t, cloneCmd)
// Perform the git push
// // Perform the git push pushCmd := exec.Command("git", "push", fmt.Sprintf("%s/%s", ws.URL, testRepo), fmt.Sprintf("master:%s", newBranch()))
// pushCmd := exec.Command("git", "push", fmt.Sprintf("%s/%s", ws.URL, testRepo), fmt.Sprintf("master:%s", newBranch())) pushCmd.Dir = tmpDir
// pushCmd.Dir = tmpDir runOrFail(t, pushCmd)
// runOrFail(t, pushCmd) })
// }) }
// } }
// }
func TestAllowedGetGitBlob(t *testing.T) { func TestAllowedGetGitBlob(t *testing.T) {
skipUnlessRealGitaly(t) skipUnlessRealGitaly(t)
......
...@@ -795,6 +795,10 @@ func gitOkBody(t *testing.T) *api.Response { ...@@ -795,6 +795,10 @@ func gitOkBody(t *testing.T) *api.Response {
Repository: gitalypb.Repository{ Repository: gitalypb.Repository{
StorageName: "default", StorageName: "default",
RelativePath: "foo/bar.git", RelativePath: "foo/bar.git",
// Gitaly requires a GlRepository to be set in requests that invoke the hooks.
// Set a placeholder to pass the validation. The value doesn't actually matter
// as the calls into Rails' internal API are disabled in tests.
GlRepository: "placeholder-1",
}, },
} }
} }
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册