[ARVADOS] updated: 8c4233dae52c96ceb629d2be1be73b518118863a

git at public.curoverse.com git at public.curoverse.com
Fri Sep 5 14:04:45 EDT 2014


Summary of changes:
 .../app/controllers/actions_controller.rb          | 38 ++++++++-------
 .../app/controllers/projects_controller.rb         |  3 +-
 apps/workbench/app/helpers/collections_helper.rb   | 22 +++++++--
 .../app/views/application/_choose.html.erb         | 24 ++++++----
 .../test/functional/actions_controller_test.rb     | 30 ++++++++++++
 .../workbench/test/integration/collections_test.rb | 54 ++++++++++++++++++++++
 .../test/integration/pipeline_instances_test.rb    | 33 +++++++++++++
 apps/workbench/test/integration/projects_test.rb   | 27 +++++++++++
 sdk/cli/bin/crunch-job                             | 10 ++--
 services/api/db/structure.sql                      |  4 +-
 services/api/test/fixtures/pipeline_templates.yml  | 21 +++++++++
 11 files changed, 229 insertions(+), 37 deletions(-)

       via  8c4233dae52c96ceb629d2be1be73b518118863a (commit)
       via  e322205a65bdc3a0565997eb68c86e74cd191762 (commit)
       via  80df142a2b7a53d420c837acc467fc39ac9ae312 (commit)
       via  35e39f925dae467785ed1b1fa752dd4f76133414 (commit)
       via  5184743db419caa1dca30b2d15e3b9d1cdb0c51c (commit)
       via  fd910ade561ddec093ec29a79a216259e53bef90 (commit)
       via  5828355672e3fc7926125dcc35882a642a4cde1a (commit)
       via  812f2714c2908e5b427a8e37032ddcd46fb08297 (commit)
       via  2449ae26b0d8be41aa5411e62032c9fb1ea9af71 (commit)
       via  0eb5711ade0f74e556b0a1c10909dbf0bdecb63f (commit)
      from  c90d8145634022d2d0c66b36bfb99e4c21248fed (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 8c4233dae52c96ceb629d2be1be73b518118863a
Author: radhika <radhika at curoverse.com>
Date:   Fri Sep 5 14:03:11 2014 -0400

    3654: add integration and funtional tests for combining collections and collection contents.

diff --git a/apps/workbench/test/functional/actions_controller_test.rb b/apps/workbench/test/functional/actions_controller_test.rb
index 9654538..d152a00 100644
--- a/apps/workbench/test/functional/actions_controller_test.rb
+++ b/apps/workbench/test/functional/actions_controller_test.rb
@@ -16,4 +16,34 @@ class ActionsControllerTest < ActionController::TestCase
     assert_equal true, found_email, 'Expected email after issue reported'
   end
 
+  test "combine files into new collection" do
+    post(:combine_selected_files_into_collection, {
+           selection: ['zzzzz-4zz18-znfnqtbbv4spc3w/foo',
+                       'zzzzz-4zz18-ehbhgtheo8909or/bar',
+                       'zzzzz-4zz18-y9vne9npefyxh8g/baz',
+                       '1fd08fc162a5c6413070a8bd0bffc818+150'],
+           format: "json"},
+         session_for(:active))
+
+    assert_response 302   # collection created and redirected to new collection page
+    new_collection_uuid = response.headers['Location'].split('/')[-1]
+
+    @controller = CollectionsController.new
+
+    get :show, {
+      id: new_collection_uuid
+    }
+    assert_response :success
+
+    collection = assigns(:object)
+    manifest_text = collection['manifest_text']
+    assert manifest_text.include?('foo'), 'Not found foo in new collection manifest text'
+    assert manifest_text.include?('bar'), 'Not found bar in new collection manifest text'
+    assert manifest_text.include?('baz'), 'Not found baz in new collection manifest text'
+    assert manifest_text.include?('0:0:file1 0:0:file2 0:0:file3'),
+                'Not found 0:0:file1 0:0:file2 0:0:file3 in new collection manifest text'
+    assert manifest_text.include?('dir1/subdir'), 'Not found dir1/subdir in new collection manifest text'
+    assert manifest_text.include?('dir2'), 'Not found dir2 in new collection manifest text'
+  end
+
 end
diff --git a/apps/workbench/test/integration/collections_test.rb b/apps/workbench/test/integration/collections_test.rb
index ac2625a..a5ce8fd 100644
--- a/apps/workbench/test/integration/collections_test.rb
+++ b/apps/workbench/test/integration/collections_test.rb
@@ -46,4 +46,58 @@ class CollectionsTest < ActionDispatch::IntegrationTest
     visit page_with_token('active', "/collections/#{uuid}")
     assert page.has_text?('This collection is empty')
   end
+
+  test "combine selected collections into new collection" do
+    foo_collection_uuid = api_fixture('collections')['foo_file']['uuid']
+    bar_collection_uuid = api_fixture('collections')['bar_file']['uuid']
+
+    visit page_with_token('active', "/collections")
+
+    assert(page.has_text?(foo_collection_uuid), "Collection page did not include foo file")
+    assert(page.has_text?(bar_collection_uuid), "Collection page did not include bar file")
+
+    within('tr', text: foo_collection_uuid) do
+      find('input[type=checkbox]').click
+    end
+
+    within('tr', text: bar_collection_uuid) do
+      find('input[type=checkbox]').click
+    end
+
+    click_button 'Selection...'
+    within('.selection-action-container') do
+      click_link 'Combine selections into a new collection'
+    end
+
+    # back in collections page
+    assert(page.has_text?(foo_collection_uuid), "Collection page did not include foo file")
+    assert(page.has_text?(bar_collection_uuid), "Collection page did not include bar file")
+  end
+
+  test "combine selected collection contents into new collection" do
+    foo_collection = api_fixture('collections')['foo_file']
+   # bar_collection = api_fixture('collections')['bar_file']
+   # pdh_collection = api_fixture('collections')['multilevel_collection_1']
+
+    visit page_with_token('active', "/collections")
+
+    # choose file from foo collection
+    within('tr', text: foo_collection['uuid']) do
+      click_link 'Show'
+    end
+
+    # now in collection page
+    within('tr', text: foo_collection['name'].split('_')[0]) do
+      find('input[type=checkbox]').click
+    end
+
+    click_button 'Selection...'
+    within('.selection-action-container') do
+      click_link 'Combine selections into a new collection'
+    end
+
+    # go back to collections page
+    visit page_with_token('active', "/collections")
+    assert(page.has_text?('sdfsdfsdfsdfsdfsdfsdf'), "Collection page did not include foo file link")
+  end
 end
diff --git a/apps/workbench/test/integration/projects_test.rb b/apps/workbench/test/integration/projects_test.rb
index 100f3bb..4fa9567 100644
--- a/apps/workbench/test/integration/projects_test.rb
+++ b/apps/workbench/test/integration/projects_test.rb
@@ -339,6 +339,7 @@ class ProjectsTest < ActionDispatch::IntegrationTest
 
     click_button 'Selection...'
     within('.selection-action-container') do
+      page.assert_selector 'li.disabled', text: 'Combine selections into a new collection'
       page.assert_selector 'li.disabled', text: 'Compare selected'
       page.assert_selector 'li.disabled', text: 'Copy selected'
       page.assert_selector 'li.disabled', text: 'Move selected'
@@ -356,6 +357,8 @@ class ProjectsTest < ActionDispatch::IntegrationTest
 
     click_button 'Selection...'
     within('.selection-action-container') do
+      page.assert_no_selector 'li.disabled', text: 'Combine selections into a new collection'
+      page.assert_selector 'li', text: 'Combine selections into a new collection'
       page.assert_selector 'li.disabled', text: 'Compare selected'
       page.assert_no_selector 'li.disabled', text: 'Copy selected'
       page.assert_selector 'li', text: 'Copy selected'
@@ -378,6 +381,7 @@ class ProjectsTest < ActionDispatch::IntegrationTest
 
     click_button 'Selection...'
     within('.selection-action-container') do
+      page.assert_selector 'li.disabled', text: 'Combine selections into a new collection'
       page.assert_selector 'li.disabled', text: 'Compare selected'
       page.assert_selector 'li.disabled', text: 'Copy selected'
       page.assert_no_selector 'li.disabled', text: 'Move selected'
@@ -406,6 +410,7 @@ class ProjectsTest < ActionDispatch::IntegrationTest
 
     click_button 'Selection...'
     within('.selection-action-container') do
+      page.assert_selector 'li.disabled', text: 'Combine selections into a new collection'
       page.assert_selector 'li.disabled', text: 'Compare selected'
       page.assert_selector 'li.disabled', text: 'Copy selected'
       page.assert_no_selector 'li.disabled', text: 'Move selected'
@@ -415,4 +420,26 @@ class ProjectsTest < ActionDispatch::IntegrationTest
     end
   end
 
+  test "combine selections into new collection" do
+    my_project = api_fixture('groups')['aproject']
+    my_collection = api_fixture('collections')['collection_to_move_around_in_aproject']
+
+    visit page_with_token 'active', '/'
+    find('.arv-project-list a,button', text: my_project['name']).click
+    assert page.has_text?(my_collection['name']), 'Collection not found in project'
+
+    within('tr', text: my_collection['name']) do
+      find('input[type=checkbox]').click
+    end
+
+    click_button 'Selection...'
+    within('.selection-action-container') do
+      click_link 'Combine selections into a new collection'
+    end
+
+    # back in project page
+    assert page.has_text?(my_collection['name']), 'Collection not found in project'
+    assert page.has_link?('Jobs and pipelines'), 'Jobs and pipelines link not found in project'
+  end
+
 end

commit e322205a65bdc3a0565997eb68c86e74cd191762
Merge: fd910ad 80df142
Author: radhika <radhika at curoverse.com>
Date:   Fri Sep 5 09:22:36 2014 -0400

    Merge branch 'master' into 3654-combine-selections


commit fd910ade561ddec093ec29a79a216259e53bef90
Merge: c90d814 812f271
Author: radhika <radhika at curoverse.com>
Date:   Thu Sep 4 16:58:51 2014 -0400

    Merge branch 'master' into 3654-combine-selections


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


hooks/post-receive
-- 




More information about the arvados-commits mailing list