17813: Fix tests
authorPeter Amstutz <peter.amstutz@curii.com>
Tue, 20 Jul 2021 21:01:08 +0000 (17:01 -0400)
committerPeter Amstutz <peter.amstutz@curii.com>
Tue, 20 Jul 2021 21:01:08 +0000 (17:01 -0400)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>

lib/crunchrun/crunchrun_test.go
lib/crunchrun/singularity.go

index bb7ffdf0306b26b2f5c56062aaaaaf7b256e5447..7519319e3c6632f42580dda54e4c3154483c55a5 100644 (file)
@@ -122,6 +122,8 @@ func (e *stubExecutor) Close()                          { e.closed = true }
 func (e *stubExecutor) Wait(context.Context) (int, error) {
        return <-e.exit, e.waitErr
 }
+func (e *stubExecutor) SetArvadoClient(containerClient *arvados.Client, keepClient IKeepClient, container arvados.Container, keepMount string) {
+}
 
 const fakeInputCollectionPDH = "ffffffffaaaaaaaa88888888eeeeeeee+1234"
 
index be2d1887153dfea20540db4b24626d4676351769..1a1567451d574a3d5de7710b40d9c0c6a4237ef1 100644 (file)
@@ -79,6 +79,10 @@ func (e *singularityExecutor) getOrCreateProject(ownerUuid string, name string,
 }
 
 func (e *singularityExecutor) ImageLoaded(imageId string) bool {
+       if e.containerClient == nil {
+               return false
+       }
+
        // Check if docker image is cached in keep & if so set imageFilename
 
        // Cache the image to keep
@@ -159,6 +163,10 @@ func (e *singularityExecutor) LoadImage(imageTarballPath string) error {
                return err
        }
 
+       if e.containerClient == nil {
+               return nil
+       }
+
        // Cache the image to keep
        cacheGroup, err := e.getOrCreateProject(e.container.RuntimeUserUUID, ".cache", true)
        if err != nil {