specjour 0.3.0.rc5 → 0.3.0.rc6
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/.rvmrc +1 -0
- data/Gemfile +2 -0
- data/History.markdown +7 -0
- data/README.markdown +19 -6
- data/Rakefile +3 -2
- data/VERSION +1 -1
- data/lib/specjour/cli.rb +1 -5
- data/lib/specjour/db_scrub.rb +1 -1
- data/lib/specjour/dispatcher.rb +9 -6
- data/lib/specjour/rspec/distributed_formatter.rb +1 -1
- data/lib/specjour/worker.rb +6 -1
- data/lib/specjour.rb +1 -1
- data/spec/specjour/cli_spec.rb +1 -0
- data/spec/specjour/manager_spec.rb +1 -0
- data/spec/specjour_spec.rb +3 -1
- data/specjour.gemspec +13 -8
- metadata +29 -11
data/.gitignore
CHANGED
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm gemset use specjour
|
data/Gemfile
ADDED
data/History.markdown
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
History
|
2
2
|
=======
|
3
3
|
|
4
|
+
## 0.3.0.rc6 / 2010-08-07
|
5
|
+
|
6
|
+
* [fixed] Ruby 1.9.2 support through minor changes and DNSSD upgrade
|
7
|
+
* [fixed] DbScrub.drop actually invokes the db:drop rake task
|
8
|
+
* [fixed] Prepare task ignores rspec's at_exit callback, disabling the test
|
9
|
+
suite from running after the prepare task completes.
|
10
|
+
|
4
11
|
## 0.3.0.rc5 / 2010-07-30
|
5
12
|
|
6
13
|
* [fixed] Shared example groups now supported in Rspec2
|
data/README.markdown
CHANGED
@@ -13,6 +13,8 @@
|
|
13
13
|
Running `specjour` starts a dispatcher, a manager, and multiple workers - all
|
14
14
|
of the componenets necessary for distributing your test suite.
|
15
15
|
|
16
|
+
_(Read the Rails section first if your project uses Rails)_
|
17
|
+
|
16
18
|
$ cd myproject
|
17
19
|
$ specjour
|
18
20
|
|
@@ -45,6 +47,8 @@ Each worker should run their specs in an isolated database. Modify the test data
|
|
45
47
|
test:
|
46
48
|
database: blog_test<%=ENV['TEST_ENV_NUMBER']%>
|
47
49
|
|
50
|
+
Running `specjour prepare` will set up the database for each worker.
|
51
|
+
|
48
52
|
### ActiveRecord Hooks
|
49
53
|
Specjour contains ActiveRecord hooks that clear database tables before running tests using `DELETE FROM <table_name>;`. Additionally, test databases will be created if they don't exist (i.e. `CREATE DATABASE blog_test8` for the 8th worker) and your schema will be loaded when the database is out of date.
|
50
54
|
|
@@ -68,7 +72,7 @@ test suite, override it with a custom after\_fork hook.
|
|
68
72
|
|
69
73
|
A preparation hook is run when `specjour prepare` is invoked. This hook allows
|
70
74
|
you to run arbitrary code on all of the listening workers. By default, it drops
|
71
|
-
and recreates the database on all workers.
|
75
|
+
and recreates the ActiveRecord database on all workers.
|
72
76
|
|
73
77
|
# .specjour/hooks.rb
|
74
78
|
|
@@ -77,11 +81,6 @@ and recreates the database on all workers.
|
|
77
81
|
# custom preparation code
|
78
82
|
end
|
79
83
|
|
80
|
-
## Only listen to supported projects
|
81
|
-
By default, a manager will listen to the project in the current directory. If you want to listen for multiple projects, use the `--projects` flag.
|
82
|
-
|
83
|
-
$ specjour listen --projects bizconf workbeast # run specs for the bizconf and workbeast projects
|
84
|
-
|
85
84
|
## Customize what gets rsync'd
|
86
85
|
The standard rsync configuration file may be too broad for your
|
87
86
|
project. If you find you're rsyncing gigs of extraneous data from your public
|
@@ -89,6 +88,20 @@ directory, add an exclusion to your projects rsyncd.conf file.
|
|
89
88
|
|
90
89
|
$ vi workbeast/.specjour/rsyncd.conf
|
91
90
|
|
91
|
+
## Listen for multiple projects
|
92
|
+
By default, a manager will listen to the project in the current directory. If you want to listen for multiple projects, use the `--projects` flag.
|
93
|
+
|
94
|
+
$ specjour listen --projects bizconf workbeast # run specs for the bizconf and workbeast projects
|
95
|
+
|
96
|
+
## Give your project an alias
|
97
|
+
By default, the dispatcher looks for managers matching the project's directory name. If you have multiple teams working on different branches of the same project you may want to isolate each specjour cluster. Give your project an alias and only listen for that alias.
|
98
|
+
|
99
|
+
~/bizconf $ specjour listen -p bizconf_08
|
100
|
+
~/bizconf $ specjour -a bizconf_08
|
101
|
+
|
102
|
+
~/bizconf $ specjour listen -p bizconf_09
|
103
|
+
~/bizconf $ specjour -a bizconf_09
|
104
|
+
|
92
105
|
## Thanks
|
93
106
|
|
94
107
|
* shayarnett - Cucumber support, pairing and other various patches
|
data/Rakefile
CHANGED
@@ -10,11 +10,12 @@ begin
|
|
10
10
|
gem.email = "sandro.turriate@gmail.com"
|
11
11
|
gem.homepage = "http://github.com/sandro/specjour"
|
12
12
|
gem.authors = ["Sandro Turriate"]
|
13
|
-
gem.add_dependency "dnssd", "1.3.
|
14
|
-
gem.add_dependency "thor", ">=0.
|
13
|
+
gem.add_dependency "dnssd", "1.3.4"
|
14
|
+
gem.add_dependency "thor", ">=0.14.0"
|
15
15
|
gem.add_development_dependency "rspec", "1.3.0"
|
16
16
|
gem.add_development_dependency "rr", ">=0.10.11"
|
17
17
|
gem.add_development_dependency "yard", ">=0.5.3"
|
18
|
+
gem.add_development_dependency "jeweler", ">=1.4.0"
|
18
19
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
19
20
|
end
|
20
21
|
Jeweler::GemcutterTasks.new
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.0.
|
1
|
+
0.3.0.rc6
|
data/lib/specjour/cli.rb
CHANGED
@@ -2,10 +2,6 @@ module Specjour
|
|
2
2
|
require 'thor'
|
3
3
|
class CLI < Thor
|
4
4
|
|
5
|
-
def self.printable_tasks
|
6
|
-
super.reject{|t| t.last =~ /INTERNAL USE/ }
|
7
|
-
end
|
8
|
-
|
9
5
|
def self.worker_option
|
10
6
|
method_option :workers, :aliases => "-w", :type => :numeric, :desc => "Number of concurent processes to run. Defaults to your system's available cores."
|
11
7
|
end
|
@@ -62,7 +58,7 @@ module Specjour
|
|
62
58
|
puts Specjour::VERSION
|
63
59
|
end
|
64
60
|
|
65
|
-
desc "work", "INTERNAL USE ONLY"
|
61
|
+
desc "work", "INTERNAL USE ONLY", :hide => true
|
66
62
|
method_option :project_path, :required => true
|
67
63
|
method_option :printer_uri, :required => true
|
68
64
|
method_option :number, :type => :numeric, :required => true
|
data/lib/specjour/db_scrub.rb
CHANGED
data/lib/specjour/dispatcher.rb
CHANGED
@@ -38,15 +38,17 @@ module Specjour
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def all_specs(tests_path = 'spec')
|
41
|
-
|
42
|
-
|
43
|
-
|
41
|
+
full_path = File.join(project_path, tests_path)
|
42
|
+
if File.exists? full_path
|
43
|
+
Dir[File.join(full_path, "**/*_spec.rb")].sort
|
44
|
+
end
|
44
45
|
end
|
45
46
|
|
46
47
|
def all_features(tests_path = 'features')
|
47
|
-
|
48
|
-
|
49
|
-
|
48
|
+
full_path = File.join(project_path, tests_path)
|
49
|
+
if File.exists? full_path
|
50
|
+
Dir[File.join(full_path, "**/*.feature")].sort
|
51
|
+
end
|
50
52
|
end
|
51
53
|
|
52
54
|
def add_manager(manager)
|
@@ -147,6 +149,7 @@ module Specjour
|
|
147
149
|
|
148
150
|
def resolve_reply(reply)
|
149
151
|
DNSSD.resolve!(reply) do |resolved|
|
152
|
+
Specjour.logger.debug "Bonjour discovered #{resolved.target}"
|
150
153
|
resolved_ip = ip_from_hostname(resolved.target)
|
151
154
|
uri = URI::Generic.build :scheme => reply.service_name, :host => resolved_ip, :port => resolved.port
|
152
155
|
fetch_manager(uri)
|
data/lib/specjour/worker.rb
CHANGED
@@ -29,6 +29,7 @@ module Specjour
|
|
29
29
|
def prepare
|
30
30
|
load_app
|
31
31
|
Configuration.prepare.call
|
32
|
+
Kernel.exit!
|
32
33
|
end
|
33
34
|
|
34
35
|
def run_tests
|
@@ -62,7 +63,11 @@ module Specjour
|
|
62
63
|
Rspec::Preloader.load(preload_spec) if preload_spec
|
63
64
|
Cucumber::Preloader.load(preload_feature) if preload_feature
|
64
65
|
rescue StandardError => exception
|
65
|
-
|
66
|
+
msg = [
|
67
|
+
"Caught exception: #{exception.class} #{exception.message}",
|
68
|
+
"Proceeding... you may need to re-run the dispatcher."
|
69
|
+
]
|
70
|
+
$stderr.puts msg.join("\n")
|
66
71
|
end
|
67
72
|
|
68
73
|
def printer_connection
|
data/lib/specjour.rb
CHANGED
data/spec/specjour/cli_spec.rb
CHANGED
data/spec/specjour_spec.rb
CHANGED
data/specjour.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{specjour}
|
8
|
-
s.version = "0.3.0.
|
8
|
+
s.version = "0.3.0.rc6"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Sandro Turriate"]
|
12
|
-
s.date = %q{2010-07
|
12
|
+
s.date = %q{2010-09-07}
|
13
13
|
s.default_executable = %q{specjour}
|
14
14
|
s.description = %q{Distribute your spec suite amongst your LAN via Bonjour.}
|
15
15
|
s.email = %q{sandro.turriate@gmail.com}
|
@@ -21,6 +21,8 @@ Gem::Specification.new do |s|
|
|
21
21
|
".dev",
|
22
22
|
".document",
|
23
23
|
".gitignore",
|
24
|
+
".rvmrc",
|
25
|
+
"Gemfile",
|
24
26
|
"History.markdown",
|
25
27
|
"MIT_LICENSE",
|
26
28
|
"README.markdown",
|
@@ -87,24 +89,27 @@ Gem::Specification.new do |s|
|
|
87
89
|
s.specification_version = 3
|
88
90
|
|
89
91
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
90
|
-
s.add_runtime_dependency(%q<dnssd>, ["= 1.3.
|
91
|
-
s.add_runtime_dependency(%q<thor>, [">= 0.
|
92
|
+
s.add_runtime_dependency(%q<dnssd>, ["= 1.3.4"])
|
93
|
+
s.add_runtime_dependency(%q<thor>, [">= 0.14.0"])
|
92
94
|
s.add_development_dependency(%q<rspec>, ["= 1.3.0"])
|
93
95
|
s.add_development_dependency(%q<rr>, [">= 0.10.11"])
|
94
96
|
s.add_development_dependency(%q<yard>, [">= 0.5.3"])
|
97
|
+
s.add_development_dependency(%q<jeweler>, [">= 1.4.0"])
|
95
98
|
else
|
96
|
-
s.add_dependency(%q<dnssd>, ["= 1.3.
|
97
|
-
s.add_dependency(%q<thor>, [">= 0.
|
99
|
+
s.add_dependency(%q<dnssd>, ["= 1.3.4"])
|
100
|
+
s.add_dependency(%q<thor>, [">= 0.14.0"])
|
98
101
|
s.add_dependency(%q<rspec>, ["= 1.3.0"])
|
99
102
|
s.add_dependency(%q<rr>, [">= 0.10.11"])
|
100
103
|
s.add_dependency(%q<yard>, [">= 0.5.3"])
|
104
|
+
s.add_dependency(%q<jeweler>, [">= 1.4.0"])
|
101
105
|
end
|
102
106
|
else
|
103
|
-
s.add_dependency(%q<dnssd>, ["= 1.3.
|
104
|
-
s.add_dependency(%q<thor>, [">= 0.
|
107
|
+
s.add_dependency(%q<dnssd>, ["= 1.3.4"])
|
108
|
+
s.add_dependency(%q<thor>, [">= 0.14.0"])
|
105
109
|
s.add_dependency(%q<rspec>, ["= 1.3.0"])
|
106
110
|
s.add_dependency(%q<rr>, [">= 0.10.11"])
|
107
111
|
s.add_dependency(%q<yard>, [">= 0.5.3"])
|
112
|
+
s.add_dependency(%q<jeweler>, [">= 1.4.0"])
|
108
113
|
end
|
109
114
|
end
|
110
115
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: specjour
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 977940563
|
5
5
|
prerelease: true
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
9
|
- 0
|
10
|
-
-
|
11
|
-
version: 0.3.0.
|
10
|
+
- rc6
|
11
|
+
version: 0.3.0.rc6
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- Sandro Turriate
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-07
|
19
|
+
date: 2010-09-07 00:00:00 -04:00
|
20
20
|
default_executable: specjour
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -27,12 +27,12 @@ dependencies:
|
|
27
27
|
requirements:
|
28
28
|
- - "="
|
29
29
|
- !ruby/object:Gem::Version
|
30
|
-
hash:
|
30
|
+
hash: 19
|
31
31
|
segments:
|
32
32
|
- 1
|
33
33
|
- 3
|
34
|
-
-
|
35
|
-
version: 1.3.
|
34
|
+
- 4
|
35
|
+
version: 1.3.4
|
36
36
|
type: :runtime
|
37
37
|
version_requirements: *id001
|
38
38
|
- !ruby/object:Gem::Dependency
|
@@ -43,12 +43,12 @@ dependencies:
|
|
43
43
|
requirements:
|
44
44
|
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
hash:
|
46
|
+
hash: 39
|
47
47
|
segments:
|
48
48
|
- 0
|
49
|
-
-
|
50
|
-
-
|
51
|
-
version: 0.
|
49
|
+
- 14
|
50
|
+
- 0
|
51
|
+
version: 0.14.0
|
52
52
|
type: :runtime
|
53
53
|
version_requirements: *id002
|
54
54
|
- !ruby/object:Gem::Dependency
|
@@ -99,6 +99,22 @@ dependencies:
|
|
99
99
|
version: 0.5.3
|
100
100
|
type: :development
|
101
101
|
version_requirements: *id005
|
102
|
+
- !ruby/object:Gem::Dependency
|
103
|
+
name: jeweler
|
104
|
+
prerelease: false
|
105
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
hash: 7
|
111
|
+
segments:
|
112
|
+
- 1
|
113
|
+
- 4
|
114
|
+
- 0
|
115
|
+
version: 1.4.0
|
116
|
+
type: :development
|
117
|
+
version_requirements: *id006
|
102
118
|
description: Distribute your spec suite amongst your LAN via Bonjour.
|
103
119
|
email: sandro.turriate@gmail.com
|
104
120
|
executables:
|
@@ -111,6 +127,8 @@ files:
|
|
111
127
|
- .dev
|
112
128
|
- .document
|
113
129
|
- .gitignore
|
130
|
+
- .rvmrc
|
131
|
+
- Gemfile
|
114
132
|
- History.markdown
|
115
133
|
- MIT_LICENSE
|
116
134
|
- README.markdown
|