1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
13 "git.curoverse.com/arvados.git/sdk/go/arvados"
14 "git.curoverse.com/arvados.git/sdk/go/arvadostest"
15 "git.curoverse.com/arvados.git/sdk/go/ctxlog"
16 "git.curoverse.com/arvados.git/sdk/go/httpserver"
17 check "gopkg.in/check.v1"
20 func integrationTestCluster() *arvados.Cluster {
21 cfg, err := arvados.GetConfig(filepath.Join(os.Getenv("WORKSPACE"), "tmp", "arvados.yml"))
25 cc, err := cfg.GetCluster("zzzzz")
32 // Return a new unstarted controller server, using the Rails API
33 // provided by the integration-testing environment.
34 func newServerFromIntegrationTestEnv(c *check.C) *httpserver.Server {
35 log := ctxlog.TestLogger(c)
37 handler := &Handler{Cluster: &arvados.Cluster{
39 PostgreSQL: integrationTestCluster().PostgreSQL,
41 EnableBetaController14287: enableBetaController14287,
43 handler.Cluster.TLS.Insecure = true
44 arvadostest.SetServiceURL(&handler.Cluster.Services.RailsAPI, "https://"+os.Getenv("ARVADOS_TEST_API_HOST"))
45 arvadostest.SetServiceURL(&handler.Cluster.Services.Controller, "http://localhost:/")
47 srv := &httpserver.Server{
49 Handler: httpserver.HandlerWithContext(
50 ctxlog.Context(context.Background(), log),
51 httpserver.AddRequestIDs(httpserver.LogRequests(handler))),