From fced3381bd3e4cfba379a50107f5dc27dda93aea Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Fri, 1 Feb 2019 16:22:41 -0500 Subject: [PATCH] 14325: Fix test. Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- lib/dispatchcloud/container/queue_test.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/dispatchcloud/container/queue_test.go b/lib/dispatchcloud/container/queue_test.go index 75326921f5..91d65359e8 100644 --- a/lib/dispatchcloud/container/queue_test.go +++ b/lib/dispatchcloud/container/queue_test.go @@ -6,12 +6,14 @@ package container import ( "errors" + "os" "sync" "testing" "time" "git.curoverse.com/arvados.git/sdk/go/arvados" "git.curoverse.com/arvados.git/sdk/go/arvadostest" + "github.com/sirupsen/logrus" check "gopkg.in/check.v1" ) @@ -22,6 +24,14 @@ func Test(t *testing.T) { var _ = check.Suite(&IntegrationSuite{}) +func logger() logrus.FieldLogger { + logger := logrus.StandardLogger() + if os.Getenv("ARVADOS_DEBUG") != "" { + logger.SetLevel(logrus.DebugLevel) + } + return logger +} + type IntegrationSuite struct{} func (suite *IntegrationSuite) TearDownTest(c *check.C) { @@ -35,7 +45,7 @@ func (suite *IntegrationSuite) TestGetLockUnlockCancel(c *check.C) { } client := arvados.NewClientFromEnv() - cq := NewQueue(test.Logger(), nil, typeChooser, client) + cq := NewQueue(logger(), nil, typeChooser, client) err := cq.Update() c.Check(err, check.IsNil) @@ -92,7 +102,7 @@ func (suite *IntegrationSuite) TestCancelIfNoInstanceType(c *check.C) { } client := arvados.NewClientFromEnv() - cq := NewQueue(test.Logger(), nil, errorTypeChooser, client) + cq := NewQueue(logger(), nil, errorTypeChooser, client) var ctr arvados.Container err := client.RequestAndDecode(&ctr, "GET", "arvados/v1/containers/"+arvadostest.QueuedContainerUUID, nil, nil) -- 2.30.2