File tree Expand file tree Collapse file tree 2 files changed +16
-11
lines changed
Expand file tree Collapse file tree 2 files changed +16
-11
lines changed Original file line number Diff line number Diff line change 11cores=$( /usr/sbin/sysctl -n hw.logicalcpu)
22
3- if (( cores > 8 )) ; then
4- # This environment variable overrides the `parallel_test` gem's default behavior
5- # which is to use all available logical cores.
6- # Running with 16 cores is very slow for reasons we don't fully understand
7- # but are probably due to lock file or disk resource contention
3+ if (( cores > 8 )) ; then
4+ # This environment variable overrides the `parallel_test` gem's default behavior
5+ # which is to use all available logical cores.
6+ # Running with 16 cores is very slow for reasons we don't fully understand
7+ # but are probably due to lock file or disk resource contention
88
9- export PARALLEL_TEST_PROCESSORS=8
9+ export PARALLEL_TEST_PROCESSORS=8
1010fi
11+
12+ PATH_add bin
Original file line number Diff line number Diff line change @@ -128,14 +128,15 @@ CC in a background process and then forks it every time you run tests. That
128128means that everything loaded prior to the fork doesn't need to be re-loaded
129129every time you run tests. This can speed up tests substantially.
130130
131- To use spring, run ` ./bin/rspec ` in place of ` rspec ` . Spring should
132- automatically watch and reload files, but you can manually stop it with
133- ` ./bin/spring stop ` . It will automatically start again the next time you run
134- ` ./bin/rspec ` .
131+ To use Spring, run ` ./bin/rspec ` in place of the default ` rspec ` binary. CC's
132+ ` .envrc ` adds the `./bin`` directory to your PATH, so in most cases you can
133+ just run ` rspec ` . Spring will automatically watch and reload files, but you can
134+ manually stop it with ` spring stop ` . It will automatically start again
135+ the next time you run ` rspec ` .
135136
136137Example performance improvement:
137138``` sh
138- ❯ multitime -n 10 bundle exec rspec spec/unit/actions/app_create_spec.rb
139+ ❯ multitime -n 10 bundle exec /path/to/default/ rspec spec/unit/actions/app_create_spec.rb
139140
140141...
141142
@@ -160,6 +161,8 @@ user 0.177 0.032 0.129 0.185 0.233
160161sys 0.103 0.014 0.078 0.107 0.126
161162```
162163
164+ If you do not want to use Spring, you can set the ` DISABLE_SPRING ` environment variable.
165+
163166#### Spork (Legacy)
164167
165168Spork is an older implementation of the same "forking" strategy implemented by Spring.
You can’t perform that action at this time.
0 commit comments