[ARVADOS] created: 1.3.0-3238-gb51b07c1f

Git user git at public.arvados.org
Thu Oct 1 19:46:43 UTC 2020


        at  b51b07c1fecd73b4af61de0f9f531e40c6e96f01 (commit)


commit b51b07c1fecd73b4af61de0f9f531e40c6e96f01
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Thu Oct 1 16:44:15 2020 -0300

    16462: Some fiddling with rpc.NewConn - WIP
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>

diff --git a/lib/controller/forecast/controller_test.go b/lib/controller/forecast/controller_test.go
index e0be2705f..afd8ecc64 100644
--- a/lib/controller/forecast/controller_test.go
+++ b/lib/controller/forecast/controller_test.go
@@ -6,14 +6,16 @@ package forecast
 
 import (
 	"context"
+	"net/url"
 	"os"
 	"path/filepath"
 	"testing"
 	"time"
 
-	"git.arvados.org/arvados.git/lib/controller/localdb"
+	"git.arvados.org/arvados.git/lib/controller/rpc"
 	"git.arvados.org/arvados.git/sdk/go/arvados"
 	"git.arvados.org/arvados.git/sdk/go/arvadostest"
+	"git.arvados.org/arvados.git/sdk/go/auth"
 	"git.arvados.org/arvados.git/sdk/go/ctxlog"
 
 	check "gopkg.in/check.v1"
@@ -64,7 +66,10 @@ func (s *ForecastSuite) SetUpTest(c *check.C) {
 	//s.ctx, s.rollback = arvadostest.TransactionContext(c, arvadostest.DB(c, cluster))
 	//s.stub = &arvadostest.APIStub{}
 
-	s.ctrl = New(cluster, localdb.NewConn(cluster))
+	s.ctrl = New(cluster, rpc.NewConn(
+		cluster.ClusterID,
+		&url.URL{Scheme: "https", Host: os.Getenv("ARVADOS_TEST_API_HOST")},
+		true, rpc.PassthroughTokenProvider))
 }
 
 func (s *ForecastSuite) TearDownTest(c *check.C) {
@@ -82,8 +87,9 @@ func (s *ForecastSuite) TearDownTest(c *check.C) {
 func (s *ForecastSuite) TestDatapoints(c *check.C) {
 	// zzzzz-xvhdp-p1i7h1gy5z1ft4p is hasher_root from services/api/test/fixtures/container_requests.yml
 	// if we have a better way to address fixture content in controller we should replace this hardcoded value
-	resp, err := s.ctrl.ForecastDatapoints(s.ctx, arvados.GetOptions{UUID: "zzzzz-xvhdp-p1i7h1gy5z1ft4p"})
-	c.Error(s.ctrl.parent.ContainerRequestGet(context.Background(), arvados.GetOptions{UUID: "zzzzz-xvhdp-p1i7h1gy5z1ft4p"}))
+	ctx := auth.NewContext(s.ctx, auth.NewCredentials(arvadostest.SystemRootToken))
+	resp, err := s.ctrl.ForecastDatapoints(ctx, arvados.GetOptions{UUID: "zzzzz-xvhdp-p1i7h1gy5z1ft4p"})
+	// c.Error(s.ctrl.parent.ContainerRequestGet(context.Background(), arvados.GetOptions{UUID: "zzzzz-xvhdp-p1i7h1gy5z1ft4p"}))
 	c.Check(err, check.IsNil)
 	c.Check(len(resp.Datapoints), check.Equals, 3)
 	//c.Check(s.stub.Calls(s.stub.UserList), check.HasLen, 1)

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list