[ARVADOS] updated: 2.1.0-1022-gbde0fdb92

Git user git at public.arvados.org
Thu Jul 1 21:17:28 UTC 2021


Summary of changes:
 services/api/test/test.git.tar             | Bin 143360 -> 143360 bytes
 services/arv-git-httpd/gitolite_test.go    |   6 +++---
 services/arv-git-httpd/integration_test.go |   5 ++++-
 services/arv-git-httpd/server_test.go      |  20 ++++++++++----------
 4 files changed, 17 insertions(+), 14 deletions(-)

       via  bde0fdb92ba9d667c380617ae7374cd957b4545d (commit)
      from  89f541d2b534b9cad4ee668f702f1270bf056171 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit bde0fdb92ba9d667c380617ae7374cd957b4545d
Author: Ward Vandewege <ward at curii.com>
Date:   Thu Jul 1 17:17:10 2021 -0400

    Fix arv-git-httpd tests.
    
    refs #17817
    
    Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward at curii.com>

diff --git a/services/api/test/test.git.tar b/services/api/test/test.git.tar
index 8f6a48d98..7af80b077 100644
Binary files a/services/api/test/test.git.tar and b/services/api/test/test.git.tar differ
diff --git a/services/arv-git-httpd/gitolite_test.go b/services/arv-git-httpd/gitolite_test.go
index fb0fc0d78..cfedd88f1 100644
--- a/services/arv-git-httpd/gitolite_test.go
+++ b/services/arv-git-httpd/gitolite_test.go
@@ -81,7 +81,7 @@ func (s *GitoliteSuite) TearDownTest(c *check.C) {
 }
 
 func (s *GitoliteSuite) TestFetch(c *check.C) {
-	err := s.RunGit(c, activeToken, "fetch", "active/foo.git")
+	err := s.RunGit(c, activeToken, "fetch", "active/foo.git", "refs/heads/main")
 	c.Check(err, check.Equals, nil)
 }
 
@@ -91,7 +91,7 @@ func (s *GitoliteSuite) TestFetchUnreadable(c *check.C) {
 }
 
 func (s *GitoliteSuite) TestPush(c *check.C) {
-	err := s.RunGit(c, activeToken, "push", "active/foo.git", "master:gitolite-push")
+	err := s.RunGit(c, activeToken, "push", "active/foo.git", "main:gitolite-push")
 	c.Check(err, check.Equals, nil)
 
 	// Check that the commit hash appears in the gitolite log, as
@@ -109,6 +109,6 @@ 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")
+	err := s.RunGit(c, spectatorToken, "push", "active/foo.git", "main:gitolite-push-fail")
 	c.Check(err, check.ErrorMatches, `.*HTTP (code = )?403.*`)
 }
diff --git a/services/arv-git-httpd/integration_test.go b/services/arv-git-httpd/integration_test.go
index 12ddc5b77..7da85ee74 100644
--- a/services/arv-git-httpd/integration_test.go
+++ b/services/arv-git-httpd/integration_test.go
@@ -53,11 +53,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)
diff --git a/services/arv-git-httpd/server_test.go b/services/arv-git-httpd/server_test.go
index 386205d37..a92aa1fb8 100644
--- a/services/arv-git-httpd/server_test.go
+++ b/services/arv-git-httpd/server_test.go
@@ -31,13 +31,13 @@ type GitSuite struct {
 func (s *GitSuite) TestPathVariants(c *check.C) {
 	s.makeArvadosRepo(c)
 	for _, repo := range []string{"active/foo.git", "active/foo/.git", "arvados.git", "arvados/.git"} {
-		err := s.RunGit(c, spectatorToken, "fetch", repo)
+		err := s.RunGit(c, spectatorToken, "fetch", repo, "refs/heads/main")
 		c.Assert(err, check.Equals, nil)
 	}
 }
 
 func (s *GitSuite) TestReadonly(c *check.C) {
-	err := s.RunGit(c, spectatorToken, "fetch", "active/foo.git")
+	err := s.RunGit(c, spectatorToken, "fetch", "active/foo.git", "refs/heads/main")
 	c.Assert(err, check.Equals, nil)
 	err = s.RunGit(c, spectatorToken, "push", "active/foo.git", "main:newbranchfail")
 	c.Assert(err, check.ErrorMatches, `.*HTTP (code = )?403.*`)
@@ -46,7 +46,7 @@ func (s *GitSuite) TestReadonly(c *check.C) {
 }
 
 func (s *GitSuite) TestReadwrite(c *check.C) {
-	err := s.RunGit(c, activeToken, "fetch", "active/foo.git")
+	err := s.RunGit(c, activeToken, "fetch", "active/foo.git", "refs/heads/main")
 	c.Assert(err, check.Equals, nil)
 	err = s.RunGit(c, activeToken, "push", "active/foo.git", "main:newbranch")
 	c.Assert(err, check.Equals, nil)
@@ -55,46 +55,46 @@ func (s *GitSuite) TestReadwrite(c *check.C) {
 }
 
 func (s *GitSuite) TestNonexistent(c *check.C) {
-	err := s.RunGit(c, spectatorToken, "fetch", "thisrepodoesnotexist.git")
+	err := s.RunGit(c, spectatorToken, "fetch", "thisrepodoesnotexist.git", "refs/heads/main")
 	c.Assert(err, check.ErrorMatches, `.* not found.*`)
 }
 
 func (s *GitSuite) TestMissingGitdirReadableRepository(c *check.C) {
-	err := s.RunGit(c, activeToken, "fetch", "active/foo2.git")
+	err := s.RunGit(c, activeToken, "fetch", "active/foo2.git", "refs/heads/main")
 	c.Assert(err, check.ErrorMatches, `.* not found.*`)
 }
 
 func (s *GitSuite) TestNoPermission(c *check.C) {
 	for _, repo := range []string{"active/foo.git", "active/foo/.git"} {
-		err := s.RunGit(c, anonymousToken, "fetch", repo)
+		err := s.RunGit(c, anonymousToken, "fetch", repo, "refs/heads/main")
 		c.Assert(err, check.ErrorMatches, `.* not found.*`)
 	}
 }
 
 func (s *GitSuite) TestExpiredToken(c *check.C) {
 	for _, repo := range []string{"active/foo.git", "active/foo/.git"} {
-		err := s.RunGit(c, expiredToken, "fetch", repo)
+		err := s.RunGit(c, expiredToken, "fetch", repo, "refs/heads/main")
 		c.Assert(err, check.ErrorMatches, `.* (500 while accessing|requested URL returned error: 500).*`)
 	}
 }
 
 func (s *GitSuite) TestInvalidToken(c *check.C) {
 	for _, repo := range []string{"active/foo.git", "active/foo/.git"} {
-		err := s.RunGit(c, "s3cr3tp at ssw0rd", "fetch", repo)
+		err := s.RunGit(c, "s3cr3tp at ssw0rd", "fetch", repo, "refs/heads/main")
 		c.Assert(err, check.ErrorMatches, `.* requested URL returned error.*`)
 	}
 }
 
 func (s *GitSuite) TestShortToken(c *check.C) {
 	for _, repo := range []string{"active/foo.git", "active/foo/.git"} {
-		err := s.RunGit(c, "s3cr3t", "fetch", repo)
+		err := s.RunGit(c, "s3cr3t", "fetch", repo, "refs/heads/main")
 		c.Assert(err, check.ErrorMatches, `.* (500 while accessing|requested URL returned error: 500).*`)
 	}
 }
 
 func (s *GitSuite) TestShortTokenBadReq(c *check.C) {
 	for _, repo := range []string{"bogus"} {
-		err := s.RunGit(c, "s3cr3t", "fetch", repo)
+		err := s.RunGit(c, "s3cr3t", "fetch", repo, "refs/heads/main")
 		c.Assert(err, check.ErrorMatches, `.*not found.*`)
 	}
 }

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list