X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/b16f84a8c5562cd5c3939e8c445dc86df2be2d4b..7407f41105f8000bb3908d41a31daaf3a30d9440:/lib/controller/server_test.go diff --git a/lib/controller/server_test.go b/lib/controller/server_test.go index ae89c3d7ea..838de35563 100644 --- a/lib/controller/server_test.go +++ b/lib/controller/server_test.go @@ -5,13 +5,15 @@ package controller import ( + "context" "net/http" "os" "path/filepath" - "git.curoverse.com/arvados.git/sdk/go/arvados" - "git.curoverse.com/arvados.git/sdk/go/ctxlog" - "git.curoverse.com/arvados.git/sdk/go/httpserver" + "git.arvados.org/arvados.git/sdk/go/arvados" + "git.arvados.org/arvados.git/sdk/go/arvadostest" + "git.arvados.org/arvados.git/sdk/go/ctxlog" + "git.arvados.org/arvados.git/sdk/go/httpserver" check "gopkg.in/check.v1" ) @@ -32,23 +34,22 @@ func integrationTestCluster() *arvados.Cluster { func newServerFromIntegrationTestEnv(c *check.C) *httpserver.Server { log := ctxlog.TestLogger(c) - nodeProfile := arvados.NodeProfile{ - Controller: arvados.SystemServiceInstance{Listen: ":"}, - RailsAPI: arvados.SystemServiceInstance{Listen: os.Getenv("ARVADOS_TEST_API_HOST"), TLS: true, Insecure: true}, - } handler := &Handler{Cluster: &arvados.Cluster{ - ClusterID: "zzzzz", - PostgreSQL: integrationTestCluster().PostgreSQL, - NodeProfiles: map[string]arvados.NodeProfile{ - "*": nodeProfile, - }, - }, NodeProfile: &nodeProfile} + ClusterID: "zzzzz", + PostgreSQL: integrationTestCluster().PostgreSQL, + ForceLegacyAPI14: forceLegacyAPI14, + }} + handler.Cluster.TLS.Insecure = true + arvadostest.SetServiceURL(&handler.Cluster.Services.RailsAPI, "https://"+os.Getenv("ARVADOS_TEST_API_HOST")) + arvadostest.SetServiceURL(&handler.Cluster.Services.Controller, "http://localhost:/") srv := &httpserver.Server{ Server: http.Server{ - Handler: httpserver.AddRequestIDs(httpserver.LogRequests(log, handler)), + Handler: httpserver.HandlerWithContext( + ctxlog.Context(context.Background(), log), + httpserver.AddRequestIDs(httpserver.LogRequests(handler))), }, - Addr: nodeProfile.Controller.Listen, + Addr: ":", } return srv }