18348: Add ClusterID field to service log entries.
[arvados.git] / services / crunch-dispatch-local / crunch-dispatch-local_test.go
index 5f51134df8a9866a126fc32922787fd2be7c8957..7e8c42c25c193bbf3bf26bdefe80082b1ae50ff8 100644 (file)
@@ -39,15 +39,10 @@ var initialArgs []string
 
 func (s *TestSuite) SetUpSuite(c *C) {
        initialArgs = os.Args
-       arvadostest.StartAPI()
        runningCmds = make(map[string]*exec.Cmd)
        logrus.SetFormatter(&logrus.TextFormatter{DisableColors: true})
 }
 
-func (s *TestSuite) TearDownSuite(c *C) {
-       arvadostest.StopAPI()
-}
-
 func (s *TestSuite) SetUpTest(c *C) {
        args := []string{"crunch-dispatch-local"}
        os.Args = args
@@ -81,9 +76,11 @@ func (s *TestSuite) TestIntegration(c *C) {
                return cmd.Start()
        }
 
-       dispatcher.RunContainer = func(d *dispatch.Dispatcher, c arvados.Container, s <-chan arvados.Container) {
-               (&LocalRun{startCmd, make(chan bool, 8), ctx}).run(d, c, s)
-               cancel()
+       cl := arvados.Cluster{Containers: arvados.ContainersConfig{RuntimeEngine: "docker"}}
+
+       dispatcher.RunContainer = func(d *dispatch.Dispatcher, c arvados.Container, s <-chan arvados.Container) error {
+               defer cancel()
+               return (&LocalRun{startCmd, make(chan bool, 8), ctx, &cl}).run(d, c, s)
        }
 
        err = dispatcher.Run(ctx)
@@ -184,9 +181,11 @@ func testWithServerStub(c *C, apiStubResponses map[string]arvadostest.StubRespon
                return cmd.Start()
        }
 
-       dispatcher.RunContainer = func(d *dispatch.Dispatcher, c arvados.Container, s <-chan arvados.Container) {
-               (&LocalRun{startCmd, make(chan bool, 8), ctx}).run(d, c, s)
-               cancel()
+       cl := arvados.Cluster{Containers: arvados.ContainersConfig{RuntimeEngine: "docker"}}
+
+       dispatcher.RunContainer = func(d *dispatch.Dispatcher, c arvados.Container, s <-chan arvados.Container) error {
+               defer cancel()
+               return (&LocalRun{startCmd, make(chan bool, 8), ctx, &cl}).run(d, c, s)
        }
 
        re := regexp.MustCompile(`(?ms).*` + expected + `.*`)