X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/011cdc12d3d3a664e8a8ef09bc0e7f5223afa6df..f7cc825b6a7a526a95e9f889ba94f4122f191889:/apps/workbench/test/test_helper.rb diff --git a/apps/workbench/test/test_helper.rb b/apps/workbench/test/test_helper.rb index 1e7b8eb245..7c454c9877 100644 --- a/apps/workbench/test/test_helper.rb +++ b/apps/workbench/test/test_helper.rb @@ -160,8 +160,10 @@ class ApiServerForTests '--pid-file', @pidfile) else make_ssl_cert - _system('bundle', 'exec', 'rake', 'db:test:load') - _system('bundle', 'exec', 'rake', 'db:fixtures:load') + if ENV['ARVADOS_TEST_API_INSTALLED'].blank? + _system('bundle', 'exec', 'rake', 'db:test:load') + _system('bundle', 'exec', 'rake', 'db:fixtures:load') + end _system('bundle', 'exec', 'passenger', 'start', '-d', '-p3000', '--pid-file', @pidfile, '--ssl', @@ -267,6 +269,10 @@ class ActiveSupport::TestCase protected def self.reset_api_fixtures_now + # Never try to reset fixtures when we're just using test + # infrastructure to run performance/diagnostics suites. + return unless Rails.env == 'test' + auth = api_fixture('api_client_authorizations')['admin_trustedclient'] Thread.current[:arvados_api_token] = auth['api_token'] ArvadosApiClient.new.api(nil, '../../database/reset', {}) @@ -307,3 +313,6 @@ if ENV["RAILS_ENV"].eql? 'test' ApiServerForTests.new.run ApiServerForTests.new.run ["--websockets"] end + +# Reset fixtures now (i.e., before any tests run). +ActiveSupport::TestCase.reset_api_fixtures_now