This repository has been archived by the owner on Mar 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Working Saucelabs implementation using SauceTunnel
- Loading branch information
David Goudreau & Sam Pierson
committed
Jan 8, 2010
1 parent
36ba087
commit 85ddff0
Showing
3 changed files
with
98 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env ruby | ||
|
||
require 'rubygems' | ||
require 'saucelabs-adapter' | ||
|
||
STDOUT.sync = true | ||
|
||
case ARGV.size | ||
when 1: | ||
@tunnel_id = ARGV[0] | ||
else | ||
puts "Usage: sauce-tunnel-delete.rb <tunnel_id>" | ||
exit 1 | ||
end | ||
|
||
def connect_to_rest_api | ||
sauce_api_url = "https://#{@selenium_config['username']}:#{@selenium_config['access-key']}@saucelabs.com/rest/#{@selenium_config['username']}/" | ||
# puts "[saucelabs-adapter] Connecting to Sauce API at #{sauce_api_url}" | ||
@sauce_api_endpoint = SauceREST::Client.new sauce_api_url | ||
end | ||
|
||
@selenium_config = SeleniumConfig.new('saucelabs', '../selenium.yml', 8080) | ||
connect_to_rest_api | ||
@sauce_api_endpoint.delete :tunnel, @tunnel_id | ||
|
||
exit 0 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env ruby | ||
|
||
require 'rubygems' | ||
require 'saucelabs-adapter' | ||
|
||
STDOUT.sync = true | ||
|
||
def start_tunnel | ||
puts "[sauce-tunnel] Starting tunnel" | ||
@tunnel = SauceTunnel.new(@selenium_config) | ||
end | ||
|
||
def stop_tunnel | ||
puts "[sauce-tunnel] Shutting down tunnel" | ||
@tunnel.shutdown | ||
exit 0 | ||
end | ||
|
||
Signal.trap('INT') { stop_tunnel } | ||
Signal.trap('TERM') { stop_tunnel } | ||
Signal.trap('HUP') { stop_tunnel } | ||
|
||
@selenium_config = SeleniumConfig.new('saucelabs', '../selenium.yml', 8080) | ||
|
||
start_tunnel | ||
sleep 3600 | ||
stop_tunnel | ||
|
||
exit 1 |