sauce 3.1.1 → 3.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/sauce/utilities.rb +1 -37
- data/lib/sauce/utilities/connect.rb +37 -0
- data/lib/sauce/utilities/rails_server.rb +3 -0
- data/lib/sauce/version.rb +1 -1
- data/lib/tasks/parallel_testing.rb +25 -8
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Y2U0MmM0ZDc3ZDU3ZjIyYTlkYzQ4MzAyM2YxMzgzNmI2MWZjZGZmOA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZDAyMzRiOWZkZDVlYjQzOTE1NmM0YWZhODMxYzFiYTYyNDY3YWRiOA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YjA4MGU4ZWU5MGEwZmZkOWI2YmNmMjQ5YjZlYTVlZjhmZTMxMDY3M2NjZGI5
|
10
|
+
NDA2YjNlOTA5NWZmYTFmM2NhZjJlOTdkY2ViOTk4YTRmMmU3NDhjMDBkYWU5
|
11
|
+
MDU2M2Q3MzUwMjNjZGVjNzZiNzc2ZDRlZWViMjViMTI3MzhiMTQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NDA2ZmFmMTE3ZmFjZTU0ZGFhNDdmMTYzYjRjMTdlNTMwNzFmZTJhMDY5ZjQ4
|
14
|
+
MTcxODlkNzM5YTdjNDRkYTM4YTczYWRlMjYwODY5MjJjODEzNWE1NzFkNTJh
|
15
|
+
NTg1ZDVhNDhkZmVkMzBjNzBiYmZhYzI0NzYxN2ExZTgxYmRkYTg=
|
data/lib/sauce/utilities.rb
CHANGED
@@ -1,10 +1,9 @@
|
|
1
1
|
require 'timeout'
|
2
2
|
require 'socket'
|
3
|
-
require 'childprocess'
|
4
3
|
require 'net/http'
|
5
|
-
require 'childprocess/process'
|
6
4
|
require 'sauce/parallel'
|
7
5
|
require 'sauce/utilities/rails_server'
|
6
|
+
require 'sauce/utilities/connect'
|
8
7
|
|
9
8
|
module Sauce
|
10
9
|
module Utilities
|
@@ -39,40 +38,5 @@ module Sauce
|
|
39
38
|
If you are using Capybara and are seeing this message, check the Capybara README for information on how to include the Capybara DSL in your tests.
|
40
39
|
MESSAGE
|
41
40
|
end
|
42
|
-
|
43
|
-
|
44
|
-
class Connect
|
45
|
-
def self.start(options={})
|
46
|
-
begin
|
47
|
-
require "sauce/connect"
|
48
|
-
rescue LoadError => e
|
49
|
-
STDERR.puts 'Please install the `sauce-connect` gem if you intend on using Sauce Connect with your tests!'
|
50
|
-
exit(1)
|
51
|
-
end
|
52
|
-
|
53
|
-
if ParallelTests.first_process?
|
54
|
-
unless @tunnel
|
55
|
-
@tunnel = Sauce::Connect.new options
|
56
|
-
@tunnel.connect
|
57
|
-
@tunnel.wait_until_ready
|
58
|
-
end
|
59
|
-
@tunnel
|
60
|
-
else
|
61
|
-
while not File.exist? "sauce_connect.ready"
|
62
|
-
sleep 0.5
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
def self.close
|
68
|
-
if @tunnel
|
69
|
-
if ParallelTests.first_process?
|
70
|
-
ParallelTests.wait_for_other_processes_to_finish
|
71
|
-
@tunnel.disconnect
|
72
|
-
@tunnel = nil
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
77
41
|
end
|
78
42
|
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module Sauce
|
2
|
+
module Utilities
|
3
|
+
class Connect
|
4
|
+
def self.start(options={})
|
5
|
+
begin
|
6
|
+
require "sauce/connect"
|
7
|
+
rescue LoadError => e
|
8
|
+
STDERR.puts 'Please install the `sauce-connect` gem if you intend on using Sauce Connect with your tests!'
|
9
|
+
exit(1)
|
10
|
+
end
|
11
|
+
|
12
|
+
if ParallelTests.first_process?
|
13
|
+
unless @tunnel
|
14
|
+
@tunnel = Sauce::Connect.new options
|
15
|
+
@tunnel.connect
|
16
|
+
@tunnel.wait_until_ready
|
17
|
+
end
|
18
|
+
@tunnel
|
19
|
+
else
|
20
|
+
while not File.exist? "sauce_connect.ready"
|
21
|
+
sleep 0.5
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.close
|
27
|
+
if @tunnel
|
28
|
+
if ParallelTests.first_process?
|
29
|
+
ParallelTests.wait_for_other_processes_to_finish
|
30
|
+
@tunnel.disconnect
|
31
|
+
@tunnel = nil
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
data/lib/sauce/version.rb
CHANGED
@@ -4,25 +4,42 @@ require "parallel_tests/tasks"
|
|
4
4
|
require "parallel_tests/cli_patch"
|
5
5
|
|
6
6
|
namespace :sauce do
|
7
|
-
task :spec, :files, :concurrencies do |t, args|
|
7
|
+
task :spec, :files, :concurrencies, :rspec_opts do |t, args|
|
8
8
|
::RSpec::Core::Runner.disable_autorun!
|
9
9
|
|
10
10
|
args.with_defaults({
|
11
11
|
:concurrencies => [Sauce::TestBroker.concurrencies, 20].min,
|
12
|
-
:files => "spec"
|
12
|
+
:files => "spec",
|
13
|
+
:rspec_opts => "-t sauce"
|
13
14
|
})
|
14
|
-
|
15
|
-
|
16
|
-
|
15
|
+
|
16
|
+
parallel_arguments = [
|
17
|
+
"--type", "saucerspec",
|
18
|
+
"-n", "#{args[:concurrencies]}"
|
19
|
+
]
|
20
|
+
|
21
|
+
unless args[:rspec_opts].nil?
|
22
|
+
parallel_arguments.push "-o"
|
23
|
+
parallel_arguments.push args[:rspec_opts]
|
24
|
+
end
|
25
|
+
|
26
|
+
parallel_arguments.push args[:files]
|
27
|
+
ParallelTests::CLI.new.run(parallel_arguments)
|
17
28
|
end
|
18
29
|
|
19
|
-
task :features, :files, :
|
30
|
+
task :features, :files, :concurrencies do |t, args|
|
20
31
|
args.with_defaults({
|
21
32
|
:concurrency => [Sauce::TestBroker.concurrencies, 20].min,
|
22
33
|
:files => "features"
|
23
34
|
})
|
24
|
-
|
25
|
-
|
35
|
+
|
36
|
+
parallel_arguments = [
|
37
|
+
"--type", "saucecucumber",
|
38
|
+
"-n", args[:concurrencies].to_s,
|
39
|
+
args[:files]
|
40
|
+
]
|
41
|
+
|
42
|
+
ParallelTests::CLI.new.run(parallel_arguments)
|
26
43
|
end
|
27
44
|
|
28
45
|
namespace :install do
|
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.1.
|
4
|
+
version: 3.1.2
|
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-08-
|
16
|
+
date: 2013-08-09 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: capybara
|
@@ -237,6 +237,7 @@ files:
|
|
237
237
|
- lib/sauce/rspec.rb
|
238
238
|
- lib/sauce/selenium.rb
|
239
239
|
- lib/sauce/test_unit.rb
|
240
|
+
- lib/sauce/utilities/connect.rb
|
240
241
|
- lib/sauce/utilities/rails_server.rb
|
241
242
|
- lib/sauce/utilities/rake.rb
|
242
243
|
- lib/sauce/utilities.rb
|