8567: Adjust job container resolve test now that images are filtered based on
[arvados.git] / services / arv-git-httpd / gitolite_test.go
index 20bdae7ec13a5534ebd4f69248869d4980688fa7..38ff2309c1d2a3a57def17ac588276dab204e265 100644 (file)
@@ -6,6 +6,8 @@ import (
        "os/exec"
        "strings"
 
+       "git.curoverse.com/arvados.git/sdk/go/arvados"
+       "git.curoverse.com/arvados.git/sdk/go/arvadostest"
        check "gopkg.in/check.v1"
 )
 
@@ -41,10 +43,15 @@ func (s *GitoliteSuite) SetUpTest(c *check.C) {
        runGitolite("gitolite", "setup", "--admin", "root")
 
        s.tmpRepoRoot = s.gitoliteHome + "/repositories"
-       s.Config = &config{
-               Addr:       ":0",
-               GitCommand: "/usr/share/gitolite3/gitolite-shell",
-               Root:       s.tmpRepoRoot,
+       s.Config = &Config{
+               Client: arvados.Client{
+                       APIHost:  arvadostest.APIHost(),
+                       Insecure: true,
+               },
+               Listen:       ":0",
+               GitCommand:   "/usr/share/gitolite3/gitolite-shell",
+               GitoliteHome: s.gitoliteHome,
+               RepoRoot:     s.tmpRepoRoot,
        }
        s.IntegrationSuite.SetUpTest(c)
 
@@ -52,9 +59,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) {
@@ -62,6 +66,10 @@ func (s *GitoliteSuite) TearDownTest(c *check.C) {
        // upgrade to Go 1.4.
        os.Setenv("GITOLITE_HTTP_HOME", "")
        os.Setenv("GL_BYPASS_ACCESS_CHECKS", "")
+       if s.gitoliteHome != "" {
+               err := os.RemoveAll(s.gitoliteHome)
+               c.Check(err, check.Equals, nil)
+       }
        s.IntegrationSuite.TearDownTest(c)
 }