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 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.after_load hook; runs after loading the environment
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
- 1. Spin up a manager on each machine that can run your specs.
6
- 2. Start a dispatcher in your project directory.
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
- ## Give it a try
13
- Running `specjour` starts a dispatcher, a manager, and multiple workers - all
14
- of the componenets necessary for distributing your test suite.
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
- _(Read the Rails section first if your project uses Rails)_
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
- Running `specjour listen` will start a manager which advertises that it's ready
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 you started. Specjour checks the 'spec' and
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
- ## Distribute a subset of tests
36
- The first parameter to the specjour command is a test directory. It defalts to
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 # only 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
- ## Custom Hooks
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 ActiveRecord hook doesn't set up the database properly for your
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 drops
75
- and recreates the ActiveRecord database on all workers.
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
- ## Customize what gets rsync'd
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 projects rsyncd.conf file.
82
+ directory, add an exclusion to your project's rsyncd.conf file.
88
83
 
89
84
  $ vi workbeast/.specjour/rsyncd.conf
90
85
 
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.
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 specs for the bizconf and workbeast projects
89
+ $ specjour listen --projects bizconf workbeast # run tests for the bizconf and workbeast projects
95
90
 
96
- ## Give your project an alias
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 -p bizconf_08
100
- ~/bizconf $ specjour -a bizconf_08
94
+ ~/bizconf $ specjour listen --projects bizconf_08
95
+ ~/bizconf $ specjour --alias bizconf_08
101
96
 
102
- ~/bizconf $ specjour listen -p bizconf_09
103
- ~/bizconf $ specjour -a bizconf_09
97
+ ~/bizconf $ specjour listen --projects bizconf_09
98
+ ~/bizconf $ specjour --alias bizconf_09
104
99
 
105
- ## Working with git
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 - Made my test suite twice as fast
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.2"
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
 
@@ -74,7 +74,7 @@ module Specjour
74
74
  end
75
75
 
76
76
  def timeout(&block)
77
- Timeout.timeout(0.1, &block)
77
+ Timeout.timeout(1.0, &block)
78
78
  rescue Timeout::Error
79
79
  end
80
80
 
@@ -87,10 +87,18 @@ module Specjour
87
87
  end
88
88
 
89
89
  def register_tests_with_printer
90
- tests = filtered_examples | feature_files
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|
@@ -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.*/lib$)}
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.2
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-02-22 00:00:00.000000000Z
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: &2156640700 !ruby/object:Gem::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: *2156640700
24
+ version_requirements: *2152331220
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: thor
27
- requirement: &2156640200 !ruby/object:Gem::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: *2156640200
35
+ version_requirements: *2152330580
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &2156639660 !ruby/object:Gem::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: *2156639660
46
+ version_requirements: *2152329980
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rr
49
- requirement: &2156639180 !ruby/object:Gem::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: *2156639180
57
+ version_requirements: *2152329340
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: cucumber
60
- requirement: &2156638680 !ruby/object:Gem::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: *2156638680
68
+ version_requirements: *2152328620
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: yard
71
- requirement: &2156638160 !ruby/object:Gem::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: *2156638160
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.6
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.