13994: Fix import cycle.
authorTom Clegg <tclegg@veritasgenetics.com>
Thu, 13 Sep 2018 18:43:28 +0000 (14:43 -0400)
committerTom Clegg <tclegg@veritasgenetics.com>
Thu, 13 Sep 2018 18:43:28 +0000 (14:43 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg@veritasgenetics.com>

sdk/go/arvados/integration_test_cluster.go [new file with mode: 0644]
sdk/go/arvadostest/integration_test_cluster.go [deleted file]
services/keepstore/proxy_remote_test.go

diff --git a/sdk/go/arvados/integration_test_cluster.go b/sdk/go/arvados/integration_test_cluster.go
new file mode 100644 (file)
index 0000000..ebf93f8
--- /dev/null
@@ -0,0 +1,25 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: Apache-2.0
+
+package arvados
+
+import (
+       "os"
+       "path/filepath"
+)
+
+// IntegrationTestCluster returns the cluster that has been set up by
+// the integration test framework (see /build/run-tests.sh). It panics
+// on error.
+func IntegrationTestCluster() *Cluster {
+       config, err := GetConfig(filepath.Join(os.Getenv("WORKSPACE"), "tmp", "arvados.yml"))
+       if err != nil {
+               panic(err)
+       }
+       cluster, err := config.GetCluster("")
+       if err != nil {
+               panic(err)
+       }
+       return cluster
+}
diff --git a/sdk/go/arvadostest/integration_test_cluster.go b/sdk/go/arvadostest/integration_test_cluster.go
deleted file mode 100644 (file)
index ac08ce1..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright (C) The Arvados Authors. All rights reserved.
-//
-// SPDX-License-Identifier: Apache-2.0
-
-package arvadostest
-
-import (
-       "os"
-       "path/filepath"
-
-       "git.curoverse.com/arvados.git/sdk/go/arvados"
-       check "gopkg.in/check.v1"
-)
-
-func IntegrationTestCluster(c *check.C) *arvados.Cluster {
-       config, err := arvados.GetConfig(filepath.Join(os.Getenv("WORKSPACE"), "tmp", "arvados.yml"))
-       c.Assert(err, check.IsNil)
-       cluster, err := config.GetCluster("")
-       c.Assert(err, check.IsNil)
-       return cluster
-}
index 84c84d6535ba20ccac709df2e4c53891ebaa6e7a..4c505138089f3c88eec29a0551593a852e4a0781 100644 (file)
@@ -86,7 +86,7 @@ func (s *ProxyRemoteSuite) SetUpTest(c *check.C) {
        s.remoteKeepproxy = httptest.NewServer(http.HandlerFunc(s.remoteKeepproxyHandler))
        s.remoteAPI = httptest.NewUnstartedServer(http.HandlerFunc(s.remoteAPIHandler))
        s.remoteAPI.StartTLS()
-       s.cluster = arvadostest.IntegrationTestCluster(c)
+       s.cluster = arvados.IntegrationTestCluster()
        s.cluster.RemoteClusters = map[string]arvados.RemoteCluster{
                s.remoteClusterID: arvados.RemoteCluster{
                        Host:     strings.Split(s.remoteAPI.URL, "//")[1],