X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/bd6b334c80cea328a51a8612d40ef16bdd6ab2e2..8a0e9c549595e114a0eadc9d6792a17fb59d0f3e:/services/api/test/integration/collections_performance_test.rb diff --git a/services/api/test/integration/collections_performance_test.rb b/services/api/test/integration/collections_performance_test.rb index f6f39fe526..b925fbf77e 100644 --- a/services/api/test/integration/collections_performance_test.rb +++ b/services/api/test/integration/collections_performance_test.rb @@ -1,3 +1,8 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + +require 'safe_json' require 'test_helper' require 'helpers/manifest_examples' require 'helpers/time_block' @@ -14,27 +19,33 @@ class CollectionsApiPerformanceTest < ActionDispatch::IntegrationTest api_token: api_token(:active)) end json = time_block "JSON encode #{bigmanifest.length>>20}MiB manifest" do - Oj.dump({"manifest_text" => bigmanifest}) + SafeJSON.dump({"manifest_text" => bigmanifest}) end time_block 'create' do - post '/arvados/v1/collections', {collection: json}, auth(:active) + post '/arvados/v1/collections', + params: {collection: json}, + headers: auth(:active) assert_response :success end uuid = json_response['uuid'] time_block 'read' do - get '/arvados/v1/collections/' + uuid, {}, auth(:active) + get '/arvados/v1/collections/' + uuid, params: {}, headers: auth(:active) assert_response :success end time_block 'list' do - get '/arvados/v1/collections', {select: ['manifest_text'], filters: [['uuid', '=', uuid]].to_json}, auth(:active) + get '/arvados/v1/collections', + params: {select: ['manifest_text'], filters: [['uuid', '=', uuid]].to_json}, + headers: auth(:active) assert_response :success end time_block 'update' do - put '/arvados/v1/collections/' + uuid, {collection: json}, auth(:active) + put '/arvados/v1/collections/' + uuid, + params: {collection: json}, + headers: auth(:active) assert_response :success end time_block 'delete' do - delete '/arvados/v1/collections/' + uuid, {}, auth(:active) + delete '/arvados/v1/collections/' + uuid, params: {}, headers: auth(:active) end end @@ -45,10 +56,12 @@ class CollectionsApiPerformanceTest < ActionDispatch::IntegrationTest bytes_per_block: 2**26, api_token: api_token(:active)) json = time_block "JSON encode #{hugemanifest.length>>20}MiB manifest" do - Oj.dump({manifest_text: hugemanifest}) + SafeJSON.dump({manifest_text: hugemanifest}) end vmpeak "post" do - post '/arvados/v1/collections', {collection: json}, auth(:active) + post '/arvados/v1/collections', + params: {collection: json}, + headers: auth(:active) end end end