[ARVADOS] created: e1c11b908481334c7dddf5966eab23e85b07a758

Git user git at public.curoverse.com
Wed Sep 7 12:02:05 EDT 2016


        at  e1c11b908481334c7dddf5966eab23e85b07a758 (commit)


commit e1c11b908481334c7dddf5966eab23e85b07a758
Author: Tom Clegg <tom at curoverse.com>
Date:   Wed Sep 7 12:01:47 2016 -0400

    9969: Accept container requests and containers with command==[].

diff --git a/services/api/app/models/container.rb b/services/api/app/models/container.rb
index 1e645e4..2eb27ab 100644
--- a/services/api/app/models/container.rb
+++ b/services/api/app/models/container.rb
@@ -13,7 +13,7 @@ class Container < ArvadosModel
 
   before_validation :fill_field_defaults, :if => :new_record?
   before_validation :set_timestamps
-  validates :command, :container_image, :output_path, :cwd, :priority, :presence => true
+  validates :container_image, :output_path, :cwd, :priority, :presence => true
   validate :validate_state_change
   validate :validate_change
   validate :validate_lock
diff --git a/services/api/app/models/container_request.rb b/services/api/app/models/container_request.rb
index a56c341..f124856 100644
--- a/services/api/app/models/container_request.rb
+++ b/services/api/app/models/container_request.rb
@@ -14,7 +14,7 @@ class ContainerRequest < ArvadosModel
 
   before_validation :fill_field_defaults, :if => :new_record?
   before_validation :set_container
-  validates :command, :container_image, :output_path, :cwd, :presence => true
+  validates :container_image, :output_path, :cwd, :presence => true
   validate :validate_state_change
   validate :validate_change
   validate :validate_runtime_constraints
diff --git a/services/api/test/unit/container_request_test.rb b/services/api/test/unit/container_request_test.rb
index ebd6a5a..950137e 100644
--- a/services/api/test/unit/container_request_test.rb
+++ b/services/api/test/unit/container_request_test.rb
@@ -3,7 +3,6 @@ require 'test_helper'
 class ContainerRequestTest < ActiveSupport::TestCase
   def create_minimal_req! attrs={}
     defaults = {
-      command: ["echo", "foo"],
       container_image: links(:docker_image_collection_tag).name,
       cwd: "/tmp",
       environment: {},
@@ -123,7 +122,6 @@ class ContainerRequestTest < ActiveSupport::TestCase
     assert_not_nil cr.container_uuid
     c = Container.find_by_uuid cr.container_uuid
     assert_not_nil c
-    assert_equal ["echo", "foo"], c.command
     assert_equal collections(:docker_image).portable_data_hash, c.container_image
     assert_equal "/tmp", c.cwd
     assert_equal({}, c.environment)
@@ -395,4 +393,14 @@ class ContainerRequestTest < ActiveSupport::TestCase
     assert_not_empty Container.readable_by(users(:active)).where(uuid: containers(:running).uuid)
     assert_empty Container.readable_by(users(:spectator)).where(uuid: containers(:running).uuid)
   end
+
+  test "default command via []" do
+    set_user_from_auth :active
+    create_minimal_req!(command: [], priority: 1, state: "Committed")
+  end
+
+  test "default command via nil" do
+    set_user_from_auth :active
+    create_minimal_req!(priority: 1, state: "Committed")
+  end
 end

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list