1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
12 "git.curoverse.com/arvados.git/sdk/go/arvados"
13 "git.curoverse.com/arvados.git/sdk/go/ctxlog"
14 "git.curoverse.com/arvados.git/sdk/go/httpserver"
15 check "gopkg.in/check.v1"
18 func integrationTestCluster() *arvados.Cluster {
19 cfg, err := arvados.GetConfig(filepath.Join(os.Getenv("WORKSPACE"), "tmp", "arvados.yml"))
23 cc, err := cfg.GetCluster("zzzzz")
30 // Return a new unstarted controller server, using the Rails API
31 // provided by the integration-testing environment.
32 func newServerFromIntegrationTestEnv(c *check.C) *httpserver.Server {
33 log := ctxlog.TestLogger(c)
35 nodeProfile := arvados.NodeProfile{
36 Controller: arvados.SystemServiceInstance{Listen: ":"},
37 RailsAPI: arvados.SystemServiceInstance{Listen: os.Getenv("ARVADOS_TEST_API_HOST"), TLS: true, Insecure: true},
39 handler := &Handler{Cluster: &arvados.Cluster{
41 PostgreSQL: integrationTestCluster().PostgreSQL,
42 NodeProfiles: map[string]arvados.NodeProfile{
45 }, NodeProfile: &nodeProfile}
47 srv := &httpserver.Server{
49 Handler: httpserver.AddRequestIDs(httpserver.LogRequests(log, handler)),
51 Addr: nodeProfile.Controller.Listen,