saucelabs-adapter 0.8.7 → 0.8.8

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,7 +1,6 @@
1
1
  require 'rubygems'
2
2
  require 'rake'
3
3
 
4
- require 'rake'
5
4
  require 'spec'
6
5
  require 'spec/rake/spectask'
7
6
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.7
1
+ 0.8.8
@@ -86,8 +86,8 @@ module SaucelabsAdapter
86
86
 
87
87
  def create_driver(selenium_args = {})
88
88
  args = selenium_client_driver_args.merge(selenium_args)
89
- debug "Connecting to Selenium RC server at #{args[:host]}:#{args[:port]} (testing app at #{args[:url]})"
90
- debug "args = #{args.inspect}"
89
+ say "Connecting to Selenium RC server at #{args[:host]}:#{args[:port]} (testing app at #{args[:url]})"
90
+ say "args = #{display_safely(args)}"
91
91
  driver = ::Selenium::Client::Driver.new(args)
92
92
  debug "done"
93
93
  driver
@@ -104,6 +104,14 @@ module SaucelabsAdapter
104
104
 
105
105
  private
106
106
 
107
+ def display_safely(selenium_args)
108
+ safe = selenium_args.dup
109
+ safe[:browser] = JSON.parse( safe[:browser])
110
+ safe[:browser]['access-key'] = safe[:browser]['access-key'][0..4] + '...'
111
+ safe[:browser] = safe[:browser].to_json
112
+ safe.inspect
113
+ end
114
+
107
115
  def build_configuration(configuration_name)
108
116
  @configuration = @@selenium_configs[configuration_name]
109
117
  raise "[saucelabs-adapter] stanza '#{configuration_name}' not found in #{@selenium_yml}" unless @configuration
@@ -2,6 +2,8 @@ require 'net/ssh'
2
2
  require 'net/ssh/gateway'
3
3
  require 'saucerest-ruby/saucerest'
4
4
  require 'saucerest-ruby/gateway'
5
+ require 'saucelabs_adapter/run_utils'
6
+
5
7
 
6
8
  module SaucelabsAdapter
7
9
  class SauceTunnel < Tunnel
@@ -95,6 +97,7 @@ module SaucelabsAdapter
95
97
 
96
98
  def setup_ssh_reverse_tunnel
97
99
  debug "Starting ssh reverse tunnel"
100
+ RunUtils.run("sed -i.backup -e '/#{Regexp.escape(@tunnel_info['Host'])}/d' #{ENV['HOME']}/.ssh/known_hosts", :raise_on_fail => false)
98
101
  @gateway = Net::SSH::Gateway.new(@tunnel_info['Host'], @se_config.saucelabs_username, {:password => @se_config.saucelabs_access_key})
99
102
  @port = @gateway.open_remote(@se_config.tunnel_to_localhost_port.to_i, "127.0.0.1", @se_config.application_port.to_i, "0.0.0.0")
100
103
  end
@@ -1,9 +1,9 @@
1
- require 'rubygems'
2
- require 'active_support'
1
+ require File.join(File.dirname(__FILE__), 'spec_helper')
3
2
  # Don't pull in the entire saucelabs-adapter otherwise it will complain about: undefined method `setup' for ActiveSupport::TestCase:Class
4
3
  # Apparently this is added from outside
5
4
  require 'saucelabs_adapter/utilities'
6
5
  require 'saucelabs_adapter/selenium_config'
6
+ require 'json'
7
7
 
8
8
  SELENIUM_YML_FIXTURE_FILE = File.join(File.dirname(__FILE__), 'fixtures', 'selenium.yml')
9
9
 
@@ -103,6 +103,20 @@ describe "SeleniumConfig" do
103
103
  it "should contain a job_name of our hostname" do
104
104
  @browser_data['job-name'].should == Socket.gethostname
105
105
  end
106
+
107
+ describe "#display_safely" do
108
+ it "should mask all but the first 5 characters of :browser=>access-key" do
109
+ private_key = "abcdefgh-ijkl-mnop-qrst-uvwxyz0123456"
110
+ @browser_data['otherkey'] = 'foo'
111
+ @browser_data['access-key'] = private_key
112
+ hash_with_browser_json = {:browser => @browser_data.to_json}
113
+ display_string = @selenium_config.send(:display_safely, hash_with_browser_json)
114
+
115
+ display_string.should match(/access-key.*:.*abcde\.\.\./)
116
+ display_string.should_not match(/"#{private_key}/)
117
+ display_string.should match(/otherkey.*:.*foo/)
118
+ end
119
+ end
106
120
  end
107
121
 
108
122
  describe "#configure_polonium" do
@@ -0,0 +1,5 @@
1
+ require 'rubygems'
2
+ require 'active_support'
3
+ require 'spec'
4
+ require "spec/autorun"
5
+ $:.unshift(File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib')))
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 8
8
- - 7
9
- version: 0.8.7
8
+ - 8
9
+ version: 0.8.8
10
10
  platform: ruby
11
11
  authors:
12
12
  - Kelly Felkins, Chad Woolley, Sam Pierson, Nate Clark
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-05-05 00:00:00 -07:00
17
+ date: 2010-06-15 00:00:00 -06:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -151,5 +151,6 @@ specification_version: 3
151
151
  summary: Adapter for running Selenium tests using SauceLabs.com
152
152
  test_files:
153
153
  - spec/selenium_config_spec.rb
154
+ - spec/spec_helper.rb
154
155
  - test/helper.rb
155
156
  - test/test_saucelabs-adapter.rb