16981: Removes the import cycle issue by moving code to lib/boot.
authorLucas Di Pentima <lucas@di-pentima.com.ar>
Fri, 8 Jan 2021 21:59:51 +0000 (18:59 -0300)
committerLucas Di Pentima <lucas@di-pentima.com.ar>
Fri, 8 Jan 2021 21:59:51 +0000 (18:59 -0300)
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@di-pentima.com.ar>

lib/boot/helpers.go [moved from sdk/go/arvadostest/test_cluster.go with 97% similarity]
lib/controller/integration_test.go
tools/sync-groups/federation_test.go

similarity index 97%
rename from sdk/go/arvadostest/test_cluster.go
rename to lib/boot/helpers.go
index 57dca3d835cb7d110a2eb26802f3684d39c5e0a1..731fc56c83ac582260b06fce87cf648dd7c5d686 100644 (file)
@@ -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,
index d93ffd64dce2354e020d45f69144f4d1ddbcd4cf..0e95c19ea5ca06aef24e815a2f280a40257f7267 100644 (file)
@@ -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
index baa2ec02a3540711777d793ca03877e481db51ab..aebac21de6bf8236550def7be2972fb88e14a0ec 100644 (file)
@@ -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