diff --git a/config/environments/test.rb b/config/environments/test.rb index 0a38fd3..cdb2621 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -43,4 +43,9 @@ # Raises error for missing translations # config.action_view.raise_on_missing_translations = true + config.action_dispatch.show_exceptions = false end + +Rails.logger = Logger.new('/dev/null') + +STDERR.reopen('/dev/null') diff --git a/spec/support/fast_helper.rb b/spec/support/fast_helper.rb index 10350cb..951c8aa 100644 --- a/spec/support/fast_helper.rb +++ b/spec/support/fast_helper.rb @@ -32,7 +32,7 @@ def stop_test_record end def current_test_run - url = "https://api.wallarm.com/v1/test_run/#{@test_run_id}" + url = "https://#{ENV['WALLARM_API_HOST']}/v1/test_run/#{@test_run_id}" response = RestClient.get url, auth_headers resp_body = JSON.parse(response.body)['body'] @@ -44,21 +44,31 @@ def wait_test_run_for_finish test_run = current_test_run + link = frontend_url + '/testing/testruns/' + @test_run_id.to_s + puts case current_test_run['state'] when 'failed' - puts 'FAST tests are failed'.red + puts "FAST tests have failed #{link}".red exit 1 when 'interrupted' - puts 'FAST tests are interrupted'.red + puts "FAST tests have been interrupted #{link}".red exit 1 when 'passed' - puts 'FAST tests are passed'.green + puts "FAST tests have passed #{link}".green end end private + def frontend_url + url = "https://#{ENV['WALLARM_API_HOST']}/v1/user" + + response = RestClient.post url, {}, auth_headers + + JSON.parse(response.body)['body']['frontend_url'] + end + def auth_headers { 'X-WallarmApi-Token' => ENV['WALLARM_API_TOKEN']