18321: Fix tests
authorPeter Amstutz <peter.amstutz@curii.com>
Tue, 21 Dec 2021 17:00:28 +0000 (12:00 -0500)
committerPeter Amstutz <peter.amstutz@curii.com>
Tue, 21 Dec 2021 17:00:28 +0000 (12:00 -0500)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>

lib/crunchrun/crunchrun_test.go
services/api/app/models/container_request.rb

index 67b18857b0ea3cf5321e529a8984ed5e89017628..97f91103a072ff124651ffe475da1e1b2da71c95 100644 (file)
@@ -992,7 +992,7 @@ func (s *TestSuite) TestEnableCUDADeviceCount(c *C) {
     "mounts": {"/tmp": {"kind": "tmp"} },
     "output_path": "/tmp",
     "priority": 1,
-    "runtime_constraints": {"cuda_device_count": 2},
+    "runtime_constraints": {"cuda": {"device_count": 2}},
     "state": "Locked",
     "output_storage_classes": ["foo", "bar"]
 }`, nil, 0, func() {
@@ -1010,13 +1010,13 @@ func (s *TestSuite) TestEnableCUDAHardwareCapability(c *C) {
     "mounts": {"/tmp": {"kind": "tmp"} },
     "output_path": "/tmp",
     "priority": 1,
-    "runtime_constraints": {"cuda_hardware_capability": "foo"},
+    "runtime_constraints": {"cuda": {"hardware_capability": "foo"}},
     "state": "Locked",
     "output_storage_classes": ["foo", "bar"]
 }`, nil, 0, func() {
                fmt.Fprintln(s.executor.created.Stdout, "ok")
        })
-       c.Check(s.executor.created.CUDADeviceCount, Equals, 1)
+       c.Check(s.executor.created.CUDADeviceCount, Equals, 0)
 }
 
 func (s *TestSuite) TestStopOnSignal(c *C) {
index a3264e419b080a989e1552bc43b1ae278f37db5d..17247246c0c8f54d93e7b8584342fe2c19711084 100644 (file)
@@ -348,7 +348,7 @@ class ContainerRequest < ArvadosModel
           v = runtime_constraints['cuda'][k]
           if !v.is_a?(String) || (runtime_constraints['cuda']['device_count'] > 0 && v.to_f == 0.0)
             errors.add(:runtime_constraints,
-                       "[cuda.#{k}]=#{v.inspect} must be a string in format 'X.Y' version")
+                       "[cuda.#{k}]=#{v.inspect} must be a string in format 'X.Y'")
           end
         end
       end