[ARVADOS] created: 87e1e1461ab049795b4403f6bacfd841b6b6e349

Git user git at public.curoverse.com
Tue Dec 6 14:00:13 EST 2016


        at  87e1e1461ab049795b4403f6bacfd841b6b6e349 (commit)


commit 87e1e1461ab049795b4403f6bacfd841b6b6e349
Author: radhika <radhika at curoverse.com>
Date:   Tue Dec 6 13:57:04 2016 -0500

    10241: add a diagnostics test to run a process using a workflow.

diff --git a/apps/workbench/config/application.default.yml b/apps/workbench/config/application.default.yml
index e4e2782..c2dcba8 100644
--- a/apps/workbench/config/application.default.yml
+++ b/apps/workbench/config/application.default.yml
@@ -26,6 +26,11 @@ diagnostics:
     pipeline_2:
       template_uuid: zzzzz-p5p6p-1xbobfobk94ppbv
       input_paths: [zzzzz-4zz18-nz98douzhaa3jh2, zzzzz-4zz18-gpw9o5wpcti3nib]
+  container_requests_to_test:
+    container_request_1:
+      workflow_uuid: zzzzz-7fd4e-60e96shgwspt4mw
+      input_paths: []
+      max_wait_seconds: 10
 
 # Below is a sample setting for performance testing.
 # Configure workbench URL as "arvados_workbench_url"
diff --git a/apps/workbench/test/diagnostics/container_request_test.rb b/apps/workbench/test/diagnostics/container_request_test.rb
new file mode 100644
index 0000000..3a30df3
--- /dev/null
+++ b/apps/workbench/test/diagnostics/container_request_test.rb
@@ -0,0 +1,44 @@
+require 'diagnostics_test_helper'
+
+class ContainerRequestTest < DiagnosticsTest
+  crs_to_test = Rails.configuration.container_requests_to_test.andand.keys
+
+  setup do
+    need_selenium 'to make websockets work'
+  end
+
+  crs_to_test.andand.each do |cr_to_test|
+    test "run container_request: #{cr_to_test}" do
+      cr_config = Rails.configuration.container_requests_to_test[cr_to_test]
+
+      visit_page_with_token 'active'
+
+      find('.btn', text: 'Run a process').click
+
+      within('.modal-dialog') do
+        page.find_field('Search').set cr_config['workflow_uuid']
+        wait_for_ajax
+        find('.selectable', text: 'bwa-mem.cwl').click
+        find('.btn', text: 'Next: choose inputs').click
+      end
+
+      page.assert_selector('a.disabled,button.disabled', text: 'Run') if cr_config['input_paths'].any?
+
+      # Choose input for the workflow
+      cr_config['input_paths'].each do |look_for|
+        select_input look_for
+      end
+      wait_for_ajax
+
+      # All needed input are already filled in. Run this workflow now
+      page.assert_no_selector('a.disabled,button.disabled', text: 'Run')
+      find('a,button', text: 'Run').click
+
+      # container_request is running. We have a "Pause" button instead now.
+      page.assert_selector 'a,button', text: 'Pause'
+
+      # Wait for container_request run to complete
+      wait_until_page_has 'completed', cr_config['max_wait_seconds']
+    end
+  end
+end
diff --git a/apps/workbench/test/diagnostics/pipeline_test.rb b/apps/workbench/test/diagnostics/pipeline_test.rb
index d038222..11d0e42 100644
--- a/apps/workbench/test/diagnostics/pipeline_test.rb
+++ b/apps/workbench/test/diagnostics/pipeline_test.rb
@@ -42,54 +42,11 @@ class PipelineTest < DiagnosticsTest
       find('a,button', text: 'Components').click
       find('a,button', text: 'Run').click
 
-      # Pipeline is running. We have a "Stop" button instead now.
+      # Pipeline is running. We have a "Pause" button instead now.
       page.assert_selector 'a,button', text: 'Pause'
 
       # Wait for pipeline run to complete
       wait_until_page_has 'completed', pipeline_config['max_wait_seconds']
     end
   end
-
-  def select_input look_for
-    inputs_needed = page.all('.btn', text: 'Choose')
-    return if (!inputs_needed || !inputs_needed.any?)
-
-    look_for_uuid = nil
-    look_for_file = nil
-    if look_for.andand.index('/').andand.>0
-      partitions = look_for.partition('/')
-      look_for_uuid = partitions[0]
-      look_for_file = partitions[2]
-    else
-      look_for_uuid = look_for
-      look_for_file = nil
-    end
-
-    assert_triggers_dom_event 'shown.bs.modal' do
-      inputs_needed[0].click
-    end
-
-    within('.modal-dialog') do
-      if look_for_uuid
-        fill_in('Search', with: look_for_uuid, exact: true)
-        wait_for_ajax
-      end
-             
-      page.all('.selectable').first.click
-      wait_for_ajax
-      # ajax reload is wiping out input selection after search results; so, select again.
-      page.all('.selectable').first.click
-      wait_for_ajax
-
-      if look_for_file
-        wait_for_ajax
-        within('.collection_files_name', text: look_for_file) do
-          find('.fa-file').click
-        end
-      end
-      
-      find('button', text: 'OK').click
-      wait_for_ajax
-    end
-  end
 end
diff --git a/apps/workbench/test/diagnostics_test_helper.rb b/apps/workbench/test/diagnostics_test_helper.rb
index 3587721..46b961a 100644
--- a/apps/workbench/test/diagnostics_test_helper.rb
+++ b/apps/workbench/test/diagnostics_test_helper.rb
@@ -21,6 +21,49 @@ class DiagnosticsTest < ActionDispatch::IntegrationTest
     visit page_with_token(tokens[token_name], (workbench_url + path))
   end
 
+  def select_input look_for
+    inputs_needed = page.all('.btn', text: 'Choose')
+    return if (!inputs_needed || !inputs_needed.any?)
+
+    look_for_uuid = nil
+    look_for_file = nil
+    if look_for.andand.index('/').andand.>0
+      partitions = look_for.partition('/')
+      look_for_uuid = partitions[0]
+      look_for_file = partitions[2]
+    else
+      look_for_uuid = look_for
+      look_for_file = nil
+    end
+
+    assert_triggers_dom_event 'shown.bs.modal' do
+      inputs_needed[0].click
+    end
+
+    within('.modal-dialog') do
+      if look_for_uuid
+        fill_in('Search', with: look_for_uuid, exact: true)
+        wait_for_ajax
+      end
+
+      page.all('.selectable').first.click
+      wait_for_ajax
+      # ajax reload is wiping out input selection after search results; so, select again.
+      page.all('.selectable').first.click
+      wait_for_ajax
+
+      if look_for_file
+        wait_for_ajax
+        within('.collection_files_name', text: look_for_file) do
+          find('.fa-file').click
+        end
+      end
+
+      find('button', text: 'OK').click
+      wait_for_ajax
+    end
+  end
+
   # Looks for the text_to_look_for for up to the max_time provided
   def wait_until_page_has text_to_look_for, max_time=30
     max_time = 30 if (!max_time || (max_time.to_s != max_time.to_i.to_s))

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list