[ARVADOS] updated: a79deca1f43e0c8854820ec77a1663d8bbf9a034

git at public.curoverse.com git at public.curoverse.com
Mon Dec 14 14:22:49 EST 2015


Summary of changes:
 services/api/test/unit/container_request_test.rb | 39 ++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

       via  a79deca1f43e0c8854820ec77a1663d8bbf9a034 (commit)
      from  8ebd52397bcf105a771895c1ceb33b7ab6880887 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit a79deca1f43e0c8854820ec77a1663d8bbf9a034
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Mon Dec 14 14:22:43 2015 -0500

    6429: Add for test child container requests are set priority=0 when parent
    container is in final state.

diff --git a/services/api/test/unit/container_request_test.rb b/services/api/test/unit/container_request_test.rb
index 74c230c..7f4206b 100644
--- a/services/api/test/unit/container_request_test.rb
+++ b/services/api/test/unit/container_request_test.rb
@@ -326,4 +326,43 @@ class ContainerRequestTest < ActiveSupport::TestCase
 
   end
 
+  test "Container makes container request, then is cancelled" do
+    set_user_from_auth :active_trustedclient
+    cr = ContainerRequest.new
+    cr.state = "Committed"
+    cr.container_image = "img"
+    cr.command = ["foo", "bar"]
+    cr.output_path = "/tmp"
+    cr.cwd = "/tmp"
+    cr.priority = 5
+    cr.save!
+
+    c = Container.find_by_uuid cr.container_uuid
+    assert_equal 5, c.priority
+
+    c2 = ContainerRequest.new
+    c2.state = "Committed"
+    c2.container_image = "img"
+    c2.command = ["foo", "bar"]
+    c2.output_path = "/tmp"
+    c2.cwd = "/tmp"
+    c2.priority = 10
+    c2.requesting_container_uuid = c.uuid
+    c2.save!
+
+    c2 = Container.find_by_uuid c2.container_uuid
+    assert_equal 10, c2.priority
+
+    act_as_system_user do
+      c.state = "Cancelled"
+      c.save!
+    end
+
+    cr.reload
+    assert_equal "Final", cr.state
+
+    c2.reload
+    assert_equal 0, c2.priority
+  end
+
 end

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list