Fix nodemanager tests. no issue #
authorPeter Amstutz <pamstutz@veritasgenetics.com>
Mon, 23 Apr 2018 15:29:55 +0000 (11:29 -0400)
committerPeter Amstutz <pamstutz@veritasgenetics.com>
Mon, 23 Apr 2018 15:29:55 +0000 (11:29 -0400)
Stub out subprocess.check_output to avoid calling the real "scontrol".
Fixes test_failed_arvados_calls_retried, test_subscribe and
test_creation_with_arvados_node in SLURMComputeNodeSetupActorTestCase.

Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz@veritasgenetics.com>

services/nodemanager/tests/test_computenode_dispatch_slurm.py

index b61db5cba1c57918c622d1ee815461ba6fe6de77..840d0a582ab76681893600403bfb9c1ac6626215 100644 (file)
@@ -141,3 +141,15 @@ class SLURMComputeNodeSetupActorTestCase(ComputeNodeSetupActorTestCase):
         self.make_actor()
         self.wait_for_assignment(self.setup_actor, 'cloud_node')
         check_output.assert_called_with(['scontrol', 'update', 'NodeName=compute99', 'Weight=1000', 'Features=instancetype=z1.test'])
+
+    @mock.patch('subprocess.check_output')
+    def test_failed_arvados_calls_retried(self, check_output):
+        super(SLURMComputeNodeSetupActorTestCase, self).test_failed_arvados_calls_retried()
+
+    @mock.patch('subprocess.check_output')
+    def test_subscribe(self, check_output):
+        super(SLURMComputeNodeSetupActorTestCase, self).test_subscribe()
+
+    @mock.patch('subprocess.check_output')
+    def test_creation_with_arvados_node(self, check_output):
+        super(SLURMComputeNodeSetupActorTestCase, self).test_creation_with_arvados_node()