1 require 'integration_helper'
3 # Performance test can run in two 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=test/performance/*.rb
11 class WorkbenchPerformanceTest < ActionDispatch::PerformanceTest
13 # When running in "RAILS_ENV=performance" mode, uses performance config params.
14 # In this mode, prepends workbench URL to the given path provided,
15 # and visits that page using the configured "user_token".
16 def visit_page_with_token path='/'
17 if ENV["RAILS_ENV"].eql? 'performance'
18 token = Rails.configuration.user_token
19 workbench_url = Rails.configuration.arvados_workbench_url
20 if workbench_url.end_with? '/'
21 workbench_url = workbench_url[0, workbench_url.size-1]
28 visit page_with_token(token, (workbench_url + path))
31 # We do not want to reset the database fixtures in "RAILS_ENV=performance" mode.
33 def self.reset_api_fixtures_now