1 require 'integration_helper'
3 # Performance test can run in two different ways:
5 # 1. Similar to other integration tests using the command:
6 # RAILS_ENV=test bundle exec rake test:benchmark
8 # 2. Against a configured workbench url using "RAILS_ENV=performance".
9 # RAILS_ENV=performance bundle exec rake test:benchmark
11 class WorkbenchPerformanceTest < ActionDispatch::PerformanceTest
13 # When running in "RAILS_ENV=performance" mode, uses performance
14 # config params. In this mode, prepends workbench URL to the given
15 # path provided, and visits that page using the configured
17 def visit_page_with_token path='/'
18 if Rails.env == 'performance'
19 token = Rails.configuration.user_token
20 workbench_url = Rails.configuration.arvados_workbench_url
21 if workbench_url.end_with? '/'
22 workbench_url = workbench_url[0, workbench_url.size-1]
29 visit page_with_token(token, (workbench_url + path))