Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 157 lines (111 sloc) 5.28 kB
0988392 @sandro Convert readme to markdown
authored
1 # Specjour
4b2b5a5 @sandro Fuck SETI
authored
2
d6b132d @sandro SETI headline change
authored
3 ## FUCK SETI. Run specs with your spare CPU cycles.
4b2b5a5 @sandro Fuck SETI
authored
4
e6c400d @sandro Update readme
authored
5 ## Instructions
6
7 1. Start a listener on every machine in the network. `# specjour listen`
8 2. Start a dispatcher. `# specjour`
3353cfc @sandro Add Rails notes to the README
authored
9 3. Say farewell to your long coffee breaks.
3bbf86c @sandro Basic instructions
authored
10
11 ## Installation
12 gem install specjour
13
e6c400d @sandro Update readme
authored
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']%>
2d533c6 @sandro Minor edit to README
authored
21
e6c400d @sandro Update readme
authored
22 ## Give it a try
23 Run `specjour` to start a dispatcher, manager, and multiple workers in the same
24 terminal window.
3bbf86c @sandro Basic instructions
authored
25
893a145 @sandro Updating README with latest changes
authored
26 $ cd myproject
3bbf86c @sandro Basic instructions
authored
27 $ specjour
28
893a145 @sandro Updating README with latest changes
authored
29 ## Start a manager
e6c400d @sandro Update readme
authored
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.
3bbf86c @sandro Basic instructions
authored
31
893a145 @sandro Updating README with latest changes
authored
32 $ specjour listen
3bbf86c @sandro Basic instructions
authored
33
893a145 @sandro Updating README with latest changes
authored
34 ## Distribute the tests
e6c400d @sandro Update readme
authored
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.
3bbf86c @sandro Basic instructions
authored
38
893a145 @sandro Updating README with latest changes
authored
39 $ specjour
3bbf86c @sandro Basic instructions
authored
40
e6c400d @sandro Update readme
authored
41 ## Supplementary
42
43 ### Distribute a subset of tests
44 The first parameter of the specjour command is a test directory. It defalts to
893a145 @sandro Updating README with latest changes
authored
45 the current directory and searches for 'spec' and 'features' paths therein.
91c5179 @sandro Add cucumber to README
authored
46
893a145 @sandro Updating README with latest changes
authored
47 $ specjour spec # all rspec tests
48 $ specjour spec/models # only model tests
e6c400d @sandro Update readme
authored
49 $ specjour features # all features
6e5e564 @sandro Notes on using specjour without the rails plugin
authored
50
e6c400d @sandro Update readme
authored
51 ### Custom Hooks
893a145 @sandro Updating README with latest changes
authored
52 Specjour allows you to hook in to the test process on a per-machine and
616f453 @sandro Tweak multiple projects section of readme
authored
53 per-worker level through the before\_fork and after\_fork configuration blocks.
e6c400d @sandro Update readme
authored
54 If the default hooks don't work for your project, they can be overridden.
6e5e564 @sandro Notes on using specjour without the rails plugin
authored
55
f7f254f @sandro Update history and README for 0.3.0 rc2
authored
56 # .specjour/hooks.rb
6e5e564 @sandro Notes on using specjour without the rails plugin
authored
57
f7f254f @sandro Update history and README for 0.3.0 rc2
authored
58 # Modify the way you use bundler
59 Specjour::Configuration.before_fork = lambda do
60 system('bundle install --without production')
61 end
6e5e564 @sandro Notes on using specjour without the rails plugin
authored
62
f7f254f @sandro Update history and README for 0.3.0 rc2
authored
63 # Modify your database setup
64 Specjour::Configuration.after_fork = lambda do
65 # custom database setup here
893a145 @sandro Updating README with latest changes
authored
66 end
67
68 A preparation hook is run when `specjour prepare` is invoked. This hook allows
e6c400d @sandro Update readme
authored
69 you to run arbitrary code on all of the listening workers. By default, it
70 recreates the database on all workers.
893a145 @sandro Updating README with latest changes
authored
71
f7f254f @sandro Update history and README for 0.3.0 rc2
authored
72 # .specjour/hooks.rb
b4a083e @sandro Whitespace
authored
73
f7f254f @sandro Update history and README for 0.3.0 rc2
authored
74 # Modify preparation
75 Specjour::Configuration.prepare = lambda do
76 # custom preparation code
6e5e564 @sandro Notes on using specjour without the rails plugin
authored
77 end
3353cfc @sandro Add Rails notes to the README
authored
78
e6c400d @sandro Update readme
authored
79 ### Customize what gets rsync'd
c0f0ba0 @sandro Explain rsync customization in README
authored
80 The standard rsync configuration file may be too broad for your
81 project. If you find you're rsyncing gigs of extraneous data from your public
e6c400d @sandro Update readme
authored
82 directory, add an exclusion to your project's rsyncd.conf file.
c0f0ba0 @sandro Explain rsync customization in README
authored
83
84 $ vi workbeast/.specjour/rsyncd.conf
85
e6c400d @sandro Update readme
authored
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.
d7d6d59 @sandro README updates
authored
88
e6c400d @sandro Update readme
authored
89 $ specjour listen --projects bizconf workbeast # run tests for the bizconf and workbeast projects
d7d6d59 @sandro README updates
authored
90
e6c400d @sandro Update readme
authored
91 ### Give your project an alias
d7d6d59 @sandro README updates
authored
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.
93
e6c400d @sandro Update readme
authored
94 ~/bizconf $ specjour listen --projects bizconf_08
95 ~/bizconf $ specjour --alias bizconf_08
d7d6d59 @sandro README updates
authored
96
e6c400d @sandro Update readme
authored
97 ~/bizconf $ specjour listen --projects bizconf_09
98 ~/bizconf $ specjour --alias bizconf_09
d7d6d59 @sandro README updates
authored
99
e6c400d @sandro Update readme
authored
100 ### Working with git
ba6e7af @sandro Git recommendations
authored
101 Commit the .specjour directory but ignore the performance file. The performance
102 file constantly changes, there's no need to commit it. Specjour uses it in an
5d4a39b @sandro Git recommendations
authored
103 attempt to optimize the run order; ensuring each machine gets at least one
ba6e7af @sandro Git recommendations
authored
104 long-running test.
105
106 $ cat .gitignore
107 /.specjour/performance
108
9107412 @sandro Note compatibility versions
authored
109 ## Compatibility
110
da2de3e Update README
Jon Larkowski and Les Hill authored
111 * RSpec 2
112 * Cucumber 0.9+
9107412 @sandro Note compatibility versions
authored
113 * Rails 3
114
0947d52 @sandro Add Wiki link to README
authored
115 ## Support
116
117 * [Github Wiki](https://github.com/sandro/specjour/wiki/)
118 * [Github Issues](https://github.com/sandro/specjour/issues)
119
da2de3e Update README
Jon Larkowski and Les Hill authored
120 ## Hacking on Specjour
121 If you want to hack on specjour, here is how to test your changes:
122
123 source .dev
124 rake # run the test suite sanely
125 specjour # run the test suite with specjour
126
127 Then if all is good, go to another app and test your changes on your test suite:
128
129 gem build specjour.gemspec
130 cd /path/to/your/project
131 gem install -l /path/to/specjour/latest.gem
132 specjour
133
c0f0ba0 @sandro Explain rsync customization in README
authored
134 ## Thanks
135
136 * shayarnett - Cucumber support, pairing and other various patches
137 * voxdolo - Endless support, alpha testing, various patches
da2de3e Update README
Jon Larkowski and Les Hill authored
138 * l4rk and leshill - Removed Jeweler, added support for RSpec 2 and Cucumber 0.9+
a2de3ce @sandro Give thanks to other projects
authored
139 * testjour - Ripped off your name
e6c400d @sandro Update readme
authored
140 * parallel\_tests - Inspiration
c0f0ba0 @sandro Explain rsync customization in README
authored
141
0988392 @sandro Convert readme to markdown
authored
142 ## Note on Patches/Pull Requests
143
20072a1 @sandro Initial commit to specjour.
authored
144 * Fork the project.
09b1c4f @sandro Notes on running specjour when developing changes
authored
145 * `$ source .dev` to ensure you're using the local specjour binary, not the
146 rubygems version
20072a1 @sandro Initial commit to specjour.
authored
147 * Make your feature addition or bug fix.
148 * Add tests for it. This is important so I don't break it in a
149 future version unintentionally.
150 * Commit, do not mess with rakefile, version, or history.
151 (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
152 * Send me a pull request. Bonus points for topic branches.
153
0988392 @sandro Convert readme to markdown
authored
154 ## Copyright
20072a1 @sandro Initial commit to specjour.
authored
155
3a647e6 @sandro Escape underscores in markdown
authored
156 Copyright (c) 2010 Sandro Turriate. See MIT\_LICENSE for details.
Something went wrong with that request. Please try again.