2 require 'helpers/manifest_examples'
3 require 'helpers/time_block'
8 class BigCollectionTest < ActiveSupport::TestCase
9 include ManifestExamples
12 Blob.stubs(:sign_locator).returns 'd41d8cd98f00b204e9800998ecf8427e+0'
16 Thread.current[:arvados_api_client] = nil
19 # You can try with compress=false here too, but at last check it
20 # didn't make a significant difference.
21 [true].each do |compress|
22 test "crud cycle for collection with big manifest (compress=#{compress})" do
23 Rails.configuration.api_response_compression = compress
24 Thread.current[:arvados_api_client] = nil
31 bigmanifest = time_block 'build example' do
32 make_manifest(streams: 100,
33 files_per_stream: 100,
37 c = time_block "new (manifest size = #{bigmanifest.length>>20}MiB)" do
38 Collection.new manifest_text: bigmanifest
40 time_block 'create' do
44 Collection.find c.uuid
46 time_block 'read(cached)' do
47 Collection.find c.uuid
50 list = Collection.select(['uuid', 'manifest_text']).filter [['uuid','=',c.uuid]]
51 assert_equal 1, list.count
52 assert_equal c.uuid, list.first.uuid
53 assert_not_nil list.first.manifest_text
55 time_block 'update(name-only)' do
56 manifest_text_length = c.manifest_text.length
57 c.update_attributes name: 'renamed during test case'
58 assert_equal c.manifest_text.length, manifest_text_length
60 time_block 'update' do
61 c.manifest_text += ". d41d8cd98f00b204e9800998ecf8427e+0 0:0:empty.txt\n"
64 time_block 'delete' do
67 time_block 'read(404)' do
68 assert_empty Collection.filter([['uuid','=',c.uuid]])