[ARVADOS] updated: 1.3.0-1537-gd8b7f966e

Git user git at public.curoverse.com
Mon Aug 26 15:54:53 UTC 2019


Summary of changes:
 services/arv-git-httpd/auth_handler_test.go | 18 ++++++++------
 services/arv-git-httpd/git_handler_test.go  |  5 ++--
 services/arv-git-httpd/integration_test.go  | 38 +++++++++++++----------------
 3 files changed, 30 insertions(+), 31 deletions(-)

       via  d8b7f966e1e20b34168136ab87c2604cbf409d25 (commit)
      from  48d98c75b63e1543aacc44ddf93caf87493dd9cc (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 d8b7f966e1e20b34168136ab87c2604cbf409d25
Author: Eric Biagiotti <ebiagiotti at veritasgenetics.com>
Date:   Mon Aug 26 11:54:43 2019 -0400

    14712: Tests use cluster config
    
    Arvados-DCO-1.1-Signed-off-by: Eric Biagiotti <ebiagiotti at veritasgenetics.com>

diff --git a/services/arv-git-httpd/auth_handler_test.go b/services/arv-git-httpd/auth_handler_test.go
index a8fb3acd4..568570942 100644
--- a/services/arv-git-httpd/auth_handler_test.go
+++ b/services/arv-git-httpd/auth_handler_test.go
@@ -21,7 +21,9 @@ import (
 
 var _ = check.Suite(&AuthHandlerSuite{})
 
-type AuthHandlerSuite struct{}
+type AuthHandlerSuite struct {
+	cluster *arvados.Cluster
+}
 
 func (s *AuthHandlerSuite) SetUpSuite(c *check.C) {
 	arvadostest.StartAPI()
@@ -38,20 +40,20 @@ func (s *AuthHandlerSuite) SetUpTest(c *check.C) {
 
 	cfg, err := config.NewLoader(nil, nil).Load()
 	c.Assert(err, check.Equals, nil)
-	cluster, err := cfg.GetCluster("")
+	s.cluster, err = cfg.GetCluster("")
 	c.Assert(err, check.Equals, nil)
 
-	cluster.Services.GitHTTP.InternalURLs = map[arvados.URL]arvados.ServiceInstance{arvados.URL{Host: "localhost:0"}: arvados.ServiceInstance{}}
-	cluster.TLS.Insecure = true
-	cluster.Git.GitCommand = "/usr/bin/git"
-	cluster.Git.Repositories = repoRoot
+	s.cluster.Services.GitHTTP.InternalURLs = map[arvados.URL]arvados.ServiceInstance{arvados.URL{Host: "localhost:0"}: arvados.ServiceInstance{}}
+	s.cluster.TLS.Insecure = true
+	s.cluster.Git.GitCommand = "/usr/bin/git"
+	s.cluster.Git.Repositories = repoRoot
 }
 
 func (s *AuthHandlerSuite) TestPermission(c *check.C) {
 	h := &authHandler{handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 		log.Printf("%v", r.URL)
 		io.WriteString(w, r.URL.Path)
-	})}
+	}), cluster: s.cluster}
 	baseURL, err := url.Parse("http://git.example/")
 	c.Assert(err, check.IsNil)
 	for _, trial := range []struct {
@@ -134,7 +136,7 @@ func (s *AuthHandlerSuite) TestPermission(c *check.C) {
 }
 
 func (s *AuthHandlerSuite) TestCORS(c *check.C) {
-	h := &authHandler{}
+	h := &authHandler{cluster: s.cluster}
 
 	// CORS preflight
 	resp := httptest.NewRecorder()
diff --git a/services/arv-git-httpd/git_handler_test.go b/services/arv-git-httpd/git_handler_test.go
index 8417b57e4..d5cb275fd 100644
--- a/services/arv-git-httpd/git_handler_test.go
+++ b/services/arv-git-httpd/git_handler_test.go
@@ -21,8 +21,7 @@ type GitHandlerSuite struct {
 	cluster *arvados.Cluster
 }
 
-func (s *GitHandlerSuite) TestEnvVars(c *check.C) {
-
+func (s *GitHandlerSuite) SetUpTest(c *check.C) {
 	cfg, err := config.NewLoader(nil, nil).Load()
 	c.Assert(err, check.Equals, nil)
 	s.cluster, err = cfg.GetCluster("")
@@ -31,7 +30,9 @@ func (s *GitHandlerSuite) TestEnvVars(c *check.C) {
 	s.cluster.Services.GitHTTP.InternalURLs = map[arvados.URL]arvados.ServiceInstance{arvados.URL{Host: "localhost:80"}: arvados.ServiceInstance{}}
 	s.cluster.Git.GitoliteHome = "/test/ghh"
 	s.cluster.Git.Repositories = "/"
+}
 
+func (s *GitHandlerSuite) TestEnvVars(c *check.C) {
 	u, err := url.Parse("git.zzzzz.arvadosapi.com/test")
 	c.Check(err, check.Equals, nil)
 	resp := httptest.NewRecorder()
diff --git a/services/arv-git-httpd/integration_test.go b/services/arv-git-httpd/integration_test.go
index a6f114140..46bf8329c 100644
--- a/services/arv-git-httpd/integration_test.go
+++ b/services/arv-git-httpd/integration_test.go
@@ -61,6 +61,23 @@ func (s *IntegrationSuite) SetUpTest(c *check.C) {
 	_, 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)
 
+	if s.cluster == nil {
+		cfg, err := config.NewLoader(nil, nil).Load()
+		c.Assert(err, check.Equals, nil)
+		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.TLS.Insecure = true
+		s.cluster.Git.GitCommand = "/usr/bin/git"
+		s.cluster.Git.Repositories = s.tmpRepoRoot
+		s.cluster.ManagementToken = arvadostest.ManagementToken
+	}
+
+	s.testServer = &server{cluster: s.cluster}
+	err = s.testServer.Start()
+	c.Assert(err, check.Equals, nil)
+
 	_, err = exec.Command("git", "config",
 		"--file", s.tmpWorkdir+"/.git/config",
 		"credential.http://"+s.testServer.Addr+"/.helper",
@@ -78,27 +95,6 @@ func (s *IntegrationSuite) SetUpTest(c *check.C) {
 	os.Unsetenv("ARVADOS_API_HOST")
 	os.Unsetenv("ARVADOS_API_HOST_INSECURE")
 	os.Unsetenv("ARVADOS_API_TOKEN")
-
-	cfg, err := config.NewLoader(nil, nil).Load()
-	c.Assert(err, check.Equals, nil)
-	s.cluster, err = cfg.GetCluster("")
-	c.Assert(err, check.Equals, nil)
-
-	if s.cluster == nil {
-		s.cluster.Services.GitHTTP.InternalURLs = map[arvados.URL]arvados.ServiceInstance{arvados.URL{Host: "localhost:0"}: arvados.ServiceInstance{}}
-		s.cluster.TLS.Insecure = true
-		s.cluster.Git.GitCommand = "/usr/bin/git"
-		s.cluster.Git.Repositories = s.tmpRepoRoot
-	}
-
-	println(s.cluster.Services.Controller.InternalURLs)
-	println(arvadostest.APIHost())
-	println(s.cluster.ManagementToken)
-	println(arvadostest.ManagementToken)
-
-	s.testServer = &server{cluster: s.cluster}
-	err = s.testServer.Start()
-	c.Assert(err, check.Equals, nil)
 }
 
 func (s *IntegrationSuite) TearDownTest(c *check.C) {

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list