From c271137b5f704f3df510b0b0dd8eceba25e006a8 Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Fri, 8 Jan 2021 18:59:51 -0300 Subject: [PATCH] 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 --- sdk/go/arvadostest/test_cluster.go => lib/boot/helpers.go | 7 +++---- lib/controller/integration_test.go | 7 ++++--- tools/sync-groups/federation_test.go | 7 ++++--- 3 files changed, 11 insertions(+), 10 deletions(-) rename sdk/go/arvadostest/test_cluster.go => lib/boot/helpers.go (97%) 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 57dca3d835..731fc56c83 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 d93ffd64dc..0e95c19ea5 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 baa2ec02a3..aebac21de6 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 -- 2.30.2