[ARVADOS] created: 1.3.0-1917-g8f6b17e9e

Git user git at public.curoverse.com
Mon Nov 25 12:01:17 UTC 2019


        at  8f6b17e9e21665b70562280cc8687866e06c0054 (commit)


commit 8f6b17e9e21665b70562280cc8687866e06c0054
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date:   Mon Nov 25 09:00:35 2019 -0300

    15848: Multi site search integration test WIP.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>

diff --git a/apps/workbench/test/integration/search_box_test.rb b/apps/workbench/test/integration/search_box_test.rb
index 76f2ff8c7..c8abacb46 100644
--- a/apps/workbench/test/integration/search_box_test.rb
+++ b/apps/workbench/test/integration/search_box_test.rb
@@ -9,6 +9,20 @@ class SearchBoxTest < ActionDispatch::IntegrationTest
     need_javascript
   end
 
+  test "test multi site search" do
+    Rails.configuration.Workbench.MultiSiteSearch = 'true'
+    visit page_with_token('active')
+
+    within('.navbar-fixed-top') do
+      assert_selector('a', text: 'Multi-site search')
+      click_link('Multi-site search')
+    end
+
+    within('div[data-mount-mithril="Search"]') do
+      assert_selector('input#search.form-control', 'Expected to find the input search box')
+    end
+  end
+
   # test the search box
   def verify_search_box user
     if !user || !user['is_active']
diff --git a/apps/workbench/test/integration_helper.rb b/apps/workbench/test/integration_helper.rb
index 7209f2b6c..6a5780912 100644
--- a/apps/workbench/test/integration_helper.rb
+++ b/apps/workbench/test/integration_helper.rb
@@ -37,6 +37,7 @@ end
 
 def poltergeist_opts
   {
+    # js_errors: false, # Ignore JS errors
     phantomjs_options: ['--ignore-ssl-errors=true'],
     port: available_port('poltergeist'),
     window_size: [1200, 800],

commit 57197c381da1c2185189421357216cd20d444ec9
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date:   Thu Nov 21 18:04:57 2019 -0300

    15848: Enhances default ordering test with more cases.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>

diff --git a/services/api/test/integration/collections_api_test.rb b/services/api/test/integration/collections_api_test.rb
index 9ed978b71..58b276ac6 100644
--- a/services/api/test/integration/collections_api_test.rb
+++ b/services/api/test/integration/collections_api_test.rb
@@ -15,29 +15,37 @@ class CollectionsApiTest < ActionDispatch::IntegrationTest
     assert_equal "arvados#collectionList", json_response['kind']
   end
 
-  test "should get index ordered by 'modified_at desc' by default" do
-    get "/arvados/v1/collections",
-      params: {:format => :json},
-      headers: auth(:active)
-    assert_response :success
-    modified_at_dates = json_response['items'].collect{ |x| DateTime.parse(x['modified_at']) }
-    assert modified_at_dates.first > modified_at_dates.last
-    assert_equal modified_at_dates, modified_at_dates.sort{|a, b| b <=> a}
-    oldest = json_response['items'].last
-
-    # Update oldest collection and re-request index
-    put "/arvados/v1/collections/#{oldest['uuid']}",
-      params: {
-        format: :json,
-        collection: { name: "a name" }
-      },
-      headers: auth(:admin)
-    assert_response :success
-    get "/arvados/v1/collections",
-      params: {:format => :json},
-      headers: auth(:active)
-    assert_response :success
-    assert_equal oldest['uuid'], json_response['items'].first['uuid']
+  [
+    ['without order', {:format => :json}],
+    ['with order=[]', {:format => :json, :order => [].to_json}],
+    ['with order=null', {:format => :json, :order => nil}],
+  ].each do |comment, params|
+    test "should get index ordered by 'modified_at desc' by default #{comment}" do
+      get "/arvados/v1/collections",
+        params: params,
+        headers: auth(:active)
+      assert_response :success
+      assert json_response['items'].length > 1
+      modified_at_dates = json_response['items'].collect{ |x| DateTime.parse(x['modified_at']) }
+      assert modified_at_dates.first > modified_at_dates.last
+      assert_equal modified_at_dates, modified_at_dates.sort{ |a, b| b <=> a }
+      oldest = json_response['items'].last
+
+      # Update oldest collection and re-request index
+      put "/arvados/v1/collections/#{oldest['uuid']}",
+        params: {
+          format: :json,
+          collection: { name: "a name" }
+        },
+        headers: auth(:admin)
+      assert_response :success
+      get "/arvados/v1/collections",
+        params: params,
+        headers: auth(:active)
+      assert_response :success
+      # Oldest should be now newest
+      assert_equal oldest['uuid'], json_response['items'].first['uuid']
+    end
   end
 
   test "get index with filters= (empty string)" do

commit 75b1bfbd0ad4009e8c1d77addcef6064c98692d7
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date:   Thu Nov 21 16:32:44 2019 -0300

    15848: Enhances indentation to improve readability.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>

diff --git a/apps/workbench/test/integration/search_box_test.rb b/apps/workbench/test/integration/search_box_test.rb
index 1eed15882..76f2ff8c7 100644
--- a/apps/workbench/test/integration/search_box_test.rb
+++ b/apps/workbench/test/integration/search_box_test.rb
@@ -11,82 +11,83 @@ class SearchBoxTest < ActionDispatch::IntegrationTest
 
   # test the search box
   def verify_search_box user
-    if user && user['is_active']
-      aproject_uuid = api_fixture('groups')['aproject']['uuid']
-      # let's search for aproject by uuid
+    if !user || !user['is_active']
       within('.navbar-fixed-top') do
-        page.has_field?('search this site')
-        page.find_field('search this site').set aproject_uuid
-        page.find('.glyphicon-search').click
+        page.has_no_field?('search this site')
       end
+      return
+    end
 
-      # we should now be in aproject as a result of search
-      assert_selector 'a', text:'Data collections'
-      click_link 'Data collections'
-      assert_selector "#Data_collections[data-object-uuid='#{aproject_uuid}']", "Expected to be in user page after search click"
-
-      # let's search again for an invalid uuid
-      within('.navbar-fixed-top') do
-        search_for = String.new user['uuid']
-        search_for[0]='1'
-        page.find_field('search this site').set search_for
-        page.find('.glyphicon-search').click
-      end
+    aproject_uuid = api_fixture('groups')['aproject']['uuid']
+    # let's search for aproject by uuid
+    within('.navbar-fixed-top') do
+      page.has_field?('search this site')
+      page.find_field('search this site').set aproject_uuid
+      page.find('.glyphicon-search').click
+    end
 
-      # we should see 'not found' error page
-      assert page.has_text?('Not Found'), 'No text - Not Found'
-      assert page.has_link?('Report problem'), 'No text - Report problem'
-      click_link 'Report problem'
-      within '.modal-content' do
-        assert page.has_text?('Report a problem'), 'No text - Report a problem'
-        assert page.has_no_text?('Version / debugging info'), 'No text - Version / debugging info'
-        assert page.has_text?('Describe the problem'), 'No text - Describe the problem'
-        assert page.has_text?('Send problem report'), 'Send problem report button text is not found'
-        assert page.has_no_button?('Send problem report'), 'Send problem report button is not disabled before entering problem description'
-        assert page.has_button?('Cancel'), 'No button - Cancel'
-
-        # enter a report text and click on report
-        page.find_field('report_issue_text').set 'my test report text'
-        assert page.has_button?('Send problem report'), 'Send problem report button not enabled after entering text'
-        click_button 'Send problem report'
-
-        # ajax success updated button texts and added footer message
-        assert page.has_no_text?('Send problem report'), 'Found button - Send problem report'
-        assert page.has_no_button?('Cancel'), 'Found button - Cancel'
-        assert page.has_text?('Report sent'), 'No text - Report sent'
-        assert page.has_button?('Close'), 'No text - Close'
-        assert page.has_text?('Thanks for reporting this issue'), 'No text - Thanks for reporting this issue'
-
-        click_button 'Close'
-      end
+    # we should now be in aproject as a result of search
+    assert_selector 'a', text:'Data collections'
+    click_link 'Data collections'
+    assert_selector "#Data_collections[data-object-uuid='#{aproject_uuid}']", "Expected to be in user page after search click"
+
+    # let's search again for an invalid uuid
+    within('.navbar-fixed-top') do
+      search_for = String.new user['uuid']
+      search_for[0]='1'
+      page.find_field('search this site').set search_for
+      page.find('.glyphicon-search').click
+    end
 
-      # let's search for the anonymously accessible project
-      publicly_accessible_project = api_fixture('groups')['anonymously_accessible_project']
+    # we should see 'not found' error page
+    assert page.has_text?('Not Found'), 'No text - Not Found'
+    assert page.has_link?('Report problem'), 'No text - Report problem'
+    click_link 'Report problem'
+    within '.modal-content' do
+      assert page.has_text?('Report a problem'), 'No text - Report a problem'
+      assert page.has_no_text?('Version / debugging info'), 'No text - Version / debugging info'
+      assert page.has_text?('Describe the problem'), 'No text - Describe the problem'
+      assert page.has_text?('Send problem report'), 'Send problem report button text is not found'
+      assert page.has_no_button?('Send problem report'), 'Send problem report button is not disabled before entering problem description'
+      assert page.has_button?('Cancel'), 'No button - Cancel'
+
+      # enter a report text and click on report
+      page.find_field('report_issue_text').set 'my test report text'
+      assert page.has_button?('Send problem report'), 'Send problem report button not enabled after entering text'
+      click_button 'Send problem report'
+
+      # ajax success updated button texts and added footer message
+      assert page.has_no_text?('Send problem report'), 'Found button - Send problem report'
+      assert page.has_no_button?('Cancel'), 'Found button - Cancel'
+      assert page.has_text?('Report sent'), 'No text - Report sent'
+      assert page.has_button?('Close'), 'No text - Close'
+      assert page.has_text?('Thanks for reporting this issue'), 'No text - Thanks for reporting this issue'
+
+      click_button 'Close'
+    end
 
-      within('.navbar-fixed-top') do
-        # search again for the anonymously accessible project
-        page.find_field('search this site').set publicly_accessible_project['name'][0,10]
-        page.find('.glyphicon-search').click
-      end
+    # let's search for the anonymously accessible project
+    publicly_accessible_project = api_fixture('groups')['anonymously_accessible_project']
 
-      within '.modal-content' do
-        assert page.has_text?('All projects'), 'No text - All projects'
-        assert page.has_text?('Search'), 'No text - Search'
-        assert page.has_text?('Cancel'), 'No text - Cancel'
-        assert_selector('div', text: publicly_accessible_project['name'])
-        find(:xpath, '//div[./span[contains(.,publicly_accessible_project["uuid"])]]').click
+    within('.navbar-fixed-top') do
+      # search again for the anonymously accessible project
+      page.find_field('search this site').set publicly_accessible_project['name'][0,10]
+      page.find('.glyphicon-search').click
+    end
 
-        click_button 'Show'
-      end
+    within '.modal-content' do
+      assert page.has_text?('All projects'), 'No text - All projects'
+      assert page.has_text?('Search'), 'No text - Search'
+      assert page.has_text?('Cancel'), 'No text - Cancel'
+      assert_selector('div', text: publicly_accessible_project['name'])
+      find(:xpath, '//div[./span[contains(.,publicly_accessible_project["uuid"])]]').click
 
-      # seeing "Unrestricted public data" now
-      assert page.has_text?(publicly_accessible_project['name']), 'No text - publicly accessible project name'
-      assert page.has_text?(publicly_accessible_project['description']), 'No text - publicly accessible project description'
-    else
-      within('.navbar-fixed-top') do
-        page.has_no_field?('search this site')
-      end
+      click_button 'Show'
     end
+
+    # seeing "Unrestricted public data" now
+    assert page.has_text?(publicly_accessible_project['name']), 'No text - publicly accessible project name'
+    assert page.has_text?(publicly_accessible_project['description']), 'No text - publicly accessible project description'
   end
 
   [
@@ -99,7 +100,6 @@ class SearchBoxTest < ActionDispatch::IntegrationTest
 
     test "test search box for user #{token}" do
       visit page_with_token(token)
-
       verify_search_box user
     end
 

commit eb014f2d48be8039186eac3d47102bfe2f4b1f1d
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date:   Wed Nov 20 19:25:47 2019 -0300

    15848: Adds test that proves the default ordering is working on the RailsAPI.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>

diff --git a/services/api/test/integration/collections_api_test.rb b/services/api/test/integration/collections_api_test.rb
index 86195fba7..9ed978b71 100644
--- a/services/api/test/integration/collections_api_test.rb
+++ b/services/api/test/integration/collections_api_test.rb
@@ -15,6 +15,31 @@ class CollectionsApiTest < ActionDispatch::IntegrationTest
     assert_equal "arvados#collectionList", json_response['kind']
   end
 
+  test "should get index ordered by 'modified_at desc' by default" do
+    get "/arvados/v1/collections",
+      params: {:format => :json},
+      headers: auth(:active)
+    assert_response :success
+    modified_at_dates = json_response['items'].collect{ |x| DateTime.parse(x['modified_at']) }
+    assert modified_at_dates.first > modified_at_dates.last
+    assert_equal modified_at_dates, modified_at_dates.sort{|a, b| b <=> a}
+    oldest = json_response['items'].last
+
+    # Update oldest collection and re-request index
+    put "/arvados/v1/collections/#{oldest['uuid']}",
+      params: {
+        format: :json,
+        collection: { name: "a name" }
+      },
+      headers: auth(:admin)
+    assert_response :success
+    get "/arvados/v1/collections",
+      params: {:format => :json},
+      headers: auth(:active)
+    assert_response :success
+    assert_equal oldest['uuid'], json_response['items'].first['uuid']
+  end
+
   test "get index with filters= (empty string)" do
     get "/arvados/v1/collections",
       params: {:format => :json, :filters => ''},

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list