2761: add diagnostics section to config
authorradhika <radhika@curoverse.com>
Tue, 16 Sep 2014 20:55:22 +0000 (16:55 -0400)
committerradhika <radhika@curoverse.com>
Tue, 16 Sep 2014 20:55:22 +0000 (16:55 -0400)
apps/workbench/config/application.default.yml
apps/workbench/config/database.yml
apps/workbench/test/diagnostics/pipeline_test.rb
apps/workbench/test/diagnostics_test_helper.rb

index c097ea3e6e59c7b6d06836597942388bdf8ad330..1a6bd026f3b42a6248579703687bffaed8ce64ec 100644 (file)
@@ -142,35 +142,36 @@ common:
   issue_reporter_email_to: arvados@example.com
   support_email_address: arvados@example.com
 
-  # Configuration for diagnostics testing. Use this to enable diagnostics testing for an env.
-  diagnostics_testing_user_tokens: false
-  diagnostics_testing_pipeline_fields: false
-
-  # Below is a sample setting for diagnostics testing.
-  # Configure test user tokens as "diagnostics_testing_user_tokens".
-  #   At this time the tests need an "active" user token.
-  # Also, configure the pipelines to be executed as "diagnostics_testing_pipeline_fields".
-  # For each of the pipelines identified by the name of your choice
-  #     ("tutorial pipeline" and "tutorial pipeline 2" in this sample):
-  #   template_uuid: is the uuid of the template to be executed
-  #   input_paths: an array of inputs for the pipeline. Use either a collection's "uuid"
-  #     or a file's "uuid/file_name" path in this array. If the pipeline does not require
-  #     any inputs, this can be omitted. 
-  #   max_wait_seconds: max time in seconds to wait for the pipeline run to complete.
-  #     Default value of 30 seconds is used when this value is not provided.
-  #diagnostics_testing_user_tokens:
-  #  active: eu33jurqntstmwo05h1jr3eblmi961e802703y6657s8zb14r
-  #diagnostics_testing_pipeline_fields:
-  #  pipeline with collection input:
-  #    template_uuid: 4xphq-p5p6p-gsw68qb7owx1q2h
-  #    input_paths: [qr1hi-4zz18-n1o4i1j5fvz6npu]
-  #    max_wait_seconds: 100
-  #  pipeline with file as input:
-  #    template_uuid: 4xphq-p5p6p-gsw68qb7owx1q2h
-  #    input_paths: [440e201c0141cb8a551b61fd7d07d2a1+83/qr1hi-8i9sb-j2tp8q1m2uf6a1o.log.txt]
-  #    max_wait_seconds: 200
-  #  pipeline with no inputs:
-  #    template_uuid: 4xphq-p5p6p-gsw68qb7owx1q2h
+#  # Configuration for diagnostics testing. See the "diagnostics" section for more explanation.
+#  arvados_workbench_url: false
+#  diagnostics_testing_user_tokens: false
+#  diagnostics_testing_pipeline_fields: false
 
   # filename suffixes for which view icon would be shown in collection show page
   filename_suffixes_with_view_icon: [txt, gif, jpeg, jpg, png, html, htm, pdf]
+
+# Below is a sample setting for diagnostics testing.
+# Configure test user tokens as "diagnostics_testing_user_tokens".
+#   At this time the tests need an "active" user token.
+# Also, configure the pipelines to be executed as "diagnostics_testing_pipeline_fields".
+# For each of the pipelines identified by the name of your choice
+#     ("tutorial pipeline" and "tutorial pipeline 2" in this sample):
+#   template_uuid: is the uuid of the template to be executed
+#   input_paths: an array of inputs for the pipeline. Use either a collection's "uuid"
+#     or a file's "uuid/file_name" path in this array. If the pipeline does not require
+#     any inputs, this can be omitted. 
+#   max_wait_seconds: max time in seconds to wait for the pipeline run to complete.
+#     Default value of 30 seconds is used when this value is not provided.
+
+diagnostics:
+  arvados_workbench_url: https://localhost:3000/
+  diagnostics_testing_user_tokens:
+    active: eu33jurqntstmwo05h1jr3eblmi961e802703y6657s8zb14r
+  diagnostics_testing_pipeline_fields:
+    tutorial pipeline 1:
+      template_uuid: zzzzz-p5p6p-rxj8d71854j9idn
+      input_paths: [zzzzz-4zz18-nz98douzhaa3jh2]
+      max_wait_seconds: 10
+    tutorial pipeline 2:
+      template_uuid: zzzzz-p5p6p-1xbobfobk94ppbv
+      input_paths: [zzzzz-4zz18-nz98douzhaa3jh2, zzzzz-4zz18-gpw9o5wpcti3nib]
index 51a4dd459dc12673ad440debb28f499c89550022..188ca37eec273e22f9fcb2e0991bafd783297b95 100644 (file)
@@ -23,3 +23,10 @@ production:
   database: db/production.sqlite3
   pool: 5
   timeout: 5000
+
+diagnostics:
+  adapter: sqlite3
+  database: db/diagnostics.sqlite3
+  pool: 5
+  timeout: 5000
+
index bd8ded684549bec7c183898074d28e85dfc13b87..95396c2b91f88af97da24bf8bfeb76685a986330 100644 (file)
@@ -6,16 +6,15 @@ class PipelineTest < DiagnosticsTest
   pipelines_to_run = Rails.configuration.diagnostics_testing_pipeline_fields.andand.keys
 
   setup do
-    headless = Headless.new
-    headless.start
+#    headless = Headless.new
+#    headless.start
     Capybara.current_driver = :selenium
   end
 
   pipelines_to_run.andand.each do |pipeline_to_run|
     test "visit home page for user #{pipeline_to_run}" do
       visit_page_with_token 'active'
-
-      pipeline_config = diagnostic_test_pipeline_config pipeline_to_run
+      pipeline_config = Rails.configuration.diagnostics_testing_pipeline_fields[pipeline_to_run]
 
       # Search for tutorial template
       within('.navbar-fixed-top') do
@@ -36,7 +35,7 @@ class PipelineTest < DiagnosticsTest
 
       # Choose input for the pipeline
       pipeline_config['input_paths'].each do |look_for|
-        select_inut look_for
+        select_input look_for
       end
       wait_for_ajax
 
@@ -51,43 +50,43 @@ class PipelineTest < DiagnosticsTest
     end
   end
 
-  def select_inut look_for
+  def select_input look_for
     inputs_needed = page.all('.btn', text: 'Choose')
     return if (!inputs_needed || !inputs_needed.any?)
 
-    inputs_needed[0].click
-    within('.modal-dialog') do
-      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]
+    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
 
-    if look_for_uuid
-      fill_in('Search', with: look_for_uuid, exact: true)
-    end
-           
-    wait_for_ajax
-    page.all('.selectable').first.click
-    wait_for_ajax
-    # it appears that ajax reload is wiping out input selection after search results; so, select one more time.
-    page.all('.selectable').first.click
-    wait_for_ajax
-
-    if look_for_file
+    inputs_needed[0].click
+
+    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
-      within('.collection_files_name', text: look_for_file) do
-        find('.fa-file').click
+      # it appears that ajax reload is wiping out input selection after search results; so, select one more time.
+      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
-    end
-    
-    find('button', text: 'OK').click
+      
+      find('button', text: 'OK').click
       wait_for_ajax
     end
   end
index a78bf6649f2dc51ca8f9aa80349c53c36381c347..ad2e737afb181fd1c7cea4139db8c17d43e58724 100644 (file)
@@ -4,14 +4,13 @@ require 'yaml'
 class DiagnosticsTest < ActionDispatch::IntegrationTest
 
   def visit_page_with_token token_name, path='/'
+    if !path.start_with? Rails.configuration.arvados_workbench_url
+      path = Rails.configuration.arvados_workbench_url + path
+    end
     tokens = Rails.configuration.diagnostics_testing_user_tokens
     visit page_with_token(tokens[token_name], path)
   end
 
-  def diagnostic_test_pipeline_config pipeline_to_run
-    Rails.configuration.diagnostics_testing_pipeline_fields[pipeline_to_run]
-  end
-
   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))
     Timeout.timeout(max_time) do