saucelabs-adapter 0.8.11 → 0.8.12

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.11
1
+ 0.8.12
@@ -1,4 +1,9 @@
1
+ common: &common
2
+ # Try to kill mongrel after suite if tmp/pids/mongrel_selenium.pid exists
3
+ # kill_mongrel_after_suite: true
4
+
1
5
  local: &local
6
+ <<: *common
2
7
  selenium_server_address: "127.0.0.1"
3
8
  selenium_server_port: "4444"
4
9
  selenium_browser_key: "*chrome /Applications/Firefox.app/Contents/MacOS/firefox-bin"
@@ -21,6 +26,7 @@ local_jsunit:
21
26
  # "googlechrome" ""
22
27
  # "Linux" "firefox" "3."
23
28
  saucelabs: &saucelabs
29
+ <<: *common
24
30
  test_framework: webrat
25
31
  # URL of Selenium RC server:
26
32
  selenium_server_address: "saucelabs.com"
@@ -23,7 +23,7 @@ module SaucelabsAdapter
23
23
  :saucelabs_max_duration_seconds,
24
24
  :tunnel_method, :tunnel_to_localhost_port, :tunnel_startup_timeout,
25
25
  :tunnel_username, :tunnel_password, :tunnel_keyfile,
26
- :jsunit_polling_interval_seconds ].each do |attr|
26
+ :jsunit_polling_interval_seconds, :kill_mongrel_after_suite ].each do |attr|
27
27
  define_method(attr) do
28
28
  @configuration[attr.to_s]
29
29
  end
@@ -97,6 +97,11 @@ module SaucelabsAdapter
97
97
  !tunnel_method.nil? && tunnel_method.to_sym != :othertunnel
98
98
  end
99
99
 
100
+ def kill_mongrel_after_suite?
101
+ return true if kill_mongrel_after_suite.nil?
102
+ kill_mongrel_after_suite.to_s == 'true'
103
+ end
104
+
100
105
  def self.parse_yaml(selenium_yml_path)
101
106
  raise "[saucelabs-adapter] could not open #{selenium_yml_path}" unless File.exist?(selenium_yml_path)
102
107
  file_contents = File.open(selenium_yml_path).read
@@ -24,6 +24,7 @@ if defined?(Test::Unit::UI::Console::TestRunner)
24
24
  puts "[saucelabs-adapter] Inserting Test::Unit::UI::Console::TestRunner attach_to_mediator tunnel start hook" if ENV['SAUCELABS_ADAPTER_DEBUG']
25
25
 
26
26
  class Test::Unit::UI::Console::TestRunner
27
+ include SaucelabsAdapter::Utilities
27
28
 
28
29
  private
29
30
 
@@ -34,6 +35,9 @@ if defined?(Test::Unit::UI::Console::TestRunner)
34
35
  @mediator.add_listener(Test::Unit::UI::TestRunnerMediator::STARTED, &method(:setup_tunnel))
35
36
  @mediator.add_listener(Test::Unit::UI::TestRunnerMediator::FINISHED, &method(:teardown_tunnel))
36
37
  end
38
+ if @selenium_config.kill_mongrel_after_suite?
39
+ @mediator.add_listener(Test::Unit::UI::TestRunnerMediator::FINISHED, &method(:kill_mongrel_if_needed))
40
+ end
37
41
  end
38
42
 
39
43
  alias_method_chain :attach_to_mediator, :sauce_tunnel unless private_method_defined?(:attach_to_mediator_without_sauce_tunnel)
@@ -46,5 +50,17 @@ if defined?(Test::Unit::UI::Console::TestRunner)
46
50
  def teardown_tunnel(suite_name)
47
51
  @tunnel.shutdown
48
52
  end
53
+
54
+ def kill_mongrel_if_needed(suite_name)
55
+ mongrel_pid_file = File.join(RAILS_ROOT, "tmp", "pids", "mongrel_selenium.pid")
56
+ if File.exists?(mongrel_pid_file)
57
+ pid = File.read(mongrel_pid_file).to_i
58
+ say "Killing mongrel at #{pid}"
59
+ Process.kill("KILL", pid)
60
+ end
61
+ if File.exists?(mongrel_pid_file)
62
+ FileUtils.rm(mongrel_pid_file)
63
+ end
64
+ end
49
65
  end
50
66
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: saucelabs-adapter
3
3
  version: !ruby/object:Gem::Version
4
- hash: 41
4
+ hash: 39
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 8
9
- - 11
10
- version: 0.8.11
9
+ - 12
10
+ version: 0.8.12
11
11
  platform: ruby
12
12
  authors:
13
13
  - Kelly Felkins, Chad Woolley, Sam Pierson, Nate Clark
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-06-22 00:00:00 -07:00
18
+ date: 2010-06-23 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -32,8 +32,8 @@ dependencies:
32
32
  version: 1.2.0
33
33
  type: :runtime
34
34
  name: rest-client
35
- prerelease: false
36
35
  version_requirements: *id001
36
+ prerelease: false
37
37
  - !ruby/object:Gem::Dependency
38
38
  requirement: &id002 !ruby/object:Gem::Requirement
39
39
  none: false
@@ -48,8 +48,8 @@ dependencies:
48
48
  version: 2.0.12
49
49
  type: :runtime
50
50
  name: net-ssh
51
- prerelease: false
52
51
  version_requirements: *id002
52
+ prerelease: false
53
53
  - !ruby/object:Gem::Dependency
54
54
  requirement: &id003 !ruby/object:Gem::Requirement
55
55
  none: false
@@ -64,8 +64,8 @@ dependencies:
64
64
  version: 1.0.1
65
65
  type: :runtime
66
66
  name: net-ssh-gateway
67
- prerelease: false
68
67
  version_requirements: *id003
68
+ prerelease: false
69
69
  - !ruby/object:Gem::Dependency
70
70
  requirement: &id004 !ruby/object:Gem::Requirement
71
71
  none: false
@@ -80,8 +80,8 @@ dependencies:
80
80
  version: 1.2.17
81
81
  type: :runtime
82
82
  name: selenium-client
83
- prerelease: false
84
83
  version_requirements: *id004
84
+ prerelease: false
85
85
  - !ruby/object:Gem::Dependency
86
86
  requirement: &id005 !ruby/object:Gem::Requirement
87
87
  none: false
@@ -96,8 +96,8 @@ dependencies:
96
96
  version: 0.3.0
97
97
  type: :runtime
98
98
  name: lsof
99
- prerelease: false
100
99
  version_requirements: *id005
100
+ prerelease: false
101
101
  description: "This gem augments Test::Unit and Polonium/Webrat to run Selenium tests in the cloud. "
102
102
  email: pair+kelly+sam@pivotallabs.com
103
103
  executables: []