From: radhika Date: Thu, 6 Nov 2014 13:01:39 +0000 (-0500) Subject: 3177: store input pdh value even when input dataclass is File. Update two tests to... X-Git-Tag: 1.1.0~1998^2~16 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/88d7932586705439e7a02b403e65202164920660 3177: store input pdh value even when input dataclass is File. Update two tests to no longer look for clippy. --- diff --git a/apps/workbench/app/controllers/pipeline_instances_controller.rb b/apps/workbench/app/controllers/pipeline_instances_controller.rb index fa724b82b4..ef97b1e5bf 100644 --- a/apps/workbench/app/controllers/pipeline_instances_controller.rb +++ b/apps/workbench/app/controllers/pipeline_instances_controller.rb @@ -64,11 +64,12 @@ class PipelineInstancesController < ApplicationController if component[:script_parameters] component[:script_parameters].each do |param, value_info| if value_info.is_a? Hash - value_info_class = resource_class_for_uuid(value_info[:value]) + value_info_partitioned = value_info[:value].partition('/') + value_info_class = resource_class_for_uuid(value_info_partitioned[0]) if value_info_class == Link # Use the link target, not the link itself, as script # parameter; but keep the link info around as well. - link = Link.find value_info[:value] + link = Link.find value_info_partitioned[0] value_info[:value] = link.head_uuid value_info[:link_uuid] = link.uuid value_info[:link_name] = link.name @@ -81,10 +82,10 @@ class PipelineInstancesController < ApplicationController # to ensure reproducibility, the script_parameter for a # collection should be the portable_data_hash # keep the collection name and uuid for human-readability - obj = Collection.find value_info[:value] - value_info[:value] = obj.portable_data_hash + obj = Collection.find value_info_partitioned[0] + value_info[:value] = obj.portable_data_hash + value_info_partitioned[1] + value_info_partitioned[2] value_info[:selection_uuid] = obj.uuid - value_info[:selection_name] = obj.name + value_info[:selection_name] = obj.name + value_info_partitioned[1] + value_info_partitioned[2] end end end diff --git a/apps/workbench/app/helpers/application_helper.rb b/apps/workbench/app/helpers/application_helper.rb index 65eb73681d..213f5c2792 100644 --- a/apps/workbench/app/helpers/application_helper.rb +++ b/apps/workbench/app/helpers/application_helper.rb @@ -287,7 +287,7 @@ module ApplicationHelper preconfigured_search_str: (preconfigured_search_str || ""), action_data: { merge: true, - use_checkbox_selection: dataclass == File ? true : false, + use_checkbox_selection: dataclass == File ? true : nil, selection_param: selection_param, success: 'page-refresh' }.to_json, diff --git a/apps/workbench/test/integration/pipeline_instances_test.rb b/apps/workbench/test/integration/pipeline_instances_test.rb index 7095a87442..f4860ffd7d 100644 --- a/apps/workbench/test/integration/pipeline_instances_test.rb +++ b/apps/workbench/test/integration/pipeline_instances_test.rb @@ -29,13 +29,6 @@ class PipelineInstancesTest < ActionDispatch::IntegrationTest instance_page = current_path - # Go over to the collections page and select something - visit '/collections' - within('tr', text: 'GNU_General_Public_License') do - find('input[type=checkbox]').click - end - find('#persistent-selection-count').click - # Add this collection to the project visit '/projects' find("#projects-menu").click @@ -106,13 +99,6 @@ class PipelineInstancesTest < ActionDispatch::IntegrationTest test 'Create pipeline inside a project and run' do visit page_with_token('active_trustedclient') - # Go over to the collections page and select something - visit '/collections' - within('tr', text: 'GNU_General_Public_License') do - find('input[type=checkbox]').click - end - find('#persistent-selection-count').click - # Add this collection to the project using collections menu from top nav visit '/projects' find("#projects-menu").click @@ -322,9 +308,9 @@ class PipelineInstancesTest < ActionDispatch::IntegrationTest click_link 'API response' api_response = JSON.parse(find('div#advanced_api_response pre').text) input_params = api_response['components']['part-one']['script_parameters']['input'] - assert_equal input_params['value'], col['portable_data_hash'] - assert_equal input_params['selection_name'], col['name'] - assert_equal input_params['selection_uuid'], col['uuid'] + assert_equal(input_params['value'], col['portable_data_hash'], "Not found expected input param value") + assert_equal(input_params['selection_name'], col['name'], "Not found expected input param name") + assert_equal(input_params['selection_uuid'], col['uuid'], "Not found expected input param uuid") # "Run" button present and enabled page.assert_no_selector 'a.disabled,button.disabled', text: 'Run'