specjour 0.2.3 → 0.2.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.
data/History.markdown CHANGED
@@ -1,6 +1,13 @@
1
1
  History
2
2
  =======
3
3
 
4
+ 0.2.4
5
+ -----
6
+ *2010-05-10*
7
+
8
+ * [added] Correct exit status
9
+ * [fixed] Will reconnect when connection is lost while requesting tests
10
+
4
11
  0.2.3
5
12
  -----
6
13
  *2010-04-25*
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.3
1
+ 0.2.4
@@ -39,11 +39,17 @@ module Specjour
39
39
  raise Error, "Connection to dispatcher timed out"
40
40
  end
41
41
 
42
+ def next_test
43
+ will_reconnect do
44
+ send_message(:ready)
45
+ load_object socket.gets(TERMINATOR)
46
+ end
47
+ end
48
+
42
49
  def print(arg)
43
- socket.print dump_object(arg)
44
- rescue SystemCallError => error
45
- reconnect
46
- retry
50
+ will_reconnect do
51
+ socket.print dump_object(arg)
52
+ end
47
53
  end
48
54
 
49
55
  def puts(arg)
@@ -68,5 +74,12 @@ module Specjour
68
74
  socket.close unless socket.closed?
69
75
  connect
70
76
  end
77
+
78
+ def will_reconnect(&block)
79
+ block.call
80
+ rescue SystemCallError => error
81
+ reconnect
82
+ retry
83
+ end
71
84
  end
72
85
  end
@@ -55,6 +55,10 @@ module Specjour
55
55
  @summarizer.add(stats)
56
56
  end
57
57
 
58
+ def exit_status
59
+ @summarizer.failing_scenarios.empty?
60
+ end
61
+
58
62
  def summarize
59
63
  if @summarizer.failing_scenarios.any?
60
64
  puts "\n\n"
@@ -24,6 +24,7 @@ module Specjour
24
24
  gather_managers
25
25
  dispatch_work
26
26
  printer.join
27
+ exit printer.exit_status
27
28
  end
28
29
 
29
30
  protected
@@ -33,14 +33,20 @@ module Specjour
33
33
  end
34
34
 
35
35
  def ready(client)
36
- client.print specs_to_run.shift
37
- client.flush
36
+ synchronize do
37
+ client.print specs_to_run.shift
38
+ client.flush
39
+ end
38
40
  end
39
41
 
40
42
  def done(client)
41
43
  self.completed_workers += 1
42
44
  end
43
45
 
46
+ def exit_status
47
+ report.exit_status
48
+ end
49
+
44
50
  def worker_summary=(client, summary)
45
51
  report.add(summary)
46
52
  end
@@ -83,6 +89,10 @@ module Specjour
83
89
  end
84
90
  end
85
91
 
92
+ def synchronize(&block)
93
+ @connectionsMutex.synchronize &block
94
+ end
95
+
86
96
  def abandoned_worker_message
87
97
  data = "* ERROR: NOT ALL WORKERS COMPLETED PROPERLY *"
88
98
  filler = "*" * data.size
@@ -22,6 +22,10 @@ module Specjour
22
22
  end
23
23
  end
24
24
 
25
+ def exit_status
26
+ failing_examples.empty?
27
+ end
28
+
25
29
  def increment(key, value)
26
30
  current = instance_variable_get("@#{key}")
27
31
  instance_variable_set("@#{key}", current + value)
@@ -22,22 +22,16 @@ module Specjour
22
22
  end
23
23
 
24
24
  def run
25
- connection.send_message(:ready)
26
25
  run_time = 0
27
26
  Dir.chdir(project_path)
28
- while !connection.closed? && data = connection.gets(TERMINATOR)
29
- test = load_object(data)
30
- if test
31
- run_time += Benchmark.realtime do
32
- run_test test
33
- end
34
- connection.send_message(:ready)
35
- else
36
- connection.send_message(:worker_summary=, {:duration => sprintf("%6f", run_time)})
37
- connection.send_message(:done)
38
- connection.disconnect
27
+ while test = connection.next_test
28
+ run_time += Benchmark.realtime do
29
+ run_test test
39
30
  end
40
31
  end
32
+ connection.send_message(:worker_summary=, {:duration => sprintf("%6f", run_time)})
33
+ connection.send_message(:done)
34
+ connection.disconnect
41
35
  end
42
36
 
43
37
  protected
data/lib/specjour.rb CHANGED
@@ -23,7 +23,7 @@ module Specjour
23
23
  autoload :Cucumber, 'specjour/cucumber'
24
24
  autoload :Rspec, 'specjour/rspec'
25
25
 
26
- VERSION = "0.2.3".freeze
26
+ VERSION = "0.2.4".freeze
27
27
 
28
28
  class Error < StandardError; end
29
29
 
data/specjour.gemspec ADDED
@@ -0,0 +1,101 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{specjour}
8
+ s.version = "0.2.4"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Sandro Turriate"]
12
+ s.date = %q{2010-05-10}
13
+ s.default_executable = %q{specjour}
14
+ s.description = %q{Distribute your spec suite amongst your LAN via Bonjour.}
15
+ s.email = %q{sandro.turriate@gmail.com}
16
+ s.executables = ["specjour"]
17
+ s.extra_rdoc_files = [
18
+ "README.markdown"
19
+ ]
20
+ s.files = [
21
+ ".dev",
22
+ ".document",
23
+ ".gitignore",
24
+ "History.markdown",
25
+ "MIT_LICENSE",
26
+ "README.markdown",
27
+ "Rakefile",
28
+ "VERSION",
29
+ "bin/specjour",
30
+ "lib/specjour.rb",
31
+ "lib/specjour/connection.rb",
32
+ "lib/specjour/cpu.rb",
33
+ "lib/specjour/cucumber.rb",
34
+ "lib/specjour/cucumber/dispatcher.rb",
35
+ "lib/specjour/cucumber/distributed_formatter.rb",
36
+ "lib/specjour/cucumber/final_report.rb",
37
+ "lib/specjour/cucumber/printer.rb",
38
+ "lib/specjour/db_scrub.rb",
39
+ "lib/specjour/dispatcher.rb",
40
+ "lib/specjour/manager.rb",
41
+ "lib/specjour/printer.rb",
42
+ "lib/specjour/protocol.rb",
43
+ "lib/specjour/rspec.rb",
44
+ "lib/specjour/rspec/distributed_formatter.rb",
45
+ "lib/specjour/rspec/final_report.rb",
46
+ "lib/specjour/rspec/marshalable_rspec_failure.rb",
47
+ "lib/specjour/rsync_daemon.rb",
48
+ "lib/specjour/socket_helpers.rb",
49
+ "lib/specjour/tasks/dispatch.rake",
50
+ "lib/specjour/tasks/specjour.rb",
51
+ "lib/specjour/worker.rb",
52
+ "rails/init.rb",
53
+ "spec/cpu_spec.rb",
54
+ "spec/lib/specjour/worker_spec.rb",
55
+ "spec/manager_spec.rb",
56
+ "spec/rsync_daemon_spec.rb",
57
+ "spec/spec.opts",
58
+ "spec/spec_helper.rb",
59
+ "spec/specjour_spec.rb",
60
+ "specjour.gemspec"
61
+ ]
62
+ s.homepage = %q{http://github.com/sandro/specjour}
63
+ s.rdoc_options = ["--charset=UTF-8"]
64
+ s.require_paths = ["lib"]
65
+ s.rubygems_version = %q{1.3.6}
66
+ s.summary = %q{Distribute your spec suite amongst your LAN via Bonjour.}
67
+ s.test_files = [
68
+ "spec/cpu_spec.rb",
69
+ "spec/lib/specjour/worker_spec.rb",
70
+ "spec/manager_spec.rb",
71
+ "spec/rsync_daemon_spec.rb",
72
+ "spec/spec_helper.rb",
73
+ "spec/specjour_spec.rb"
74
+ ]
75
+
76
+ if s.respond_to? :specification_version then
77
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
78
+ s.specification_version = 3
79
+
80
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
81
+ s.add_runtime_dependency(%q<dnssd>, ["= 1.3.1"])
82
+ s.add_runtime_dependency(%q<rspec>, [">= 0"])
83
+ s.add_development_dependency(%q<rspec>, ["= 1.3.0"])
84
+ s.add_development_dependency(%q<rr>, ["= 0.10.11"])
85
+ s.add_development_dependency(%q<yard>, ["= 0.5.3"])
86
+ else
87
+ s.add_dependency(%q<dnssd>, ["= 1.3.1"])
88
+ s.add_dependency(%q<rspec>, [">= 0"])
89
+ s.add_dependency(%q<rspec>, ["= 1.3.0"])
90
+ s.add_dependency(%q<rr>, ["= 0.10.11"])
91
+ s.add_dependency(%q<yard>, ["= 0.5.3"])
92
+ end
93
+ else
94
+ s.add_dependency(%q<dnssd>, ["= 1.3.1"])
95
+ s.add_dependency(%q<rspec>, [">= 0"])
96
+ s.add_dependency(%q<rspec>, ["= 1.3.0"])
97
+ s.add_dependency(%q<rr>, ["= 0.10.11"])
98
+ s.add_dependency(%q<yard>, ["= 0.5.3"])
99
+ end
100
+ end
101
+
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 3
9
- version: 0.2.3
8
+ - 4
9
+ version: 0.2.4
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-04-26 00:00:00 -04:00
17
+ date: 2010-05-10 00:00:00 -04:00
18
18
  default_executable: specjour
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -133,6 +133,7 @@ files:
133
133
  - spec/spec.opts
134
134
  - spec/spec_helper.rb
135
135
  - spec/specjour_spec.rb
136
+ - specjour.gemspec
136
137
  has_rdoc: true
137
138
  homepage: http://github.com/sandro/specjour
138
139
  licenses: []