specjour 0.5.2 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- data/History.markdown +15 -1
- data/README.markdown +39 -47
- data/lib/specjour.rb +1 -1
- data/lib/specjour/connection.rb +1 -1
- data/lib/specjour/loader.rb +9 -1
- data/lib/specjour/manager.rb +1 -1
- metadata +15 -15
data/History.markdown
CHANGED
@@ -1,6 +1,20 @@
|
|
1
1
|
History
|
2
2
|
=======
|
3
3
|
|
4
|
+
0.5.4 / 2012-05-29
|
5
|
+
---------------------------
|
6
|
+
* [fixed] Not running specs without 'spec/' argument
|
7
|
+
|
8
|
+
[Full Changelog](https://github.com/sandro/specjour/compare/v0.5.3...v0.5.4)
|
9
|
+
|
10
|
+
0.5.3 / 2012-04-12 - yanked
|
11
|
+
---------------------------
|
12
|
+
* [fixed] Writing to a nil socket; timeout too small (josephlord)
|
13
|
+
* [fixed] Eagerly loading Rspec (jgdavey)
|
14
|
+
* [fixed] Load path incorrectly matching specjour (jgdavey)
|
15
|
+
|
16
|
+
[Full Changelog](https://github.com/sandro/specjour/compare/v0.5.2...v0.5.3)
|
17
|
+
|
4
18
|
0.5.2 / 2012-02-21
|
5
19
|
---------------------------
|
6
20
|
* [fixed] Binary path used by Loader
|
@@ -25,7 +39,7 @@ History
|
|
25
39
|
* [removed] RSpec < 2.8 compatibility
|
26
40
|
* [added] Memory utilizing forks. No longer forking and execing means workers
|
27
41
|
start running tests faster.
|
28
|
-
* [added] Configuration.
|
42
|
+
* [added] Configuration.after\_load hook; runs after loading the environment
|
29
43
|
* [added] Configurable rsync port
|
30
44
|
* [added] Specs distributed by example, not file! Means better
|
31
45
|
distribution/fast spec suites.
|
data/README.markdown
CHANGED
@@ -2,61 +2,56 @@
|
|
2
2
|
|
3
3
|
## FUCK SETI. Run specs with your spare CPU cycles.
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
## Instructions
|
6
|
+
|
7
|
+
1. Start a listener on every machine in the network. `# specjour listen`
|
8
|
+
2. Start a dispatcher. `# specjour`
|
7
9
|
3. Say farewell to your long coffee breaks.
|
8
10
|
|
9
11
|
## Installation
|
10
12
|
gem install specjour
|
11
13
|
|
12
|
-
|
13
|
-
|
14
|
-
|
14
|
+
### Rails
|
15
|
+
Each worker needs an isolated database. Modify the test database name in your
|
16
|
+
`config/database.yml` to include the following environment variable (Influenced
|
17
|
+
by [parallel\_tests](http://github.com/grosser/parallel_tests)):
|
18
|
+
|
19
|
+
test:
|
20
|
+
database: project_name_test<%=ENV['TEST_ENV_NUMBER']%>
|
15
21
|
|
16
|
-
|
22
|
+
## Give it a try
|
23
|
+
Run `specjour` to start a dispatcher, manager, and multiple workers in the same
|
24
|
+
terminal window.
|
17
25
|
|
18
26
|
$ cd myproject
|
19
27
|
$ specjour
|
20
28
|
|
21
29
|
## Start a manager
|
22
|
-
|
23
|
-
to run specs. By default, the manager runs tests for the project in the
|
24
|
-
current directory and uses your system cores to determine the number of workers
|
25
|
-
to start. If your system has two cores, two workers will run tests.
|
30
|
+
If you wish to share your computing power with the rest of the computers in your network, run `specjour listen` to start a long running process. The next time you, or any of your co-workers run `specjour`, they'll find your machine.
|
26
31
|
|
27
32
|
$ specjour listen
|
28
33
|
|
29
34
|
## Distribute the tests
|
30
|
-
Dispatch the tests among the managers
|
31
|
-
'features' directories for tests
|
35
|
+
Dispatch the tests among the managers in the network. Specjour checks the
|
36
|
+
'spec' and 'features' directories for tests to send to the listening
|
37
|
+
managers.
|
32
38
|
|
33
39
|
$ specjour
|
34
40
|
|
35
|
-
##
|
36
|
-
|
41
|
+
## Supplementary
|
42
|
+
|
43
|
+
### Distribute a subset of tests
|
44
|
+
The first parameter of the specjour command is a test directory. It defalts to
|
37
45
|
the current directory and searches for 'spec' and 'features' paths therein.
|
38
46
|
|
39
47
|
$ specjour spec # all rspec tests
|
40
48
|
$ specjour spec/models # only model tests
|
41
|
-
$ specjour features #
|
42
|
-
$ specjour ~/my_other_project/features
|
43
|
-
|
44
|
-
## Rails
|
45
|
-
Each worker should run their specs in an isolated database. Modify the test database name in your `config/database.yml` to include the following environment variable (Influenced by [parallel\_tests](http://github.com/grosser/parallel_tests)):
|
46
|
-
|
47
|
-
test:
|
48
|
-
database: blog_test<%=ENV['TEST_ENV_NUMBER']%>
|
49
|
-
|
50
|
-
Running `specjour prepare` will set up the database for each worker.
|
51
|
-
|
52
|
-
### ActiveRecord Hooks
|
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.
|
49
|
+
$ specjour features # all features
|
54
50
|
|
55
|
-
|
51
|
+
### Custom Hooks
|
56
52
|
Specjour allows you to hook in to the test process on a per-machine and
|
57
53
|
per-worker level through the before\_fork and after\_fork configuration blocks.
|
58
|
-
If the default
|
59
|
-
test suite, override it with a custom after\_fork hook.
|
54
|
+
If the default hooks don't work for your project, they can be overridden.
|
60
55
|
|
61
56
|
# .specjour/hooks.rb
|
62
57
|
|
@@ -71,8 +66,8 @@ test suite, override it with a custom after\_fork hook.
|
|
71
66
|
end
|
72
67
|
|
73
68
|
A preparation hook is run when `specjour prepare` is invoked. This hook allows
|
74
|
-
you to run arbitrary code on all of the listening workers. By default, it
|
75
|
-
|
69
|
+
you to run arbitrary code on all of the listening workers. By default, it
|
70
|
+
recreates the database on all workers.
|
76
71
|
|
77
72
|
# .specjour/hooks.rb
|
78
73
|
|
@@ -81,28 +76,28 @@ and recreates the ActiveRecord database on all workers.
|
|
81
76
|
# custom preparation code
|
82
77
|
end
|
83
78
|
|
84
|
-
|
79
|
+
### Customize what gets rsync'd
|
85
80
|
The standard rsync configuration file may be too broad for your
|
86
81
|
project. If you find you're rsyncing gigs of extraneous data from your public
|
87
|
-
directory, add an exclusion to your
|
82
|
+
directory, add an exclusion to your project's rsyncd.conf file.
|
88
83
|
|
89
84
|
$ vi workbeast/.specjour/rsyncd.conf
|
90
85
|
|
91
|
-
|
92
|
-
By default, a manager will listen to the project in the current directory. If you want to
|
86
|
+
### Listen for multiple projects
|
87
|
+
By default, a manager will listen to the project in the current directory. If you want to run tests for multiple projects, use the `--projects` flag.
|
93
88
|
|
94
|
-
$ specjour listen --projects bizconf workbeast # run
|
89
|
+
$ specjour listen --projects bizconf workbeast # run tests for the bizconf and workbeast projects
|
95
90
|
|
96
|
-
|
91
|
+
### Give your project an alias
|
97
92
|
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
93
|
|
99
|
-
~/bizconf $ specjour listen
|
100
|
-
~/bizconf $ specjour
|
94
|
+
~/bizconf $ specjour listen --projects bizconf_08
|
95
|
+
~/bizconf $ specjour --alias bizconf_08
|
101
96
|
|
102
|
-
~/bizconf $ specjour listen
|
103
|
-
~/bizconf $ specjour
|
97
|
+
~/bizconf $ specjour listen --projects bizconf_09
|
98
|
+
~/bizconf $ specjour --alias bizconf_09
|
104
99
|
|
105
|
-
|
100
|
+
### Working with git
|
106
101
|
Commit the .specjour directory but ignore the performance file. The performance
|
107
102
|
file constantly changes, there's no need to commit it. Specjour uses it in an
|
108
103
|
attempt to optimize the run order; ensuring each machine gets at least one
|
@@ -115,7 +110,6 @@ long-running test.
|
|
115
110
|
|
116
111
|
* RSpec 2
|
117
112
|
* Cucumber 0.9+
|
118
|
-
* Rails 2
|
119
113
|
* Rails 3
|
120
114
|
|
121
115
|
## Hacking on Specjour
|
@@ -124,8 +118,6 @@ If you want to hack on specjour, here is how to test your changes:
|
|
124
118
|
source .dev
|
125
119
|
rake # run the test suite sanely
|
126
120
|
specjour # run the test suite with specjour
|
127
|
-
cd sample
|
128
|
-
specjour # run the cucumber test suite with specjour
|
129
121
|
|
130
122
|
Then if all is good, go to another app and test your changes on your test suite:
|
131
123
|
|
@@ -140,7 +132,7 @@ Then if all is good, go to another app and test your changes on your test suite:
|
|
140
132
|
* voxdolo - Endless support, alpha testing, various patches
|
141
133
|
* l4rk and leshill - Removed Jeweler, added support for RSpec 2 and Cucumber 0.9+
|
142
134
|
* testjour - Ripped off your name
|
143
|
-
* parallel\_tests -
|
135
|
+
* parallel\_tests - Inspiration
|
144
136
|
|
145
137
|
## Note on Patches/Pull Requests
|
146
138
|
|
data/lib/specjour.rb
CHANGED
@@ -29,7 +29,7 @@ module Specjour
|
|
29
29
|
autoload :Cucumber, 'specjour/cucumber'
|
30
30
|
autoload :RSpec, 'specjour/rspec'
|
31
31
|
|
32
|
-
VERSION ||= "0.5.
|
32
|
+
VERSION ||= "0.5.4"
|
33
33
|
HOOKS_PATH ||= "./.specjour/hooks.rb"
|
34
34
|
PROGRAM_NAME ||= $PROGRAM_NAME # keep a reference of the original program name
|
35
35
|
|
data/lib/specjour/connection.rb
CHANGED
data/lib/specjour/loader.rb
CHANGED
@@ -87,10 +87,18 @@ module Specjour
|
|
87
87
|
end
|
88
88
|
|
89
89
|
def register_tests_with_printer
|
90
|
-
tests =
|
90
|
+
tests = rspec_examples | feature_files
|
91
91
|
connection.send_message :tests=, tests
|
92
92
|
end
|
93
93
|
|
94
|
+
def rspec_examples
|
95
|
+
if spec_files.any?
|
96
|
+
filtered_examples
|
97
|
+
else
|
98
|
+
[]
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
94
102
|
def filtered_examples
|
95
103
|
::RSpec.world.example_groups.map do |g|
|
96
104
|
g.descendants.map do |gs|
|
data/lib/specjour/manager.rb
CHANGED
@@ -62,7 +62,7 @@ module Specjour
|
|
62
62
|
exec_cmd << " --test-paths #{test_paths.join(" ")}" if test_paths.any?
|
63
63
|
exec_cmd << " --log" if Specjour.log?
|
64
64
|
exec_cmd << " --quiet" if quiet?
|
65
|
-
load_path = $LOAD_PATH.detect {|l| l =~ %r(specjour
|
65
|
+
load_path = $LOAD_PATH.detect {|l| l =~ %r(specjour[^/]*/lib$)}
|
66
66
|
bin_path = File.expand_path(File.join(load_path, "../bin"))
|
67
67
|
Kernel.exec({"RUBYLIB" => load_path}, "#{bin_path}/specjour #{exec_cmd}")
|
68
68
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: specjour
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-05-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: dnssd
|
16
|
-
requirement: &
|
16
|
+
requirement: &2152331220 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - =
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 2.0.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2152331220
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: thor
|
27
|
-
requirement: &
|
27
|
+
requirement: &2152330580 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 0.14.0
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2152330580
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &2152329980 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 2.8.0
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2152329980
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rr
|
49
|
-
requirement: &
|
49
|
+
requirement: &2152329340 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 1.0.4
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *2152329340
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: cucumber
|
60
|
-
requirement: &
|
60
|
+
requirement: &2152328620 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 1.1.4
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *2152328620
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: yard
|
71
|
-
requirement: &
|
71
|
+
requirement: &2152327920 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
version: 0.7.2
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *2152327920
|
80
80
|
description: ! " Specjour splits your RSpec suite across multiple machines, and
|
81
81
|
multiple\n cores per machine, to run super-parallel-fast! Also works with Cucumber.\n"
|
82
82
|
email: sandro.turriate@gmail.com
|
@@ -137,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
137
|
version: 1.3.6
|
138
138
|
requirements: []
|
139
139
|
rubyforge_project:
|
140
|
-
rubygems_version: 1.8.
|
140
|
+
rubygems_version: 1.8.17
|
141
141
|
signing_key:
|
142
142
|
specification_version: 3
|
143
143
|
summary: Distribute your spec suite amongst your LAN via Bonjour.
|