13146: Add "include" parameter and rename return field to "included"
[arvados.git] / services / arv-git-httpd / gitolite_test.go
index 96d9d24562195b99ef0be7dd9ff0fef6a115c0f6..0656cbf89ad34661d08bb467c96b2be152a7908f 100644 (file)
@@ -1,3 +1,7 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
 package main
 
 import (
@@ -7,6 +11,7 @@ import (
        "strings"
 
        "git.curoverse.com/arvados.git/sdk/go/arvados"
+       "git.curoverse.com/arvados.git/sdk/go/arvadostest"
        check "gopkg.in/check.v1"
 )
 
@@ -44,11 +49,13 @@ func (s *GitoliteSuite) SetUpTest(c *check.C) {
        s.tmpRepoRoot = s.gitoliteHome + "/repositories"
        s.Config = &Config{
                Client: arvados.Client{
-                       APIHost: os.Getenv("ARVADOS_API_HOST"),
+                       APIHost:  arvadostest.APIHost(),
+                       Insecure: true,
                },
-               Listen:     ":0",
-               GitCommand: "/usr/share/gitolite3/gitolite-shell",
-               Root:       s.tmpRepoRoot,
+               Listen:       ":0",
+               GitCommand:   "/usr/share/gitolite3/gitolite-shell",
+               GitoliteHome: s.gitoliteHome,
+               RepoRoot:     s.tmpRepoRoot,
        }
        s.IntegrationSuite.SetUpTest(c)
 
@@ -56,9 +63,6 @@ func (s *GitoliteSuite) SetUpTest(c *check.C) {
        // (*IntegrationTest)SetUpTest() -- see 2.2.4 at
        // http://gitolite.com/gitolite/gitolite.html
        runGitolite("gitolite", "setup")
-
-       os.Setenv("GITOLITE_HTTP_HOME", s.gitoliteHome)
-       os.Setenv("GL_BYPASS_ACCESS_CHECKS", "1")
 }
 
 func (s *GitoliteSuite) TearDownTest(c *check.C) {
@@ -103,5 +107,5 @@ func (s *GitoliteSuite) TestPush(c *check.C) {
 
 func (s *GitoliteSuite) TestPushUnwritable(c *check.C) {
        err := s.RunGit(c, spectatorToken, "push", "active/foo.git", "master:gitolite-push-fail")
-       c.Check(err, check.ErrorMatches, `.*HTTP code = 403.*`)
+       c.Check(err, check.ErrorMatches, `.*HTTP (code = )?403.*`)
 }