1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
15 "git.arvados.org/arvados.git/sdk/go/arvados"
16 "git.arvados.org/arvados.git/sdk/go/arvadostest"
17 "git.arvados.org/arvados.git/sdk/go/ctxlog"
18 "git.arvados.org/arvados.git/sdk/go/httpserver"
19 check "gopkg.in/check.v1"
22 func integrationTestCluster() *arvados.Cluster {
23 cfg, err := arvados.GetConfig(filepath.Join(os.Getenv("WORKSPACE"), "tmp", "arvados.yml"))
27 cc, err := cfg.GetCluster("zzzzz")
34 // Return a new unstarted controller server, using the Rails API
35 // provided by the integration-testing environment.
36 func newServerFromIntegrationTestEnv(c *check.C) *httpserver.Server {
37 log := ctxlog.TestLogger(c)
38 ctx := ctxlog.Context(context.Background(), log)
40 Cluster: &arvados.Cluster{
42 PostgreSQL: integrationTestCluster().PostgreSQL,
44 BackgroundContext: ctx,
46 handler.Cluster.TLS.Insecure = true
47 handler.Cluster.Collections.BlobSigning = true
48 handler.Cluster.Collections.BlobSigningKey = arvadostest.BlobSigningKey
49 handler.Cluster.Collections.BlobSigningTTL = arvados.Duration(time.Hour * 24 * 14)
50 arvadostest.SetServiceURL(&handler.Cluster.Services.RailsAPI, "https://"+os.Getenv("ARVADOS_TEST_API_HOST"))
51 arvadostest.SetServiceURL(&handler.Cluster.Services.Controller, "http://localhost:/")
53 srv := &httpserver.Server{
55 BaseContext: func(net.Listener) context.Context { return ctx },
56 Handler: httpserver.AddRequestIDs(httpserver.LogRequests(handler)),