1 require 'integration_helper'
3 # The tests in the "integration_performance" dir are not included in regular
4 # build pipeline since it is not one of the "standard" test directories.
6 # To run tests in this directory use the following command:
7 # ./run-tests.sh WORKSPACE=~/arvados --only apps/workbench apps/workbench_test="TEST=test/integration_performance/*.rb"
10 class CollectionsPerfTest < ActionDispatch::IntegrationTest
12 Capybara.current_driver = :rack_test
15 def create_large_collection size, file_name_prefix
16 manifest_text = ". d41d8cd98f00b204e9800998ecf8427e+0"
19 until manifest_text.length > size do
20 manifest_text << " 0:0:#{file_name_prefix}#{i.to_s}"
25 Collection.create! ({manifest_text: manifest_text})
33 test "Create and show large collection with manifest text of #{size}" do
35 new_collection = create_large_collection size, 'collection_file_name_with_prefix_'
37 visit page_with_token('active', "/collections/#{new_collection.uuid}")
39 assert_text new_collection.uuid
40 assert(page.has_link?('collection_file_name_with_prefix_0'), "Collection page did not include file link")
44 # This does not work with larger sizes because of need_javascript.
45 # Just use one test with 100,000 for now.
49 test "Create, show, and update description for large collection with manifest text of #{size}" do
53 new_collection = create_large_collection size, 'collection_file_name_with_prefix_'
55 visit page_with_token('active', "/collections/#{new_collection.uuid}")
57 assert_text new_collection.uuid
58 assert(page.has_link?('collection_file_name_with_prefix_0'), "Collection page did not include file link")
61 within('.arv-description-as-subtitle') do
62 find('.fa-pencil').click
63 find('.editable-input textarea').set('description for this large collection')
64 find('.editable-submit').click
67 assert_text 'description for this large collection'
75 ].each do |size1, size2|
76 test "Create one large collection of #{size1} and one small collection of #{size2} and combine them" do
78 first_collection = create_large_collection size1, 'collection_file_name_with_prefix_1_'
79 second_collection = create_large_collection size2, 'collection_file_name_with_prefix_2_'
81 visit page_with_token('active', "/collections")
83 assert_text first_collection.uuid
84 assert_text second_collection.uuid
86 within('tr', text: first_collection['uuid']) do
87 find('input[type=checkbox]').click
90 within('tr', text: second_collection['uuid']) do
91 find('input[type=checkbox]').click
94 click_button 'Selection...'
95 within('.selection-action-container') do
96 click_link 'Create new collection with selected collections'
99 assert(page.has_link?('collection_file_name_with_prefix_1_0'), "Collection page did not include file link")