17755: Merge branch 'main' into 17755-add-singularity-to-compute-image
[arvados.git] / services / arv-git-httpd / integration_test.go
index b50c2a2341185807ac0f9668d0175f4bb5494054..93a46e22482380bc57162c01d18727fbe0250274 100644 (file)
@@ -33,14 +33,6 @@ type IntegrationSuite struct {
        cluster     *arvados.Cluster
 }
 
-func (s *IntegrationSuite) SetUpSuite(c *check.C) {
-       arvadostest.StartAPI()
-}
-
-func (s *IntegrationSuite) TearDownSuite(c *check.C) {
-       arvadostest.StopAPI()
-}
-
 func (s *IntegrationSuite) SetUpTest(c *check.C) {
        arvadostest.ResetEnv()
 
@@ -53,11 +45,14 @@ func (s *IntegrationSuite) SetUpTest(c *check.C) {
        c.Assert(err, check.Equals, nil)
        _, err = exec.Command("git", "init", "--bare", s.tmpRepoRoot+"/zzzzz-s0uqq-382brsig8rp3666.git").Output()
        c.Assert(err, check.Equals, nil)
+       // we need git 2.28 to specify the initial branch with -b; Buster only has 2.20; so we do it in 2 steps
        _, err = exec.Command("git", "init", s.tmpWorkdir).Output()
        c.Assert(err, check.Equals, nil)
+       _, err = exec.Command("sh", "-c", "cd "+s.tmpWorkdir+" && git checkout -b main").Output()
+       c.Assert(err, check.Equals, nil)
        _, err = exec.Command("sh", "-c", "cd "+s.tmpWorkdir+" && echo initial >initial && git add initial && git -c user.name=Initial -c user.email=Initial commit -am 'foo: initial commit'").CombinedOutput()
        c.Assert(err, check.Equals, nil)
-       _, err = exec.Command("sh", "-c", "cd "+s.tmpWorkdir+" && git push "+s.tmpRepoRoot+"/zzzzz-s0uqq-382brsig8rp3666.git master:master").CombinedOutput()
+       _, err = exec.Command("sh", "-c", "cd "+s.tmpWorkdir+" && git push "+s.tmpRepoRoot+"/zzzzz-s0uqq-382brsig8rp3666.git main:main").CombinedOutput()
        c.Assert(err, check.Equals, nil)
        _, err = exec.Command("sh", "-c", "cd "+s.tmpWorkdir+" && echo work >work && git add work && git -c user.name=Foo -c user.email=Foo commit -am 'workdir: test'").CombinedOutput()
        c.Assert(err, check.Equals, nil)
@@ -68,7 +63,7 @@ func (s *IntegrationSuite) SetUpTest(c *check.C) {
                s.cluster, err = cfg.GetCluster("")
                c.Assert(err, check.Equals, nil)
 
-               s.cluster.Services.GitHTTP.InternalURLs = map[arvados.URL]arvados.ServiceInstance{arvados.URL{Host: "localhost:0"}: arvados.ServiceInstance{}}
+               s.cluster.Services.GitHTTP.InternalURLs = map[arvados.URL]arvados.ServiceInstance{{Host: "localhost:0"}: {}}
                s.cluster.TLS.Insecure = true
                s.cluster.Git.GitCommand = "/usr/bin/git"
                s.cluster.Git.Repositories = s.tmpRepoRoot