[ARVADOS] created: 09930fe84ce46936fb1cd0313b12fabddcbc4136

git at public.curoverse.com git at public.curoverse.com
Wed Nov 19 21:18:08 EST 2014


        at  09930fe84ce46936fb1cd0313b12fabddcbc4136 (commit)


commit 09930fe84ce46936fb1cd0313b12fabddcbc4136
Author: radhika <radhika at curoverse.com>
Date:   Wed Nov 19 21:05:16 2014 -0500

    4592: Fix the nil error when a collection without a name is selected as input.
    Also refactor the pipeline instances integration test to break re-run instance test into its own test.

diff --git a/apps/workbench/app/controllers/pipeline_instances_controller.rb b/apps/workbench/app/controllers/pipeline_instances_controller.rb
index 3326527..eb9bac0 100644
--- a/apps/workbench/app/controllers/pipeline_instances_controller.rb
+++ b/apps/workbench/app/controllers/pipeline_instances_controller.rb
@@ -86,7 +86,7 @@ class PipelineInstancesController < ApplicationController
                 obj = Collection.find value_info_value
                 if value_info_partitioned
                   value_info[:value] = obj.portable_data_hash + value_info_partitioned[1] + value_info_partitioned[2]
-                  value_info[:selection_name] = obj.name + value_info_partitioned[1] + value_info_partitioned[2]
+                  value_info[:selection_name] = obj.name ? obj.name + value_info_partitioned[1] + value_info_partitioned[2] : obj.name
                 else
                   value_info[:value] = obj.portable_data_hash
                   value_info[:selection_name] = obj.name
diff --git a/apps/workbench/test/integration/pipeline_instances_test.rb b/apps/workbench/test/integration/pipeline_instances_test.rb
index 6bb7890..f8870e0 100644
--- a/apps/workbench/test/integration/pipeline_instances_test.rb
+++ b/apps/workbench/test/integration/pipeline_instances_test.rb
@@ -221,20 +221,12 @@ class PipelineInstancesTest < ActionDispatch::IntegrationTest
   end
 
   [
-    ['active', false, false, false, 'Two Part Pipeline Template', false],
-    ['active', false, false, true, 'Two Part Pipeline Template', false],
-    ['active', true, false, false, 'Two Part Pipeline Template', false],
-    ['active', true, true, false, 'Two Part Pipeline Template', false],
-    ['active', true, false, true, 'Two Part Pipeline Template', false],
-    ['active', true, true, true, 'Two Part Pipeline Template', false],
-    ['project_viewer', false, false, true, 'Two Part Pipeline Template', false],
-    ['project_viewer', true, false, true, 'Two Part Pipeline Template', false],
-    ['project_viewer', true, true, true, 'Two Part Pipeline Template', false],
-    ['active', false, false, false, 'Two Part Template with dataclass File', true],
-    ['active', false, false, true, 'Two Part Template with dataclass File', true],
-  ].each do |user, with_options, choose_options, in_aproject, template_name, choose_file|
-    test "Rerun pipeline instance as #{user} using options #{with_options} #{choose_options}
-          in #{in_aproject} with #{template_name} with file #{choose_file}" do
+    [true, 'Two Part Pipeline Template', false],
+    [false, 'Two Part Pipeline Template', false],
+    [true, 'Two Part Template with dataclass File', true],
+    [false, 'Two Part Template with dataclass File', true],
+  ].each do |in_aproject, template_name, choose_file|
+    test "Run pipeline instance in #{in_aproject} with #{template_name} with file #{choose_file}" do
       visit page_with_token('active')
 
       # need bigger modal size when choosing a file from collection
@@ -255,6 +247,47 @@ class PipelineInstancesTest < ActionDispatch::IntegrationTest
       page.assert_selector 'a,button', text: 'Re-run with latest'
       page.assert_selector 'a,button', text: 'Re-run options'
 
+      # Verify that the newly created instance is created in the right project.
+      assert page.has_text? 'Home'
+      if in_aproject
+        assert page.has_text? 'A Project'
+      else
+        assert page.has_no_text? 'A Project'
+      end
+    end
+  end
+
+  [
+    ['active', false, false, false],
+    ['active', false, false, true],
+    ['active', true, false, false],
+    ['active', true, true, false],
+    ['active', true, false, true],
+    ['active', true, true, true],
+    ['project_viewer', false, false, true],
+    ['project_viewer', true, true, true],
+  ].each do |user, with_options, choose_options, in_aproject|
+    test "Rerun pipeline instance as #{user} using options #{with_options} #{choose_options} in #{in_aproject}" do
+      visit page_with_token('active')
+
+      # need bigger modal size when choosing a file from collection
+      Capybara.current_session.driver.browser.manage.window.resize_to(1024, 768)
+
+      if in_aproject
+        find("#projects-menu").click
+        find('.dropdown-menu a,button', text: 'A Project').click
+      end
+
+      create_and_run_pipeline_in_aproject in_aproject, 'Two Part Pipeline Template'
+      instance_path = current_path
+
+      # Pause the pipeline
+      find('a,button', text: 'Pause').click
+      assert page.has_text? 'Paused'
+      page.assert_no_selector 'a.disabled,button.disabled', text: 'Resume'
+      page.assert_selector 'a,button', text: 'Re-run with latest'
+      page.assert_selector 'a,button', text: 'Re-run options'
+
       # Pipeline can be re-run now. Access it as the specified user, and re-run
       if user == 'project_viewer'
         visit page_with_token(user, instance_path)
@@ -283,8 +316,7 @@ class PipelineInstancesTest < ActionDispatch::IntegrationTest
       # Verify that the newly created instance is created in the right project.
       # In case of project_viewer user, since the use cannot write to the project,
       # the pipeline should have been created in the user's Home project.
-      rerun_instance_path = current_path
-      assert_not_equal instance_path, rerun_instance_path, 'Rerun instance path expected to be different'
+      assert_not_equal instance_path, current_path, 'Rerun instance path expected to be different'
       assert page.has_text? 'Home'
       if in_aproject && (user != 'project_viewer')
         assert page.has_text? 'A Project'
@@ -295,7 +327,7 @@ class PipelineInstancesTest < ActionDispatch::IntegrationTest
   end
 
   # Create and run a pipeline for 'Two Part Pipeline Template' in 'A Project'
-  def create_and_run_pipeline_in_aproject in_aproject, template_name, choose_file
+  def create_and_run_pipeline_in_aproject in_aproject, template_name, choose_file=false
     # create a pipeline instance
     find('.btn', text: 'Run a pipeline').click
     within('.modal-dialog') do

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list