1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
5 require 'integration_helper'
7 # Performance test can run in two different ways:
9 # 1. Similar to other integration tests using the command:
10 # RAILS_ENV=test bundle exec rake test:benchmark
12 # 2. Against a configured workbench url using "RAILS_ENV=performance".
13 # RAILS_ENV=performance bundle exec rake test:benchmark
15 class WorkbenchPerformanceTest < ActionDispatch::PerformanceTest
17 # When running in "RAILS_ENV=performance" mode, uses performance
18 # config params. In this mode, prepends workbench URL to the given
19 # path provided, and visits that page using the configured
21 def visit_page_with_token path='/'
22 if Rails.env == 'performance'
23 token = Rails.configuration.user_token
24 workbench_url = Rails.configuration.arvados_workbench_url
25 if workbench_url.end_with? '/'
26 workbench_url = workbench_url[0, workbench_url.size-1]
33 visit page_with_token(token, (workbench_url + path))