specjour 0.1.4 → 0.1.5
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.
- data/README.markdown +0 -2
- data/VERSION +1 -1
- data/bin/specjour +1 -1
- data/lib/specjour/dispatcher.rb +13 -4
- data/lib/specjour/manager.rb +10 -2
- data/lib/specjour/rsync_daemon.rb +1 -1
- data/lib/specjour/tasks/dispatch.rake +2 -4
- data/lib/specjour.rb +1 -1
- metadata +3 -3
data/README.markdown
CHANGED
@@ -30,8 +30,6 @@ Run the rake task in your project directory to start the test suite.
|
|
30
30
|
|
31
31
|
$ rake specjour
|
32
32
|
|
33
|
-
The worker reports passes/failures in batches of 25 so you won't get immediate feedback, override the batch size via `specjour --batch-size 1`
|
34
|
-
|
35
33
|
## Note on Patches/Pull Requests
|
36
34
|
|
37
35
|
* Fork the project.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.5
|
data/bin/specjour
CHANGED
data/lib/specjour/dispatcher.rb
CHANGED
@@ -17,6 +17,7 @@ module Specjour
|
|
17
17
|
rsync_daemon.start
|
18
18
|
gather_managers
|
19
19
|
sync_managers
|
20
|
+
bundle_install_managers
|
20
21
|
dispatch_work
|
21
22
|
printer.join
|
22
23
|
end
|
@@ -29,6 +30,17 @@ module Specjour
|
|
29
30
|
end
|
30
31
|
end
|
31
32
|
|
33
|
+
def bundle_install_managers
|
34
|
+
command_managers {|manager| manager.bundle_install }
|
35
|
+
end
|
36
|
+
|
37
|
+
def command_managers(async = false, &block)
|
38
|
+
managers.each do |manager|
|
39
|
+
manager_threads << Thread.new(manager, &block)
|
40
|
+
end
|
41
|
+
wait_on_managers unless async
|
42
|
+
end
|
43
|
+
|
32
44
|
def dispatch_work
|
33
45
|
distributable_specs = all_specs.among(worker_size)
|
34
46
|
last_index = 0
|
@@ -99,10 +111,7 @@ module Specjour
|
|
99
111
|
end
|
100
112
|
|
101
113
|
def sync_managers
|
102
|
-
|
103
|
-
manager_threads << Thread.new(manager) { |manager| manager.sync }
|
104
|
-
end
|
105
|
-
wait_on_managers
|
114
|
+
command_managers { |manager| manager.sync }
|
106
115
|
end
|
107
116
|
|
108
117
|
def wait_on_managers
|
data/lib/specjour/manager.rb
CHANGED
@@ -5,9 +5,17 @@ module Specjour
|
|
5
5
|
|
6
6
|
attr_accessor :project_name, :specs_to_run, :dispatcher_uri, :worker_size, :bonjour_service, :batch_size
|
7
7
|
|
8
|
-
def initialize(worker_size = 1, batch_size =
|
8
|
+
def initialize(worker_size = 1, batch_size = 1)
|
9
9
|
@worker_size = worker_size
|
10
|
-
@batch_size =
|
10
|
+
@batch_size = batch_size
|
11
|
+
end
|
12
|
+
|
13
|
+
def bundle_install
|
14
|
+
Dir.chdir(project_path) do
|
15
|
+
unless system('bundle check > /dev/null')
|
16
|
+
system("bundle install --relock > /dev/null")
|
17
|
+
end
|
18
|
+
end
|
11
19
|
end
|
12
20
|
|
13
21
|
def project_path
|
@@ -7,7 +7,5 @@ namespace :specjour do
|
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
10
|
-
desc "Dispatch the
|
11
|
-
task :specjour
|
12
|
-
Rake::Task['specjour:dispatch'].invoke(args[:project_path])
|
13
|
-
end
|
10
|
+
desc "Dispatch the project to listening managers"
|
11
|
+
task :specjour => "specjour:dispatch"
|
data/lib/specjour.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 5
|
9
|
+
version: 0.1.5
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Sandro Turriate
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-03-
|
17
|
+
date: 2010-03-21 00:00:00 -04:00
|
18
18
|
default_executable: specjour
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|