Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send scenario name and git branch to saucelabs #26063

Merged
merged 1 commit into from
Nov 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 8 additions & 7 deletions dashboard/test/ui/features/support/connect.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def slow_browser?
['iPhone', 'iPad'].include? ENV['BROWSER_CONFIG']
end

def saucelabs_browser
def saucelabs_browser(test_run_name)
if CDO.saucelabs_username.blank?
raise "Please define CDO.saucelabs_username"
end
Expand All @@ -36,7 +36,8 @@ def saucelabs_browser

capabilities[:javascript_enabled] = 'true'
capabilities[:tunnelIdentifier] = CDO.circle_run_identifier if CDO.circle_run_identifier
capabilities[:name] = ENV['TEST_RUN_NAME']
capabilities[:name] = test_run_name
capabilities[:tags] = [ENV['GIT_BRANCH']]
capabilities[:build] = CDO.circle_run_identifier || ENV['BUILD']
capabilities[:idleTimeout] = 600

Expand Down Expand Up @@ -81,27 +82,27 @@ def saucelabs_browser
browser
end

def get_browser
def get_browser(test_run_name)
if ENV['TEST_LOCAL'] == 'true'
# This drives a local installation of ChromeDriver running on port 9515, instead of Saucelabs.
SeleniumBrowser.local_browser
else
saucelabs_browser
saucelabs_browser test_run_name
end
end

browser = nil

Before do
Before do |scenario|
puts "DEBUG: @browser == #{CGI.escapeHTML @browser.inspect}"

if slow_browser?
browser ||= get_browser
browser ||= get_browser ENV['TEST_RUN_NAME']
p 'slow browser, using existing'
@browser ||= browser
else
p 'fast browser, getting a new one'
@browser = get_browser
@browser = get_browser "#{ENV['TEST_RUN_NAME']}_#{scenario.name}"
end
@browser.manage.delete_all_cookies

Expand Down
1 change: 1 addition & 0 deletions dashboard/test/ui/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def main(options)
$failed_features = 0

start_time = Time.now
ENV['GIT_BRANCH'] = GIT_BRANCH
ENV['BATCH_NAME'] = "#{GIT_BRANCH} | #{start_time}"

open_log_files
Expand Down