sauce 3.4.2 → 3.4.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZDU5ODZiYzVmMjMxMWFhMDUyOWIyNDEyMGU1OTIzMmRjNDE5MmIyMw==
5
- data.tar.gz: !binary |-
6
- YjA1OTMzZjg1NzFlNjI4MzM1MWQ0MmVjNjhiMTM5NTJiZmM2MGNlZQ==
2
+ SHA1:
3
+ metadata.gz: 82709ffd28a9f8de7af48b684fc7daecab419853
4
+ data.tar.gz: a8e0bbf819adc32e8521246a3dacbded39df5cfb
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- YjUxZDJkMDI4Nzk0ZDRmZTZiN2M2OWM2NzYyYThhMzFhYzdiZDk2ZmUyOWZl
10
- YTU2MGNjMjNhNTA0ZDAxY2YxNDcxZDJlYzM3OWNlM2Q1ODg1ZjM5NzQwNDA1
11
- YzYyODkzYWEyMmRkYTA0YTM2MjAwMTA0ZDcxZThjZTFhMGY2NGM=
12
- data.tar.gz: !binary |-
13
- NWM2ZWU3YjViNDZlNzMxN2I4MzcyYzkzNmM1YjlhMTg4MzEwMDU5OGYxYTNk
14
- YmYwMDUxYTdjODJlZGJhMWUyYjM1MTk2OTBlMjczYjBiNGNkYjk3ZWJlZTVl
15
- YjA3Zjk0NjhmOTcxMmEyODQ5MDU2MjJmMjM3NzhlMGI3YTY1YjE=
6
+ metadata.gz: 2c8411663dd30c154871b8c408f0f16b308c3a9548800a15843a393dfd1c91b2da693a122bd5bfe41e368322a2098a438197164206821d55ed73e5cf81fd867d
7
+ data.tar.gz: ad1b0ae40cb57c5b2b0a17bc199a39d7d2f4acc9a2261a1caecd79f7a07ab5d17555043557b22c5634cfd26c032ca6714d73f834a305795fd1ab351fb40c3c5a
data/lib/sauce/config.rb CHANGED
@@ -67,7 +67,7 @@ module Sauce
67
67
  sauce-advisor single-window user-extensions-url firefox-profile-url
68
68
  max-duration idle-timeout build custom-data tunnel-identifier
69
69
  selenium-version command-timeout prerun prerun-args screen-resolution
70
- disable-popup-handler avoid-proxy public name}
70
+ disable-popup-handler avoid-proxy public name iedriver-version}
71
71
 
72
72
  def self.get_application_port
73
73
  port_index = ENV["TEST_ENV_NUMBER"].to_i
@@ -269,6 +269,18 @@ module Sauce
269
269
  @opts[:port]
270
270
  end
271
271
 
272
+ def after_job(hook, &block)
273
+ hooks = @opts[:after_job_hooks] || {}
274
+ hooks[hook] = block
275
+ @opts[:after_job_hooks] = hooks
276
+ end
277
+
278
+ def run_post_job_hooks(job_id, job_name, job_success)
279
+ @opts[:after_job_hooks].each do |key, hook|
280
+ hook.call job_id, job_name, job_success
281
+ end
282
+ end
283
+
272
284
  def tools
273
285
  tools = []
274
286
  tools << "Rspec" if is_defined? "RSpec"
@@ -349,6 +361,8 @@ module Sauce
349
361
 
350
362
  on_demand = hash.delete "SAUCE_ONDEMAND_BROWSERS"
351
363
  env_browsers = hash.delete "SAUCE_BROWSERS"
364
+ username = hash.delete("SAUCE_USERNAME") || hash.delete("SAUCE_USER_NAME")
365
+ access_key = hash.delete("SAUCE_ACCESS_KEY") || hash.delete("SAUCE_API_KEY")
352
366
 
353
367
  hash.select {|k,v| k.start_with? "SAUCE_"}.each do |k,v|
354
368
  opts[k.downcase.sub("sauce_", "").to_sym] = v
@@ -378,6 +392,9 @@ module Sauce
378
392
  opts[:perfile_browsers] = JSON.parse(hash['SAUCE_PERFILE_BROWSERS'])
379
393
  end
380
394
 
395
+ opts[:username] = username if username
396
+ opts[:access_key] = access_key if access_key
397
+
381
398
  return opts.delete_if {|key, value| value.nil?}
382
399
  end
383
400
 
data/lib/sauce/rspec.rb CHANGED
@@ -86,7 +86,10 @@ begin
86
86
 
87
87
  ::RSpec.configuration.before :all do
88
88
  Sauce::RSpec.start_tools_for_selenium_directory
89
+ Sauce::RSpec.register_default_hook
90
+ Sauce::RSpec.register_jenkins_hook if ENV['JENKINS_SERVER_COOKIE']
89
91
  end
92
+
90
93
  ::RSpec.configuration.after :suite do
91
94
  Sauce::RSpec.stop_tools
92
95
  end
@@ -122,6 +125,22 @@ begin
122
125
  end
123
126
  end
124
127
  end
128
+
129
+ def self.register_default_hook
130
+ Sauce.config do |c|
131
+ c.after_job :rspec do |id, name, success|
132
+ SauceWhisk::Jobs.change_status id, success
133
+ end
134
+ end
135
+ end
136
+
137
+ def self.register_jenkins_hook
138
+ Sauce.config do |c|
139
+ c.after_job :jenkins do |id, name, success|
140
+ puts "SauceOnDemandSessionID=#{id} job-name=#{name}"
141
+ end
142
+ end
143
+ end
125
144
 
126
145
  def self.stop_tools
127
146
  Sauce::Utilities::Connect.close
@@ -175,9 +194,15 @@ begin
175
194
 
176
195
  begin
177
196
  the_test.run
178
- SauceWhisk::Jobs.change_status @selenium.session_id, example.exception.nil?
197
+ success = example.exception.nil?
179
198
  ensure
180
199
  @selenium.stop
200
+ begin
201
+ config.run_post_job_hooks(@selenium.session_id, description, success)
202
+ rescue Exception => e
203
+ STDERR.puts "Error running post job hooks"
204
+ STDERR.puts e
205
+ end
181
206
  Sauce.driver_pool.delete Thread.current.object_id
182
207
  end
183
208
  end
data/lib/sauce/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Sauce
2
2
  MAJOR_VERSION = '3.4'
3
- PATCH_VERSION = '2'
3
+ PATCH_VERSION = '3'
4
4
 
5
5
  def version
6
6
  "#{MAJOR_VERSION}.#{PATCH_VERSION}"
@@ -201,6 +201,14 @@ describe Sauce::Config do
201
201
 
202
202
  it { should have_key :'prerun'}
203
203
  end
204
+
205
+ context 'iedriver-version' do
206
+ subject do
207
+ Sauce::Config.new('iedriver-version' => '2.30.1').to_desired_capabilities
208
+ end
209
+
210
+ it { should have_key :'iedriver-version' }
211
+ end
204
212
  end
205
213
 
206
214
  context 'with a :name set' do
@@ -21,6 +21,29 @@ describe "Sauce::Config" do
21
21
  opts[:application_host].should eq "application_host"
22
22
  end
23
23
 
24
+ context "when passed the jenkins authentication parameters" do
25
+ let(:jenkins_options) {
26
+ {
27
+ "SAUCE_USER_NAME" => "jenkins_user",
28
+ "SAUCE_API_KEY" => "jenkins_access_key"
29
+ }
30
+ }
31
+
32
+ it "should parse the SAUCE_USER_NAME value" do
33
+ test_config
34
+ opts = test_config.send(:extract_options_from_hash, jenkins_options)
35
+
36
+ opts[:username].should eq "jenkins_user"
37
+ end
38
+
39
+ it "should parse the SAUCE_USER_NAME value" do
40
+ test_config
41
+ opts = test_config.send(:extract_options_from_hash, jenkins_options)
42
+
43
+ opts[:access_key].should eq "jenkins_access_key"
44
+ end
45
+ end
46
+
24
47
  context "when passed build numbers" do
25
48
  it "should accept BUILD_NUMBER" do
26
49
  opts = test_config.send(:extract_options_from_hash, {"BUILD_NUMBER" => "build"})
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sauce
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.2
4
+ version: 3.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dylan Lacey
@@ -14,202 +14,202 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2014-05-20 00:00:00.000000000 Z
17
+ date: 2014-06-18 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: rspec
21
21
  requirement: !ruby/object:Gem::Requirement
22
22
  requirements:
23
- - - ~>
23
+ - - "~>"
24
24
  - !ruby/object:Gem::Version
25
25
  version: 2.14.0
26
26
  type: :development
27
27
  prerelease: false
28
28
  version_requirements: !ruby/object:Gem::Requirement
29
29
  requirements:
30
- - - ~>
30
+ - - "~>"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.14.0
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: simplecov
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - ! '>='
37
+ - - ">="
38
38
  - !ruby/object:Gem::Version
39
39
  version: '0'
40
40
  type: :development
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - ! '>='
44
+ - - ">="
45
45
  - !ruby/object:Gem::Version
46
46
  version: '0'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: capybara
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - ! '>='
51
+ - - ">="
52
52
  - !ruby/object:Gem::Version
53
53
  version: 2.2.1
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - ! '>='
58
+ - - ">="
59
59
  - !ruby/object:Gem::Version
60
60
  version: 2.2.1
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: yard
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - ! '>='
65
+ - - ">="
66
66
  - !ruby/object:Gem::Version
67
67
  version: '0'
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - ! '>='
72
+ - - ">="
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0'
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: redcarpet
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - ! '>='
79
+ - - ">="
80
80
  - !ruby/object:Gem::Version
81
81
  version: '0'
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - ! '>='
86
+ - - ">="
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: net-http-persistent
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
- - - ! '>='
93
+ - - ">="
94
94
  - !ruby/object:Gem::Version
95
95
  version: '0'
96
96
  type: :runtime
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
- - - ! '>='
100
+ - - ">="
101
101
  - !ruby/object:Gem::Version
102
102
  version: '0'
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: rest-client
105
105
  requirement: !ruby/object:Gem::Requirement
106
106
  requirements:
107
- - - ! '>='
107
+ - - ">="
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
110
  type: :runtime
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
- - - ! '>='
114
+ - - ">="
115
115
  - !ruby/object:Gem::Version
116
116
  version: '0'
117
117
  - !ruby/object:Gem::Dependency
118
118
  name: net-ssh
119
119
  requirement: !ruby/object:Gem::Requirement
120
120
  requirements:
121
- - - ! '>='
121
+ - - ">="
122
122
  - !ruby/object:Gem::Version
123
123
  version: '0'
124
124
  type: :runtime
125
125
  prerelease: false
126
126
  version_requirements: !ruby/object:Gem::Requirement
127
127
  requirements:
128
- - - ! '>='
128
+ - - ">="
129
129
  - !ruby/object:Gem::Version
130
130
  version: '0'
131
131
  - !ruby/object:Gem::Dependency
132
132
  name: net-ssh-gateway
133
133
  requirement: !ruby/object:Gem::Requirement
134
134
  requirements:
135
- - - ! '>='
135
+ - - ">="
136
136
  - !ruby/object:Gem::Version
137
137
  version: '0'
138
138
  type: :runtime
139
139
  prerelease: false
140
140
  version_requirements: !ruby/object:Gem::Requirement
141
141
  requirements:
142
- - - ! '>='
142
+ - - ">="
143
143
  - !ruby/object:Gem::Version
144
144
  version: '0'
145
145
  - !ruby/object:Gem::Dependency
146
146
  name: selenium-webdriver
147
147
  requirement: !ruby/object:Gem::Requirement
148
148
  requirements:
149
- - - ! '>='
149
+ - - ">="
150
150
  - !ruby/object:Gem::Version
151
151
  version: 0.1.2
152
152
  type: :runtime
153
153
  prerelease: false
154
154
  version_requirements: !ruby/object:Gem::Requirement
155
155
  requirements:
156
- - - ! '>='
156
+ - - ">="
157
157
  - !ruby/object:Gem::Version
158
158
  version: 0.1.2
159
159
  - !ruby/object:Gem::Dependency
160
160
  name: childprocess
161
161
  requirement: !ruby/object:Gem::Requirement
162
162
  requirements:
163
- - - ! '>='
163
+ - - ">="
164
164
  - !ruby/object:Gem::Version
165
165
  version: 0.1.6
166
166
  type: :runtime
167
167
  prerelease: false
168
168
  version_requirements: !ruby/object:Gem::Requirement
169
169
  requirements:
170
- - - ! '>='
170
+ - - ">="
171
171
  - !ruby/object:Gem::Version
172
172
  version: 0.1.6
173
173
  - !ruby/object:Gem::Dependency
174
174
  name: json
175
175
  requirement: !ruby/object:Gem::Requirement
176
176
  requirements:
177
- - - ! '>='
177
+ - - ">="
178
178
  - !ruby/object:Gem::Version
179
179
  version: 1.2.0
180
180
  type: :runtime
181
181
  prerelease: false
182
182
  version_requirements: !ruby/object:Gem::Requirement
183
183
  requirements:
184
- - - ! '>='
184
+ - - ">="
185
185
  - !ruby/object:Gem::Version
186
186
  version: 1.2.0
187
187
  - !ruby/object:Gem::Dependency
188
188
  name: cmdparse
189
189
  requirement: !ruby/object:Gem::Requirement
190
190
  requirements:
191
- - - ! '>='
191
+ - - ">="
192
192
  - !ruby/object:Gem::Version
193
193
  version: 2.0.2
194
194
  type: :runtime
195
195
  prerelease: false
196
196
  version_requirements: !ruby/object:Gem::Requirement
197
197
  requirements:
198
- - - ! '>='
198
+ - - ">="
199
199
  - !ruby/object:Gem::Version
200
200
  version: 2.0.2
201
201
  - !ruby/object:Gem::Dependency
202
202
  name: highline
203
203
  requirement: !ruby/object:Gem::Requirement
204
204
  requirements:
205
- - - ! '>='
205
+ - - ">="
206
206
  - !ruby/object:Gem::Version
207
207
  version: 1.5.0
208
208
  type: :runtime
209
209
  prerelease: false
210
210
  version_requirements: !ruby/object:Gem::Requirement
211
211
  requirements:
212
- - - ! '>='
212
+ - - ">="
213
213
  - !ruby/object:Gem::Version
214
214
  version: 1.5.0
215
215
  - !ruby/object:Gem::Dependency
@@ -230,14 +230,14 @@ dependencies:
230
230
  name: sauce_whisk
231
231
  requirement: !ruby/object:Gem::Requirement
232
232
  requirements:
233
- - - ~>
233
+ - - "~>"
234
234
  - !ruby/object:Gem::Version
235
235
  version: 0.0.11
236
236
  type: :runtime
237
237
  prerelease: false
238
238
  version_requirements: !ruby/object:Gem::Requirement
239
239
  requirements:
240
- - - ~>
240
+ - - "~>"
241
241
  - !ruby/object:Gem::Version
242
242
  version: 0.0.11
243
243
  description: A Ruby helper for running tests in Sauce Labs' browser testing cloud
@@ -325,17 +325,17 @@ require_paths:
325
325
  - lib
326
326
  required_ruby_version: !ruby/object:Gem::Requirement
327
327
  requirements:
328
- - - ! '>='
328
+ - - ">="
329
329
  - !ruby/object:Gem::Version
330
330
  version: '0'
331
331
  required_rubygems_version: !ruby/object:Gem::Requirement
332
332
  requirements:
333
- - - ! '>='
333
+ - - ">="
334
334
  - !ruby/object:Gem::Version
335
335
  version: '0'
336
336
  requirements: []
337
337
  rubyforge_project:
338
- rubygems_version: 2.2.1
338
+ rubygems_version: 2.2.2
339
339
  signing_key:
340
340
  specification_version: 4
341
341
  summary: A Ruby helper for running tests in Sauce Labs