sauce 3.0.2 → 3.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/lib/parallel_tests/cli_patch.rb +5 -3
- data/lib/sauce.rb +1 -0
- data/lib/sauce/config.rb +15 -5
- data/lib/sauce/integrations.rb +3 -3
- data/lib/sauce/utilities.rb +1 -0
- data/lib/sauce/utilities/rake.rb +27 -0
- data/lib/sauce/version.rb +1 -1
- data/lib/tasks/parallel_testing.rb +1 -13
- data/spec/sauce/config/config_spec.rb +0 -23
- data/spec/sauce/config/default_browsers_spec.rb +46 -0
- data/spec/sauce/config/load_defaults_spec.rb +18 -0
- data/spec/sauce/utilities/rake_spec.rb +49 -0
- data/spec/sauce/{utilities_spec.rb → utilities/utilities_spec.rb} +0 -0
- metadata +16 -8
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZjY3NGFkODI1MThlZGQyZGFiODkzZTQ3NWIzYTI2NDg1ODU4MmVhZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZjkzM2U3NjRlMmY0MTk4ZjFmMGFmYjZlZDI4OGI0ZmE3NmJlZjc3Yw==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NjM0Mjg5YjJhMGZhOTc1Nzk1N2YzYTM5YjQ2NWJlNDg4NDA0YjA0ZDJjMDNj
|
10
|
+
N2FkMzYxYWY1YmZiMGZiYTljZDhiYzZjZGRhMzg3NzE0NzVmZjllYTc1NTM5
|
11
|
+
ZDJjMDM0NTI0MTZkZDAxYjhmZWQ2NTEyMTMyYjI4NWYwZTVlOTg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MjRhOWNjY2JkYzY5N2RhZjNkYzU5YjUxOTQ0NjkzYmE3YWQ5ZGNhNWE4MTll
|
14
|
+
NDM2YTJiODc1OTY3ZmM0YTUwMmE2YzE3ZDczNWU0NWE0NGIzNjQ2MThkZDA4
|
15
|
+
Yzg5MTc1MDczNWQxOWYwNWY5NmY2NDM0YWRhNjQ0MjA3NzQxZWY=
|
@@ -5,10 +5,12 @@ module ParallelTests
|
|
5
5
|
|
6
6
|
report_time_taken do
|
7
7
|
groups = @runner.tests_in_groups(options[:files], num_processes, options)
|
8
|
-
|
9
|
-
|
8
|
+
non_empty_groups = groups.reject {|group| group.empty?}
|
9
|
+
Sauce::TestBroker.test_groups = non_empty_groups
|
10
10
|
|
11
|
-
|
11
|
+
report_number_of_tests(non_empty_groups)
|
12
|
+
|
13
|
+
test_results = execute_in_parallel(non_empty_groups, non_empty_groups.size, options) do |group|
|
12
14
|
run_tests(group, Sauce::TestBroker.group_index(group), num_processes, options)
|
13
15
|
end
|
14
16
|
|
data/lib/sauce.rb
CHANGED
data/lib/sauce/config.rb
CHANGED
@@ -7,8 +7,9 @@ module Sauce
|
|
7
7
|
yield get_config
|
8
8
|
end
|
9
9
|
|
10
|
-
def self.get_config
|
11
|
-
|
10
|
+
def self.get_config(default = false)
|
11
|
+
get_default = default == :default ? {} : false
|
12
|
+
@cfg ||= Sauce::Config.new(get_default)
|
12
13
|
end
|
13
14
|
|
14
15
|
def self.clear_config
|
@@ -22,9 +23,6 @@ module Sauce
|
|
22
23
|
:host => "ondemand.saucelabs.com",
|
23
24
|
:port => 80,
|
24
25
|
:browser_url => "http://saucelabs.com",
|
25
|
-
:os => "Windows 2003",
|
26
|
-
:browser => "firefox",
|
27
|
-
:browser_version => "3.6.",
|
28
26
|
:job_name => "Unnamed Ruby job",
|
29
27
|
:local_application_port => "3001",
|
30
28
|
:capture_traffic => false,
|
@@ -32,6 +30,15 @@ module Sauce
|
|
32
30
|
:start_local_application => true
|
33
31
|
}
|
34
32
|
|
33
|
+
DEFAULT_BROWSERS = {
|
34
|
+
:browsers => [
|
35
|
+
["Windows 8", "Internet Explorer", "10"],
|
36
|
+
["Windows 7", "Firefox", "20"],
|
37
|
+
["OS X 10.8", "Safari", "6"],
|
38
|
+
["Linux", "Chrome", nil]
|
39
|
+
]
|
40
|
+
}
|
41
|
+
|
35
42
|
ENVIRONMENT_VARIABLES = %w{SAUCE_HOST SAUCE_PORT SAUCE_BROWSER_URL SAUCE_USERNAME
|
36
43
|
SAUCE_ACCESS_KEY SAUCE_OS SAUCE_BROWSER SAUCE_BROWSER_VERSION SAUCE_JOB_NAME
|
37
44
|
SAUCE_FIREFOX_PROFILE_URL SAUCE_USER_EXTENSIONS_URL
|
@@ -56,6 +63,7 @@ module Sauce
|
|
56
63
|
@undefaulted_opts = {}
|
57
64
|
if opts != false
|
58
65
|
@opts.merge! DEFAULT_OPTIONS
|
66
|
+
@opts.merge! DEFAULT_BROWSERS
|
59
67
|
|
60
68
|
@undefaulted_opts.merge! load_options_from_yaml
|
61
69
|
@undefaulted_opts.merge! load_options_from_environment
|
@@ -71,6 +79,7 @@ module Sauce
|
|
71
79
|
end
|
72
80
|
|
73
81
|
def []=(key, value)
|
82
|
+
@undefaulted_opts.merge!({key => value})
|
74
83
|
@opts[key] = value
|
75
84
|
end
|
76
85
|
|
@@ -134,6 +143,7 @@ module Sauce
|
|
134
143
|
# sub-processes pointed just at each browser in the list.
|
135
144
|
return [[os, browser, browser_version]]
|
136
145
|
end
|
146
|
+
|
137
147
|
return @opts[:browsers] if @opts.include? :browsers
|
138
148
|
return [[os, browser, browser_version]]
|
139
149
|
end
|
data/lib/sauce/integrations.rb
CHANGED
@@ -97,11 +97,11 @@ begin
|
|
97
97
|
})
|
98
98
|
::RSpec.configuration.include(self, :sauce => true)
|
99
99
|
|
100
|
-
::RSpec.configuration.before(:suite, sauce
|
100
|
+
::RSpec.configuration.before(:suite, :sauce => true) do
|
101
101
|
|
102
102
|
config = Sauce::Config.new
|
103
103
|
if config[:application_host]
|
104
|
-
Sauce::Utilities::Connect.start(:host => config[:application_host], :port => config[:application_port] || 80)
|
104
|
+
Sauce::Utilities::Connect.start(:host => config[:application_host], :port => config[:application_port] || 80, :quiet => true)
|
105
105
|
end
|
106
106
|
|
107
107
|
if config[:start_local_application] &&
|
@@ -124,7 +124,7 @@ begin
|
|
124
124
|
end
|
125
125
|
|
126
126
|
if need_tunnel || config[:start_tunnel]
|
127
|
-
Sauce::Utilities::Connect.start(:host => config[:application_host], :port => config[:application_port] || 80)
|
127
|
+
Sauce::Utilities::Connect.start(:host => config[:application_host], :port => config[:application_port] || 80, :quiet => true)
|
128
128
|
end
|
129
129
|
|
130
130
|
if config[:start_local_application] &&
|
data/lib/sauce/utilities.rb
CHANGED
@@ -0,0 +1,27 @@
|
|
1
|
+
module Sauce
|
2
|
+
module Utilities
|
3
|
+
module Rake
|
4
|
+
|
5
|
+
def self.sauce_helper
|
6
|
+
helper_text = <<-ENDHEADER
|
7
|
+
# You should edit this file with the browsers you wish to use
|
8
|
+
# For options, check out http://saucelabs.com/docs/platforms
|
9
|
+
require "sauce"
|
10
|
+
ENDHEADER
|
11
|
+
|
12
|
+
helper_text << "require \"sauce/capybara\"" if Object.const_defined? "Capybara"
|
13
|
+
helper_text << <<-ENDFILE
|
14
|
+
|
15
|
+
Sauce.config do |config|
|
16
|
+
config[:browsers] = [
|
17
|
+
["OS", "BROWSER", "VERSION"],
|
18
|
+
["OS", "BROWSER", "VERSION"]
|
19
|
+
]
|
20
|
+
end
|
21
|
+
ENDFILE
|
22
|
+
|
23
|
+
return helper_text
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/lib/sauce/version.rb
CHANGED
@@ -66,19 +66,7 @@ namespace :sauce do
|
|
66
66
|
path = args[:helper_type].to_sym == :features ? "features/support/sauce_helper.rb" : "spec/sauce_helper.rb"
|
67
67
|
unless File.exists? path
|
68
68
|
File.open(path, "w") do |f|
|
69
|
-
f.write
|
70
|
-
# You should edit this file with the browsers you wish to use
|
71
|
-
# For options, check out http://saucelabs.com/docs/platforms
|
72
|
-
require "sauce"
|
73
|
-
|
74
|
-
Sauce.config do |config|
|
75
|
-
config[:browsers] = [
|
76
|
-
["OS", "BROWSER", "VERSION"],
|
77
|
-
["OS", "BROWSER", "VERSION"]
|
78
|
-
]
|
79
|
-
end
|
80
|
-
ENDFILE
|
81
|
-
)
|
69
|
+
f.write(Sauce::Utilities::Rake.sauce_helper)
|
82
70
|
end
|
83
71
|
else
|
84
72
|
STDERR.puts "WARNING - sauce_helper has already been created."
|
@@ -280,29 +280,6 @@ describe Sauce::Config do
|
|
280
280
|
c.some_option?.should be true
|
281
281
|
end
|
282
282
|
|
283
|
-
describe 'browsers=' do
|
284
|
-
it 'should default the config to the first item' do
|
285
|
-
Sauce.config do |config|
|
286
|
-
config[:browsers] = [['TEST_OS', 'TEST_BROWSER', 'TEST_BROWSER_VERSION']]
|
287
|
-
end
|
288
|
-
|
289
|
-
c = Sauce::Config.new
|
290
|
-
c.os.should == 'TEST_OS'
|
291
|
-
c.browser.should == 'TEST_BROWSER'
|
292
|
-
c.browser_version == 'TEST_BROWSER_VERSION'
|
293
|
-
end
|
294
|
-
end
|
295
|
-
|
296
|
-
describe 'browsers' do
|
297
|
-
it 'should return an Array of the (os, browser, version)' do
|
298
|
-
c.os = 'A'
|
299
|
-
c.browser = 'B'
|
300
|
-
c.browser_version = 'C'
|
301
|
-
|
302
|
-
c.browsers.should == [['A', 'B', 'C']]
|
303
|
-
end
|
304
|
-
end
|
305
|
-
|
306
283
|
it 'should allow overrides as constructor options' do
|
307
284
|
Sauce.config do |config|
|
308
285
|
config[:browsers] = [['OS1', 'BROWSER1', 'BROWSER_VERSION1']]
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require "rspec"
|
2
|
+
|
3
|
+
describe "Sauce::Config :browsers" do
|
4
|
+
before :each do
|
5
|
+
Sauce.clear_config
|
6
|
+
end
|
7
|
+
|
8
|
+
context "When unset" do
|
9
|
+
it "defaults to the tutorial browsers" do
|
10
|
+
tutorial_browsers = [
|
11
|
+
["Windows 8", "Internet Explorer", "10"],
|
12
|
+
["Windows 7", "Firefox", "20"],
|
13
|
+
["OS X 10.8", "Safari", "6"],
|
14
|
+
["Linux", "Chrome", nil]
|
15
|
+
]
|
16
|
+
|
17
|
+
Sauce::Config.new[:browsers].should eq tutorial_browsers
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
context "When set" do
|
22
|
+
before :each do
|
23
|
+
Sauce.clear_config
|
24
|
+
|
25
|
+
Sauce.config do |config|
|
26
|
+
config[:browsers] = [['TEST_OS', 'TEST_BROWSER', 'TEST_BROWSER_VERSION']]
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'should default the config to the first item' do
|
31
|
+
c = Sauce::Config.new
|
32
|
+
c.os.should == 'TEST_OS'
|
33
|
+
c.browser.should == 'TEST_BROWSER'
|
34
|
+
c.browser_version == 'TEST_BROWSER_VERSION'
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'should return an Array of the (os, browser, version)' do
|
38
|
+
c = Sauce::Config.new
|
39
|
+
c[:os] = 'A'
|
40
|
+
c[:browser] = 'B'
|
41
|
+
c[:browser_version] = 'C'
|
42
|
+
|
43
|
+
c.browsers.should == [['A', 'B', 'C']]
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "Sauce" do
|
4
|
+
before :each do
|
5
|
+
Sauce.clear_config
|
6
|
+
end
|
7
|
+
|
8
|
+
describe "#get_config" do
|
9
|
+
it "returns an empty config by default" do
|
10
|
+
Sauce.get_config.opts.should eq Sauce::Config.new(false).opts
|
11
|
+
end
|
12
|
+
|
13
|
+
it "Can return default options" do
|
14
|
+
Sauce.get_config(:default).opts.should eq Sauce::Config.new().opts
|
15
|
+
Sauce.get_config(:default).opts.length.should_not eq 0
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Sauce::Utilities::Rake do
|
4
|
+
|
5
|
+
describe "#create_sauce_helper" do
|
6
|
+
after :all do
|
7
|
+
Object.rspec_reset
|
8
|
+
end
|
9
|
+
|
10
|
+
context "with Capybara" do
|
11
|
+
before :all do
|
12
|
+
Object.stub(:const_defined?).with("Capybara").and_return true
|
13
|
+
end
|
14
|
+
|
15
|
+
it "includes the browser block" do
|
16
|
+
Sauce::Utilities::Rake.sauce_helper.should include browser_block
|
17
|
+
end
|
18
|
+
|
19
|
+
it "includes the require for sauce" do
|
20
|
+
Sauce::Utilities::Rake.sauce_helper.should include "require \"sauce\""
|
21
|
+
end
|
22
|
+
|
23
|
+
it "does not include Capybara" do
|
24
|
+
Sauce::Utilities::Rake.sauce_helper.should include "require \"sauce/capybara\""
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
context "without Capybara" do
|
29
|
+
before :all do
|
30
|
+
Object.stub(:const_defined?).with("Capybara").and_return false
|
31
|
+
end
|
32
|
+
|
33
|
+
it "includes the require for sauce/capybara" do
|
34
|
+
Sauce::Utilities::Rake.sauce_helper.should_not include "require \"sauce/capybara\""
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def browser_block
|
40
|
+
return <<-ENDFILE
|
41
|
+
Sauce.config do |config|
|
42
|
+
config[:browsers] = [
|
43
|
+
["OS", "BROWSER", "VERSION"],
|
44
|
+
["OS", "BROWSER", "VERSION"]
|
45
|
+
]
|
46
|
+
end
|
47
|
+
ENDFILE
|
48
|
+
end
|
49
|
+
end
|
File without changes
|
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.0.
|
4
|
+
version: 3.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dylan Lacey
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2013-06-
|
16
|
+
date: 2013-06-24 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: capybara
|
@@ -187,16 +187,16 @@ dependencies:
|
|
187
187
|
name: sauce_whisk
|
188
188
|
requirement: !ruby/object:Gem::Requirement
|
189
189
|
requirements:
|
190
|
-
- -
|
190
|
+
- - ~>
|
191
191
|
- !ruby/object:Gem::Version
|
192
|
-
version: 0.0.
|
192
|
+
version: 0.0.8
|
193
193
|
type: :runtime
|
194
194
|
prerelease: false
|
195
195
|
version_requirements: !ruby/object:Gem::Requirement
|
196
196
|
requirements:
|
197
|
-
- -
|
197
|
+
- - ~>
|
198
198
|
- !ruby/object:Gem::Version
|
199
|
-
version: 0.0.
|
199
|
+
version: 0.0.8
|
200
200
|
description: A Ruby helper for running tests in Sauce Labs' browser testing cloud
|
201
201
|
service
|
202
202
|
email: help@saucelabs.com
|
@@ -222,6 +222,7 @@ files:
|
|
222
222
|
- lib/sauce/parallel.rb
|
223
223
|
- lib/sauce/raketasks.rb
|
224
224
|
- lib/sauce/selenium.rb
|
225
|
+
- lib/sauce/utilities/rake.rb
|
225
226
|
- lib/sauce/utilities.rb
|
226
227
|
- lib/sauce/version.rb
|
227
228
|
- lib/sauce.rb
|
@@ -240,13 +241,16 @@ files:
|
|
240
241
|
- spec/parallel_tests/sauce_rspec_runner_spec.rb
|
241
242
|
- spec/sauce/capybara_spec.rb
|
242
243
|
- spec/sauce/config/config_spec.rb
|
244
|
+
- spec/sauce/config/default_browsers_spec.rb
|
243
245
|
- spec/sauce/config/environment_config_spec.rb
|
246
|
+
- spec/sauce/config/load_defaults_spec.rb
|
244
247
|
- spec/sauce/cucumber_spec.rb
|
245
248
|
- spec/sauce/driver_pool_spec.rb
|
246
249
|
- spec/sauce/jasmine_spec.rb
|
247
250
|
- spec/sauce/parallel/test_broker_spec.rb
|
248
251
|
- spec/sauce/selenium_spec.rb
|
249
|
-
- spec/sauce/
|
252
|
+
- spec/sauce/utilities/rake_spec.rb
|
253
|
+
- spec/sauce/utilities/utilities_spec.rb
|
250
254
|
- spec/sauce_helper.rb
|
251
255
|
- spec/spec_helper.rb
|
252
256
|
- bin/sauce
|
@@ -288,12 +292,16 @@ test_files:
|
|
288
292
|
- spec/parallel_tests/sauce_rspec_runner_spec.rb
|
289
293
|
- spec/sauce/capybara_spec.rb
|
290
294
|
- spec/sauce/config/config_spec.rb
|
295
|
+
- spec/sauce/config/default_browsers_spec.rb
|
291
296
|
- spec/sauce/config/environment_config_spec.rb
|
297
|
+
- spec/sauce/config/load_defaults_spec.rb
|
292
298
|
- spec/sauce/cucumber_spec.rb
|
293
299
|
- spec/sauce/driver_pool_spec.rb
|
294
300
|
- spec/sauce/jasmine_spec.rb
|
295
301
|
- spec/sauce/parallel/test_broker_spec.rb
|
296
302
|
- spec/sauce/selenium_spec.rb
|
297
|
-
- spec/sauce/
|
303
|
+
- spec/sauce/utilities/rake_spec.rb
|
304
|
+
- spec/sauce/utilities/utilities_spec.rb
|
298
305
|
- spec/sauce_helper.rb
|
299
306
|
- spec/spec_helper.rb
|
307
|
+
has_rdoc:
|