[ARVADOS] updated: 2.1.0-245-gc271137b5

Git user git at public.arvados.org
Fri Jan 8 22:01:22 UTC 2021


Summary of changes:
 .../test_cluster.go => lib/boot/helpers.go          | 21 +++++----------------
 lib/controller/integration_test.go                  | 18 +++++++++++++-----
 tools/sync-groups/federation_test.go                | 19 ++++++++++++++-----
 3 files changed, 32 insertions(+), 26 deletions(-)
 rename sdk/go/arvadostest/test_cluster.go => lib/boot/helpers.go (89%)

       via  c271137b5f704f3df510b0b0dd8eceba25e006a8 (commit)
       via  7ab4905be555e3e5f65c3020ccafe3cc88f9e839 (commit)
      from  59e8b47bee1c9699cbb2d16369481bd688da6e3d (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 c271137b5f704f3df510b0b0dd8eceba25e006a8
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Fri Jan 8 18:59:51 2021 -0300

    16981: Removes the import cycle issue by moving code to lib/boot.
    
    As the code was really meant to be lib/boot helpers, instead of having
    it on the arvadostest package, it's now on lib/boot/helper.go
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>

diff --git a/sdk/go/arvadostest/test_cluster.go b/lib/boot/helpers.go
similarity index 97%
rename from sdk/go/arvadostest/test_cluster.go
rename to lib/boot/helpers.go
index 57dca3d83..731fc56c8 100644
--- a/sdk/go/arvadostest/test_cluster.go
+++ b/lib/boot/helpers.go
@@ -2,13 +2,12 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-package arvadostest
+package boot
 
 import (
 	"context"
 	"net/url"
 
-	"git.arvados.org/arvados.git/lib/boot"
 	"git.arvados.org/arvados.git/lib/controller/rpc"
 	"git.arvados.org/arvados.git/lib/service"
 	"git.arvados.org/arvados.git/sdk/go/arvados"
@@ -21,7 +20,7 @@ import (
 
 // TestCluster stores a working test cluster data
 type TestCluster struct {
-	Super         boot.Supervisor
+	Super         Supervisor
 	Config        arvados.Config
 	ControllerURL *url.URL
 	ClusterID     string
@@ -39,7 +38,7 @@ func (l logger) Log(args ...interface{}) {
 // ready for being started.
 func NewTestCluster(srcPath, clusterID string, cfg *arvados.Config, listenHost string, logWriter func(...interface{})) *TestCluster {
 	return &TestCluster{
-		Super: boot.Supervisor{
+		Super: Supervisor{
 			SourcePath:           srcPath,
 			ClusterType:          "test",
 			ListenHost:           listenHost,
diff --git a/lib/controller/integration_test.go b/lib/controller/integration_test.go
index d93ffd64d..0e95c19ea 100644
--- a/lib/controller/integration_test.go
+++ b/lib/controller/integration_test.go
@@ -19,6 +19,7 @@ import (
 	"strconv"
 	"strings"
 
+	"git.arvados.org/arvados.git/lib/boot"
 	"git.arvados.org/arvados.git/lib/config"
 	"git.arvados.org/arvados.git/sdk/go/arvados"
 	"git.arvados.org/arvados.git/sdk/go/arvadostest"
@@ -29,7 +30,7 @@ import (
 var _ = check.Suite(&IntegrationSuite{})
 
 type IntegrationSuite struct {
-	testClusters map[string]*arvadostest.TestCluster
+	testClusters map[string]*boot.TestCluster
 	oidcprovider *arvadostest.OIDCProvider
 }
 
@@ -48,7 +49,7 @@ func (s *IntegrationSuite) SetUpSuite(c *check.C) {
 	s.oidcprovider.ValidClientID = "clientid"
 	s.oidcprovider.ValidClientSecret = "clientsecret"
 
-	s.testClusters = map[string]*arvadostest.TestCluster{
+	s.testClusters = map[string]*boot.TestCluster{
 		"z1111": nil,
 		"z2222": nil,
 		"z3333": nil,
@@ -129,7 +130,7 @@ func (s *IntegrationSuite) SetUpSuite(c *check.C) {
 		loader.SkipAPICalls = true
 		cfg, err := loader.Load()
 		c.Assert(err, check.IsNil)
-		tc := arvadostest.NewTestCluster(
+		tc := boot.NewTestCluster(
 			filepath.Join(cwd, "..", ".."),
 			id, cfg, "127.0.0."+id[3:], c.Log)
 		s.testClusters[id] = tc
diff --git a/tools/sync-groups/federation_test.go b/tools/sync-groups/federation_test.go
index baa2ec02a..aebac21de 100644
--- a/tools/sync-groups/federation_test.go
+++ b/tools/sync-groups/federation_test.go
@@ -10,6 +10,7 @@ import (
 	"os"
 	"path/filepath"
 
+	"git.arvados.org/arvados.git/lib/boot"
 	"git.arvados.org/arvados.git/lib/config"
 	"git.arvados.org/arvados.git/sdk/go/arvados"
 	"git.arvados.org/arvados.git/sdk/go/arvadostest"
@@ -22,7 +23,7 @@ var _ = check.Suite(&FederationSuite{})
 var origAPIHost, origAPIToken string
 
 type FederationSuite struct {
-	testClusters map[string]*arvadostest.TestCluster
+	testClusters map[string]*boot.TestCluster
 	oidcprovider *arvadostest.OIDCProvider
 }
 
@@ -39,7 +40,7 @@ func (s *FederationSuite) SetUpSuite(c *check.C) {
 	s.oidcprovider.ValidClientID = "clientid"
 	s.oidcprovider.ValidClientSecret = "clientsecret"
 
-	s.testClusters = map[string]*arvadostest.TestCluster{
+	s.testClusters = map[string]*boot.TestCluster{
 		"z1111": nil,
 		"z2222": nil,
 	}
@@ -110,7 +111,7 @@ func (s *FederationSuite) SetUpSuite(c *check.C) {
 		loader.SkipAPICalls = true
 		cfg, err := loader.Load()
 		c.Assert(err, check.IsNil)
-		tc := arvadostest.NewTestCluster(
+		tc := boot.NewTestCluster(
 			filepath.Join(cwd, "..", ".."),
 			id, cfg, "127.0.0."+id[3:], c.Log)
 		s.testClusters[id] = tc

commit 7ab4905be555e3e5f65c3020ccafe3cc88f9e839
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Fri Jan 8 18:37:14 2021 -0300

    16981: Removes config loader code to fix import cycle.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>

diff --git a/lib/controller/integration_test.go b/lib/controller/integration_test.go
index 7e719e72e..d93ffd64d 100644
--- a/lib/controller/integration_test.go
+++ b/lib/controller/integration_test.go
@@ -19,8 +19,10 @@ import (
 	"strconv"
 	"strings"
 
+	"git.arvados.org/arvados.git/lib/config"
 	"git.arvados.org/arvados.git/sdk/go/arvados"
 	"git.arvados.org/arvados.git/sdk/go/arvadostest"
+	"git.arvados.org/arvados.git/sdk/go/ctxlog"
 	check "gopkg.in/check.v1"
 )
 
@@ -121,10 +123,15 @@ func (s *IntegrationSuite) SetUpSuite(c *check.C) {
 `
 		}
 
-		tc, err := arvadostest.NewTestCluster(
-			filepath.Join(cwd, "..", ".."),
-			id, yaml, "127.0.0."+id[3:], c.Log)
+		loader := config.NewLoader(bytes.NewBufferString(yaml), ctxlog.TestLogger(c))
+		loader.Path = "-"
+		loader.SkipLegacy = true
+		loader.SkipAPICalls = true
+		cfg, err := loader.Load()
 		c.Assert(err, check.IsNil)
+		tc := arvadostest.NewTestCluster(
+			filepath.Join(cwd, "..", ".."),
+			id, cfg, "127.0.0."+id[3:], c.Log)
 		s.testClusters[id] = tc
 		s.testClusters[id].Start()
 	}
diff --git a/sdk/go/arvadostest/test_cluster.go b/sdk/go/arvadostest/test_cluster.go
index da2a9d78c..57dca3d83 100644
--- a/sdk/go/arvadostest/test_cluster.go
+++ b/sdk/go/arvadostest/test_cluster.go
@@ -5,12 +5,10 @@
 package arvadostest
 
 import (
-	"bytes"
 	"context"
 	"net/url"
 
 	"git.arvados.org/arvados.git/lib/boot"
-	"git.arvados.org/arvados.git/lib/config"
 	"git.arvados.org/arvados.git/lib/controller/rpc"
 	"git.arvados.org/arvados.git/lib/service"
 	"git.arvados.org/arvados.git/sdk/go/arvados"
@@ -39,15 +37,7 @@ func (l logger) Log(args ...interface{}) {
 
 // NewTestCluster loads the provided configuration, and sets up a test cluster
 // ready for being started.
-func NewTestCluster(srcPath string, clusterID, yamlConf, listenHost string, logWriter func(...interface{})) (*TestCluster, error) {
-	loader := config.NewLoader(bytes.NewBufferString(yamlConf), ctxlog.TestLogger(logger{logWriter}))
-	loader.Path = "-"
-	loader.SkipLegacy = true
-	loader.SkipAPICalls = true
-	cfg, err := loader.Load()
-	if err != nil {
-		return nil, err
-	}
+func NewTestCluster(srcPath, clusterID string, cfg *arvados.Config, listenHost string, logWriter func(...interface{})) *TestCluster {
 	return &TestCluster{
 		Super: boot.Supervisor{
 			SourcePath:           srcPath,
@@ -61,7 +51,7 @@ func NewTestCluster(srcPath string, clusterID, yamlConf, listenHost string, logW
 		},
 		Config:    *cfg,
 		ClusterID: clusterID,
-	}, nil
+	}
 }
 
 // Start the test cluster.
diff --git a/tools/sync-groups/federation_test.go b/tools/sync-groups/federation_test.go
index 2462383f3..baa2ec02a 100644
--- a/tools/sync-groups/federation_test.go
+++ b/tools/sync-groups/federation_test.go
@@ -5,12 +5,15 @@
 package main
 
 import (
+	"bytes"
 	"net"
 	"os"
 	"path/filepath"
 
+	"git.arvados.org/arvados.git/lib/config"
 	"git.arvados.org/arvados.git/sdk/go/arvados"
 	"git.arvados.org/arvados.git/sdk/go/arvadostest"
+	"git.arvados.org/arvados.git/sdk/go/ctxlog"
 	check "gopkg.in/check.v1"
 )
 
@@ -101,10 +104,15 @@ func (s *FederationSuite) SetUpSuite(c *check.C) {
 `
 		}
 
-		tc, err := arvadostest.NewTestCluster(
-			filepath.Join(cwd, "..", ".."),
-			id, yaml, "127.0.0."+id[3:], c.Log)
+		loader := config.NewLoader(bytes.NewBufferString(yaml), ctxlog.TestLogger(c))
+		loader.Path = "-"
+		loader.SkipLegacy = true
+		loader.SkipAPICalls = true
+		cfg, err := loader.Load()
 		c.Assert(err, check.IsNil)
+		tc := arvadostest.NewTestCluster(
+			filepath.Join(cwd, "..", ".."),
+			id, cfg, "127.0.0."+id[3:], c.Log)
 		s.testClusters[id] = tc
 		s.testClusters[id].Start()
 	}

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list