[ARVADOS] updated: 89096c06922b406f7157082de410e40960f5c73e

git at public.curoverse.com git at public.curoverse.com
Wed May 21 03:05:17 EDT 2014


Summary of changes:
 .../app/assets/javascripts/pipeline_instances.js   | 32 +++++++------
 apps/workbench/app/assets/javascripts/selection.js |  2 +-
 .../views/pipeline_templates/_show_recent.html.erb | 39 +++++++--------
 .../test/integration/pipeline_instances_test.rb    | 56 ++++++++++++++++++++++
 apps/workbench/test/integration/smoke_test.rb      |  4 ++
 apps/workbench/test/integration_helper.rb          | 16 +++++++
 services/api/test/fixtures/collections.yml         |  8 ++--
 services/api/test/fixtures/pipeline_templates.yml  |  3 +-
 8 files changed, 116 insertions(+), 44 deletions(-)
 create mode 100644 apps/workbench/test/integration/pipeline_instances_test.rb

       via  89096c06922b406f7157082de410e40960f5c73e (commit)
      from  9d6ce80869e187a7c5a574ea5a5272bb89dd81ce (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 89096c06922b406f7157082de410e40960f5c73e
Author: Tom Clegg <tom at curoverse.com>
Date:   Wed May 21 02:59:51 2014 -0400

    2754: Add integration test, fix selection bugs.

diff --git a/apps/workbench/app/assets/javascripts/pipeline_instances.js b/apps/workbench/app/assets/javascripts/pipeline_instances.js
index 3209d67..26a0c3e 100644
--- a/apps/workbench/app/assets/javascripts/pipeline_instances.js
+++ b/apps/workbench/app/assets/javascripts/pipeline_instances.js
@@ -9,37 +9,39 @@ function run_pipeline_button_state() {
 }
 
 $(document).on('editable:success', function(event, tag, response, newValue) {
+    var $tag = $(tag);
     if ($('.run-pipeline-button').length == 0)
         return;
-    tag = $(tag);
-    if (tag.hasClass("required")) {
+    if ($tag.hasClass("required")) {
         if (newValue && newValue.trim() != "") {
-            tag.removeClass("editable-empty");
-            tag.parent().css("background-color", "");
-            tag.parent().prev().css("background-color", "");
+            $tag.removeClass("editable-empty");
+            $tag.parent().css("background-color", "");
+            $tag.parent().prev().css("background-color", "");
         }
         else {
-            tag.addClass("editable-empty");
-            tag.parent().css("background-color", "#ffdddd");
-            tag.parent().prev().css("background-color", "#ffdddd");
+            $tag.addClass("editable-empty");
+            $tag.parent().css("background-color", "#ffdddd");
+            $tag.parent().prev().css("background-color", "#ffdddd");
         }
     }
-    if (tag.attr('data-name')) {
+    if ($tag.attr('data-name')) {
         // Update other inputs representing the same piece of data
-        $('[data-name="' + tag.attr('data-name') + '"]').html(newValue);
+        $('.editable[data-name="' + $tag.attr('data-name') + '"]').
+            editable('setValue', newValue);
     }
     run_pipeline_button_state();
 });
 
 $(document).on('ready ajax:complete', function() {
     $('a.editable.required').each(function() {
-        if (this.hasClass("editable-empty")) {
-            this.parent().css("background-color", "#ffdddd");
-            this.parent().prev().css("background-color", "#ffdddd");
+        var $tag = $(this);
+        if ($tag.hasClass("editable-empty")) {
+            $tag.parent().css("background-color", "#ffdddd");
+            $tag.parent().prev().css("background-color", "#ffdddd");
         }
         else {
-            this.parent().css("background-color", "");
-            this.parent().prev().css("background-color", "");
+            $tag.parent().css("background-color", "");
+            $tag.parent().prev().css("background-color", "");
         }
     });
     run_pipeline_button_state();
diff --git a/apps/workbench/app/assets/javascripts/selection.js b/apps/workbench/app/assets/javascripts/selection.js
index f8dbed5..1e32c63 100644
--- a/apps/workbench/app/assets/javascripts/selection.js
+++ b/apps/workbench/app/assets/javascripts/selection.js
@@ -125,7 +125,7 @@ jQuery(function($){
 });
 
 add_form_selection_sources = null;
-select_form_sources  = null;
+select_form_sources = null;
 
 (function() {
     var form_selection_sources = {};
diff --git a/apps/workbench/app/views/pipeline_templates/_show_recent.html.erb b/apps/workbench/app/views/pipeline_templates/_show_recent.html.erb
index 3ea7d8c..9b637d5 100644
--- a/apps/workbench/app/views/pipeline_templates/_show_recent.html.erb
+++ b/apps/workbench/app/views/pipeline_templates/_show_recent.html.erb
@@ -1,30 +1,23 @@
-<% content_for :css do %>
-  .playbutton {
-  color: white;
-  background: rgb(91, 192, 222);
-  border: 0px;
-  border-radius: 3px;
-  padding: 0px 3px;  
-  }
-  .playbutton:hover {
-  background: rgb(57, 179, 215);
-  }
-<% end %>
-
 <%= render partial: "paging", locals: {results: @objects, object: @object} %>
 
-<table class="table table-hover">
+<table class="table table-condensed arv-index">
+  <colgroup>
+    <col width="8%" />
+    <col width="10%" />
+    <col width="22%" />
+    <col width="45%" />
+    <col width="15%" />
+  </colgroup>
   <thead>
     <tr class="contain-align-left">
       <th>
       </th><th>
-	id
       </th><th>
-	name
+        name
       </th><th>
-	owner
+        components
       </th><th>
-	components
+        owner
       </th>
     </tr>
   </thead>
@@ -36,19 +29,19 @@
       <td>
         <%= form_tag '/pipeline_instances' do |f| %>
           <%= hidden_field :pipeline_instance, :pipeline_template_uuid, :value => ob.uuid %>
-          <%= button_tag nil, {class: 'playbutton', title: "Run #{ob.name}"} do %>
-            <span class="glyphicon glyphicon-play"></span>
+          <%= button_tag nil, {class: "btn btn-default btn-xs", title: "Run #{ob.name}"} do %>
+            Run <i class="fa fa-fw fa-play"></i>
           <% end %>
         <% end %>
       </td>
       <td>
-        <%= link_to_if_arvados_object ob %>
+        <%= render :partial => "show_object_button", :locals => {object: ob, size: 'xs'} %>
       </td><td>
         <%= render_editable_attribute ob, 'name' %>
       </td><td>
-        <%= link_to_if_arvados_object ob.owner_uuid, friendly_name: true %>
-      </td><td>
         <%= ob.components.collect { |k,v| k.to_s }.join(", ") %>
+      </td><td>
+        <%= link_to_if_arvados_object ob.owner_uuid, friendly_name: true %>
       </td>
     </tr>
 
diff --git a/apps/workbench/test/integration/pipeline_instances_test.rb b/apps/workbench/test/integration/pipeline_instances_test.rb
new file mode 100644
index 0000000..e10068f
--- /dev/null
+++ b/apps/workbench/test/integration/pipeline_instances_test.rb
@@ -0,0 +1,56 @@
+require 'integration_helper'
+require 'selenium-webdriver'
+require 'headless'
+
+class PipelineInstancesTest < ActionDispatch::IntegrationTest
+  setup do
+    # Selecting collections requiresLocalStorage
+    headless = Headless.new
+    headless.start
+    Capybara.current_driver = :selenium
+  end
+
+  test 'Create and run a pipeline' do
+    visit page_with_token('active_trustedclient')
+
+    click_link 'Pipeline templates'
+    within('tr', text: 'Two Part Pipeline Template') do
+      find('a,button', text: 'Run').click
+    end
+
+    instance_page = current_path
+
+    # Go over to the collections page and select something
+    click_link 'Collections (data files)'
+    within('tr', text: 'GNU_General_Public_License') do
+      find('input[type=checkbox]').click
+    end
+    find('#persistent-selection-count').click
+
+    # Go back to the pipeline instance page to use the new selection
+    visit instance_page
+
+    page.assert_selector 'a.disabled,button.disabled', text: 'Run'
+    assert find('div.alert', text: 'Provide a value')
+
+    find('div.form-group', text: 'Input for part-one component').
+      find('a,input').
+      click
+    find('.editable-input select').click
+    find('.editable-input').
+      first(:option, 'b519d9cb706a29fc7ea24dbea2f05851+249025').click
+    wait_for_ajax
+
+    # "Run" button is now enabled
+    page.assert_no_selector 'a.disabled,button.disabled', text: 'Run'
+
+    first('a,button', text: 'Run').click
+
+    # Pipeline is running. We have a "Stop" button instead now.
+    page.assert_selector 'a,button', text: 'Stop'
+    find('a,button', text: 'Stop').click
+
+    # Pipeline is stopped. We have the option to resume it.
+    page.assert_selector 'a,button', text: 'Run'
+  end
+end
diff --git a/apps/workbench/test/integration/smoke_test.rb b/apps/workbench/test/integration/smoke_test.rb
index 864224b..7293456 100644
--- a/apps/workbench/test/integration/smoke_test.rb
+++ b/apps/workbench/test/integration/smoke_test.rb
@@ -2,6 +2,10 @@ require 'integration_helper'
 require 'uri'
 
 class SmokeTest < ActionDispatch::IntegrationTest
+  setup do
+    Capybara.current_driver = Capybara.javascript_driver
+  end
+
   def assert_visit_success(allowed=[200])
     assert_includes(allowed, status_code,
                     "#{current_url} returned #{status_code}, not one of " +
diff --git a/apps/workbench/test/integration_helper.rb b/apps/workbench/test/integration_helper.rb
index a8788ce..ed6f7c2 100644
--- a/apps/workbench/test/integration_helper.rb
+++ b/apps/workbench/test/integration_helper.rb
@@ -48,4 +48,20 @@ class ActionDispatch::IntegrationTest
       false
     end
   end
+
+  @@screenshot_count = 0
+  def screenshot
+    image_file = "./tmp/workbench-fail-#{@@screenshot_count += 1}.png"
+    page.save_screenshot image_file
+    puts "Saved #{image_file}"
+  end
+
+  teardown do
+    if not passed?
+      screenshot
+    end
+    if Capybara.current_driver == :selenium
+      page.execute_script("window.localStorage.clear()")
+    end
+  end
 end
diff --git a/services/api/test/fixtures/collections.yml b/services/api/test/fixtures/collections.yml
index ce05d18..2e7355d 100644
--- a/services/api/test/fixtures/collections.yml
+++ b/services/api/test/fixtures/collections.yml
@@ -1,6 +1,6 @@
 user_agreement:
   uuid: b519d9cb706a29fc7ea24dbea2f05851+249025
-  owner_uuid: qr1hi-tpzed-tpj2ff66551eyym
+  owner_uuid: zzzzz-tpzed-000000000000000
   created_at: 2013-12-26T19:22:54Z
   modified_by_client_uuid: zzzzz-ozdt8-brczlopd8u8d0jr
   modified_by_user_uuid: zzzzz-tpzed-d9tiejq69daie8f
@@ -10,7 +10,7 @@ user_agreement:
 
 foo_file:
   uuid: 1f4b0bc7583c2a7f9102c395f4ffc5e3+45
-  owner_uuid: qr1hi-tpzed-000000000000000
+  owner_uuid: zzzzz-tpzed-000000000000000
   created_at: 2014-02-03T17:22:54Z
   modified_by_client_uuid: zzzzz-ozdt8-brczlopd8u8d0jr
   modified_by_user_uuid: zzzzz-tpzed-d9tiejq69daie8f
@@ -20,7 +20,7 @@ foo_file:
 
 bar_file:
   uuid: fa7aeb5140e2848d39b416daeef4ffc5+45
-  owner_uuid: qr1hi-tpzed-000000000000000
+  owner_uuid: zzzzz-tpzed-000000000000000
   created_at: 2014-02-03T17:22:54Z
   modified_by_client_uuid: zzzzz-ozdt8-brczlopd8u8d0jr
   modified_by_user_uuid: zzzzz-tpzed-d9tiejq69daie8f
@@ -30,7 +30,7 @@ bar_file:
 
 baz_file:
   uuid: ea10d51bcf88862dbcc36eb292017dfd+45
-  owner_uuid: qr1hi-tpzed-000000000000000
+  owner_uuid: zzzzz-tpzed-000000000000000
   created_at: 2014-02-03T17:22:54Z
   modified_by_client_uuid: zzzzz-ozdt8-brczlopd8u8d0jr
   modified_by_user_uuid: zzzzz-tpzed-d9tiejq69daie8f
diff --git a/services/api/test/fixtures/pipeline_templates.yml b/services/api/test/fixtures/pipeline_templates.yml
index 454c184..41005a4 100644
--- a/services/api/test/fixtures/pipeline_templates.yml
+++ b/services/api/test/fixtures/pipeline_templates.yml
@@ -14,7 +14,8 @@ two_part:
       script_parameters:
         input:
           required: true
-          dataclass: collection
+          dataclass: Collection
+          description: "Provide a collection containing at least two files."
     part-two:
       script: bar
       script_version: master

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list