[ARVADOS] updated: 1.1.3-182-g014ccf9

Git user git at public.curoverse.com
Mon Mar 12 13:18:19 EDT 2018


Summary of changes:
 apps/workbench/test/test_helper.rb               |  2 +-
 services/api/test/fixtures/containers.yml        |  2 +-
 services/api/test/unit/container_request_test.rb | 28 +++++-------------------
 services/api/test/unit/container_test.rb         | 21 ++++++++++++++----
 4 files changed, 24 insertions(+), 29 deletions(-)

       via  014ccf9cb540d85b153a592f8c882e523e5fa245 (commit)
       via  fe2c8a90b33dbbed8737198e72b61d13fe2601e3 (commit)
       via  5bb01a77834c3a516d12e2fa347171a6a5a8b2f8 (commit)
       via  dae2b6ac89e8c95c04799f2c9baa4cb3db4d24ac (commit)
      from  be4418d2b701a98cee784615f5784b3fa2d4a4fb (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 014ccf9cb540d85b153a592f8c882e523e5fa245
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Mon Mar 12 13:07:51 2018 -0400

    13143: Add missing "secret_mounts scrubbed" test.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>

diff --git a/services/api/test/unit/container_test.rb b/services/api/test/unit/container_test.rb
index bd07a88..ade3919 100644
--- a/services/api/test/unit/container_test.rb
+++ b/services/api/test/unit/container_test.rb
@@ -624,10 +624,23 @@ class ContainerTest < ActiveSupport::TestCase
   end
 
   [
-    Container::Complete,
-    Container::Cancelled,
-  ].each do |final_state|
-    test "secret_mounts is null after container is #{final_state}" do
+    {state: Container::Complete, exit_code: 0, output: '1f4b0bc7583c2a7f9102c395f4ffc5e3+45'},
+    {state: Container::Cancelled},
+  ].each do |final_attrs|
+    test "secret_mounts is null after container is #{final_attrs[:state]}" do
+      c, cr = minimal_new(secret_mounts: {'/secret' => {'kind' => 'text', 'content' => 'foo'}},
+                          container_count_max: 1)
+      set_user_from_auth :dispatch1
+      c.lock
+      c.update_attributes!(state: Container::Running)
+      c.reload
+      assert c.secret_mounts.has_key?('/secret')
+
+      c.update_attributes!(final_attrs)
+      c.reload
+      assert_equal({}, c.secret_mounts)
+      cr.reload
+      assert_equal({}, cr.secret_mounts)
       assert_no_secrets_logged
     end
   end

commit fe2c8a90b33dbbed8737198e72b61d13fe2601e3
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Mon Mar 12 11:44:19 2018 -0400

    13143: Fix same/different-secret_mounts tests.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>

diff --git a/services/api/test/unit/container_request_test.rb b/services/api/test/unit/container_request_test.rb
index 059d72e..89bf917 100644
--- a/services/api/test/unit/container_request_test.rb
+++ b/services/api/test/unit/container_request_test.rb
@@ -838,24 +838,17 @@ class ContainerRequestTest < ActiveSupport::TestCase
     end
   end
 
-  test "reuse container with same secret_mounts" do
-    set_user_from_auth :active
-    cr1 = create_minimal_req!(state: "Committed", priority: 1)
-    cr1.save!
-    cr2 = create_minimal_req!(state: "Committed", priority: 1, secret_mounts: {})
-    cr2.save!
-    assert_not_nil cr1.container_uuid
-    assert_equal cr1.container_uuid, cr2.container_uuid
-  end
-
-  secrets = {"/foo" => {"kind" => "binary"}}
+  secrets = {"/foo" => {"kind" => "text", "content" => "xyzzy"}}
+  same_secrets = {"/foo" => {"content" => "xyzzy", "kind" => "text"}}
+  different_secrets = {"/foo" => {"kind" => "text", "content" => "something completely different"}}
   [
     [true, nil, nil],
     [true, nil, {}],
     [true, {}, {}],
-    [true, secrets, secrets],
+    [true, secrets, same_secrets],
     [false, nil, secrets],
     [false, {}, secrets],
+    [false, secrets, different_secrets],
   ].each do |expect_reuse, sm1, sm2|
     test "container reuse secret_mounts #{sm1.inspect}, #{sm2.inspect}" do
       set_user_from_auth :active
@@ -894,17 +887,6 @@ class ContainerRequestTest < ActiveSupport::TestCase
     assert_no_secrets_logged
   end
 
-  test "not reuse container with different secret_mounts" do
-    secrets = {"/foo" => {"kind" => "binary"}}
-    set_user_from_auth :active
-    cr1 = create_minimal_req!(state: "Committed", priority: 1, secret_mounts: secrets.dup)
-    cr1.save!
-    cr2 = create_minimal_req!(state: "Committed", priority: 1, secret_mounts: secrets.dup)
-    cr2.save!
-    assert_not_nil cr1.container_uuid
-    assert_equal cr1.container_uuid, cr2.container_uuid
-  end
-
   test "conflicting key in mounts and secret_mounts" do
     sm = {'/secret/foo' => {'kind' => 'text', 'content' => secret_string}}
     set_user_from_auth :active

commit 5bb01a77834c3a516d12e2fa347171a6a5a8b2f8
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Mon Mar 12 11:43:22 2018 -0400

    13143: Sort hash keys for more realistic fixture md5.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>

diff --git a/services/api/test/fixtures/containers.yml b/services/api/test/fixtures/containers.yml
index a13cd32..3f5d3a1 100644
--- a/services/api/test/fixtures/containers.yml
+++ b/services/api/test/fixtures/containers.yml
@@ -43,7 +43,7 @@ running:
     /secret/6x9:
       kind: text
       content: "42\n"
-  secret_mounts_md5: <%= Digest::MD5.hexdigest(SafeJSON.dump({'/secret/6x9' => {'kind' => 'text', 'content' => "42\n"}})) %>
+  secret_mounts_md5: <%= Digest::MD5.hexdigest(SafeJSON.dump({'/secret/6x9' => {'content' => "42\n", 'kind' => 'text'}})) %>
   auth_uuid: zzzzz-gj3su-077z32aux8dg2s2
 
 running_older:

commit dae2b6ac89e8c95c04799f2c9baa4cb3db4d24ac
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Mon Mar 12 11:43:03 2018 -0400

    13143: Ignore secret_mounts_md5 from fixtures, too.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>

diff --git a/apps/workbench/test/test_helper.rb b/apps/workbench/test/test_helper.rb
index 5bde629..60dadec 100644
--- a/apps/workbench/test/test_helper.rb
+++ b/apps/workbench/test/test_helper.rb
@@ -86,7 +86,7 @@ module ApiFixtureLoader
         trim_index = file.index('# Test Helper trims the rest of the file')
         file = file[0, trim_index] if trim_index
         YAML.load(file).each do |name, ob|
-          ob.reject! { |k, v| k == 'secret_mounts' }
+          ob.reject! { |k, v| k.start_with?('secret_') }
         end
       end
       keys.inject(@@api_fixtures[name]) { |hash, key| hash[key] }.deep_dup

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list