2 require 'helpers/manifest_examples'
3 require 'helpers/time_block'
5 class CollectionsApiPerformanceTest < ActionDispatch::IntegrationTest
6 include ManifestExamples
8 test "crud cycle for a collection with a big manifest" do
9 bigmanifest = time_block 'make example' do
10 make_manifest(streams: 100,
11 files_per_stream: 100,
13 bytes_per_block: 2**26,
14 api_token: api_token(:active))
16 json = time_block "JSON encode #{bigmanifest.length>>20}MiB manifest" do
17 Oj.dump({manifest_text: bigmanifest})
19 time_block 'create' do
20 post '/arvados/v1/collections', {collection: json}, auth(:active)
21 assert_response :success
23 uuid = json_response['uuid']
25 get '/arvados/v1/collections/' + uuid, {}, auth(:active)
26 assert_response :success
29 get '/arvados/v1/collections', {select: ['manifest_text'], filters: [['uuid', '=', uuid]].to_json}, auth(:active)
30 assert_response :success
32 time_block 'update' do
33 put '/arvados/v1/collections/' + uuid, {collection: json}, auth(:active)
34 assert_response :success
36 time_block 'delete' do
37 delete '/arvados/v1/collections/' + uuid, {}, auth(:active)