[ARVADOS] created: 5905f1299f3a55519d1c79991e405ae8d47711f9

Git user git at public.curoverse.com
Thu Sep 29 12:38:42 EDT 2016


        at  5905f1299f3a55519d1c79991e405ae8d47711f9 (commit)


commit 5905f1299f3a55519d1c79991e405ae8d47711f9
Author: Tom Morris <tfmorris at curoverse.com>
Date:   Thu Sep 29 12:33:49 2016 -0400

    Fix negative Capybara assertion/matcher

diff --git a/apps/workbench/test/integration/pipeline_instances_test.rb b/apps/workbench/test/integration/pipeline_instances_test.rb
index 7700156..d97850c 100644
--- a/apps/workbench/test/integration/pipeline_instances_test.rb
+++ b/apps/workbench/test/integration/pipeline_instances_test.rb
@@ -57,7 +57,7 @@ class PipelineInstancesTest < ActionDispatch::IntegrationTest
     end
 
     # project chooser
-    within('.modal-dialog') do
+    within('.modal-dialog') do #FIXME: source of 1 test error
       find('.selectable', text: 'A Project').click
       find('button', text: 'Choose').click
     end
@@ -226,7 +226,7 @@ class PipelineInstancesTest < ActionDispatch::IntegrationTest
     template_uuid = api_fixture("pipeline_templates", template_name, "uuid")
     visit page_with_token("active", "/pipeline_templates/#{template_uuid}")
     click_on "Run this pipeline"
-    within(".modal-dialog") do
+    within(".modal-dialog") do # FIXME: source of 3 test errors
       # Set project for the new pipeline instance
       find(".selectable", text: project_name).click
       click_on "Choose"
@@ -453,7 +453,7 @@ class PipelineInstancesTest < ActionDispatch::IntegrationTest
     page.assert_selector 'a,button', text: 'Pause'
 
     # Since it is test env, no jobs are created to run. So, graph not visible
-    assert_not page.has_text? 'Graph'
+    assert page.has_no_text? 'Graph'
   end
 
   [

commit eabe4efe7b0964f537f2e09fb0d820272f1c86e7
Author: Tom Morris <tfmorris at curoverse.com>
Date:   Thu Sep 29 12:33:40 2016 -0400

    Fix not present test for Capybara

diff --git a/apps/workbench/test/integration/pipeline_instances_test.rb b/apps/workbench/test/integration/pipeline_instances_test.rb
index 3d8cbf0..7700156 100644
--- a/apps/workbench/test/integration/pipeline_instances_test.rb
+++ b/apps/workbench/test/integration/pipeline_instances_test.rb
@@ -149,7 +149,7 @@ class PipelineInstancesTest < ActionDispatch::IntegrationTest
     page.assert_selector 'a,button', text: 'Re-run options'
 
     # Since it is test env, no jobs are created to run. So, graph not visible
-    assert_not page.has_text? 'Graph'
+    assert page.has_no_text? 'Graph'
   end
 
   # Create a pipeline instance from within a project and run

commit 986cdafd30a7bef4ccfbd18f808be52b2f6a458e
Author: Tom Morris <tfmorris at curoverse.com>
Date:   Thu Sep 29 12:33:27 2016 -0400

    Fix long wait for Capybara test

diff --git a/apps/workbench/test/integration/users_test.rb b/apps/workbench/test/integration/users_test.rb
index 90a3eb2..140cb56 100644
--- a/apps/workbench/test/integration/users_test.rb
+++ b/apps/workbench/test/integration/users_test.rb
@@ -80,7 +80,8 @@ class UsersTest < ActionDispatch::IntegrationTest
 
     click_link 'Advanced'
     click_link 'Metadata'
-    assert !(page.has_text? 'VirtualMachine:')
+    assert page.has_text? 'can_login' # make sure page is rendered / ready
+    assert page.has_no_text? 'VirtualMachine:'
   end
 
   test "setup the active user" do

commit bc67ce8d098c36e999739a9213b29bb72af6f23d
Author: Tom Morris <tfmorris at curoverse.com>
Date:   Thu Sep 29 12:33:01 2016 -0400

    Fix row selection logic to not wait

diff --git a/apps/workbench/test/helpers/share_object_helper.rb b/apps/workbench/test/helpers/share_object_helper.rb
index 0d20aac..0266388 100644
--- a/apps/workbench/test/helpers/share_object_helper.rb
+++ b/apps/workbench/test/helpers/share_object_helper.rb
@@ -31,9 +31,10 @@ module ShareObjectHelper
       end
       click_on "Add"
     end
-    using_wait_time(Capybara.default_max_wait_time * 3) do
+    # Admin case takes many times longer than normal user, but not sure why
+    using_wait_time(30) do
       assert(page.has_link?(name),
-             "new share was not added to sharing table")
+             "new share #{name} was not added to sharing table")
       assert_equal(start_share_count + 1, share_rows.size,
                    "new share did not add row to sharing table")
     end
@@ -41,7 +42,8 @@ module ShareObjectHelper
 
   def modify_share_and_check(name)
     start_rows = share_rows
-    link_row = start_rows.select { |row| row.has_text?(name) }
+    # We assume rows have already been rendered and can be checked quickly
+    link_row = start_rows.select { |row| row.has_text?(name, wait:(0.1) ) }
     assert_equal(1, link_row.size, "row with new permission not found")
     within(link_row.first) do
       click_on("Read")

commit 1ce0bd54f40a686959e95e63f7aaa8b233269932
Author: Tom Morris <tfmorris at curoverse.com>
Date:   Thu Sep 29 12:33:16 2016 -0400

    Restore Capybara.default_max_wait_time side effect

diff --git a/apps/workbench/test/integration_helper.rb b/apps/workbench/test/integration_helper.rb
index d5be993..424b666 100644
--- a/apps/workbench/test/integration_helper.rb
+++ b/apps/workbench/test/integration_helper.rb
@@ -71,6 +71,8 @@ Capybara.register_driver :selenium_with_download do |app|
 end
 
 module WaitForAjax
+  # FIXME: Huge side effect here
+  Capybara.default_max_wait_time = 10
   def wait_for_ajax
     timeout = 10
     count = 0

commit 54cd184005d14ba93e93ae0eeb16ea70ee09a3b6
Author: Tom Morris <tfmorris at curoverse.com>
Date:   Thu Sep 29 12:31:48 2016 -0400

    Fix and simplify wait_for_ajax
    
    Don't change global Capybara.default_max_wait_time
    Sleep so we're not competing with thread(s) doing work

diff --git a/apps/workbench/test/integration_helper.rb b/apps/workbench/test/integration_helper.rb
index f0c811a..d5be993 100644
--- a/apps/workbench/test/integration_helper.rb
+++ b/apps/workbench/test/integration_helper.rb
@@ -71,16 +71,16 @@ Capybara.register_driver :selenium_with_download do |app|
 end
 
 module WaitForAjax
-  Capybara.default_max_wait_time = 10
   def wait_for_ajax
-    Timeout.timeout(Capybara.default_max_wait_time) do
-      loop until finished_all_ajax_requests?
+    timeout = 10
+    count = 0
+    while page.evaluate_script("jQuery.active").to_i > 0
+      count += 1
+      raise "AJAX request took more than #{timeout} seconds" if count > timeout * 10
+      sleep(0.1)
     end
   end
 
-  def finished_all_ajax_requests?
-    page.evaluate_script('jQuery.active').zero?
-  end
 end
 
 module AssertDomEvent

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list