[ARVADOS] updated: c4aefe62bd09b771c6e1cef7130645819af72cac

git at public.curoverse.com git at public.curoverse.com
Mon Nov 3 09:31:48 EST 2014


Summary of changes:
 .../controllers/collections_controller_test.rb     | 83 ++++++++++++++++++++++
 1 file changed, 83 insertions(+)
 create mode 100644 apps/workbench/test/controllers/collections_controller_test.rb

       via  c4aefe62bd09b771c6e1cef7130645819af72cac (commit)
      from  4d257edde88edfb9530afa0d8b0ba7c9216cfb3a (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 c4aefe62bd09b771c6e1cef7130645819af72cac
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Tue Oct 28 16:05:42 2014 -0400

    4031: Test for collection provenance/used_by

diff --git a/apps/workbench/test/controllers/collections_controller_test.rb b/apps/workbench/test/controllers/collections_controller_test.rb
new file mode 100644
index 0000000..95f9151
--- /dev/null
+++ b/apps/workbench/test/controllers/collections_controller_test.rb
@@ -0,0 +1,83 @@
+require 'test_helper'
+
+class CollectionsControllerTest < ActionController::TestCase
+  include PipelineInstancesHelper
+
+  class RequestDuck
+    def self.host
+      "localhost"
+    end
+
+    def self.port
+      8080
+    end
+
+    def self.protocol
+      "http"
+    end
+  end
+
+
+  test 'provenance graph' do
+    use_token 'admin'
+    obj = Collection.where(uuid: 'zzzzz-4zz18-uukreo9rbgwsujj').results.first
+
+    provenance = obj.provenance.stringify_keys
+
+    [obj[:portable_data_hash]].each do |k|
+      assert_not_nil provenance[k], "Expected key #{k} in provenance set"
+    end
+
+    prov_svg = ProvenanceHelper::create_provenance_graph(provenance, "provenance_svg",
+                                                         {:request => RequestDuck,
+                                                           :direction => :bottom_up,
+                                                           :combine_jobs => :script_only})
+
+    # hash -> baz file
+    assert /ea10d51bcf88862dbcc36eb292017dfd\+45->hash_f866587e2de5291fbd38d616d6d33eab/.match(prov_svg)
+
+    # hash2 -> baz file
+    assert /ea10d51bcf88862dbcc36eb292017dfd\+45->hash2_02a085407e751d00b5dc88f1bd5e8247/.match(prov_svg)
+
+    # owned_by_active -> hash
+    assert /hash_f866587e2de5291fbd38d616d6d33eab->fa7aeb5140e2848d39b416daeef4ffc5\+45/.match(prov_svg)
+
+    # owned_by_active -> hash2
+    assert /hash2_02a085407e751d00b5dc88f1bd5e8247->fa7aeb5140e2848d39b416daeef4ffc5\+45/.match(prov_svg)
+
+    # File::open "./tmp/stuff3.svg", "w" do |f|
+    #   f.write "<?xml version=\"1.0\" ?>\n"
+    #   f.write prov_svg
+    # end
+
+  end
+
+  test 'used_by graph' do
+    use_token 'admin'
+    obj = Collection.where(uuid: 'zzzzz-4zz18-bv31uwvy3neko22').results.first
+
+    used_by = obj.used_by.stringify_keys
+
+    used_by_svg = ProvenanceHelper::create_provenance_graph(used_by, "used_by_svg",
+                                                            {:request => RequestDuck,
+                                                              :direction => :top_down,
+                                                              :combine_jobs => :script_only,
+                                                              :pdata_only => true})
+
+    # bar_file -> hash2
+    assert /fa7aeb5140e2848d39b416daeef4ffc5\+45->hash2_f866587e2de5291fbd38d616d6d33eab/.match(used_by_svg)
+
+    # hash -> baz file
+    assert /hash_f866587e2de5291fbd38d616d6d33eab->ea10d51bcf88862dbcc36eb292017dfd\+45/.match(used_by_svg)
+
+    # hash2 -> baz file
+    assert /hash2_02a085407e751d00b5dc88f1bd5e8247->ea10d51bcf88862dbcc36eb292017dfd\+45/.match(used_by_svg)
+
+
+    # File::open "./tmp/stuff4.svg", "w" do |f|
+    #   f.write "<?xml version=\"1.0\" ?>\n"
+    #   f.write used_by_svg
+    # end
+
+  end
+end

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list