parallel_tests 3.4.0 → 4.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fd8878310c757d2a906bbf5ca62b68e21941cc79472a9833944f88087449c229
4
- data.tar.gz: d55a5ac186f1c16d9568b8f6bb145e0016bafc1c2fb9748593e96997eaf2034c
3
+ metadata.gz: 598069c4031e361060ee4c4beaf7becc3454365b7825b7e9cb8d7909d2f0bb00
4
+ data.tar.gz: 3b0684f907eb1de6b9bb0556289ff3556052fc1fb75c138608801dbb91891b63
5
5
  SHA512:
6
- metadata.gz: f01821e38506525feaafb8a9ff5a480ab1f6f2b0bed849088d72682a699f82ae50bb2a78b94526f243a65c2474ff8f2d3a06c204b44431a7687d877cbbc91dd8
7
- data.tar.gz: 2823702fc7e5d047a69c57d3ee4c0b72afbb51603d58e34a3656899d0026a4b749e94494b9edf234fdcc5fd81bae59dfba55f920d777f5f7d1f7c21fb5219552
6
+ metadata.gz: 5056b01a89580b61ce8b49f034959fe7f5b08f7dee2bd83cd44c115016483ff1be41f1ca34b3cc8471ef9e4ce898b9d3cb3b5123cf88905a9d9c21e6a08439b5
7
+ data.tar.gz: 91a0afb5012fc117de3f602b769d590be185e322dab9555c1f9eae220d90db7131d7516e8fd338ec25cbd8c70428209e5b85b644380f00722eaafd5d41ac9f36
data/Readme.md CHANGED
@@ -1,11 +1,10 @@
1
1
  # parallel_tests
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/parallel_tests.svg)](https://rubygems.org/gems/parallel_tests)
4
- [![Build Status](https://travis-ci.org/grosser/parallel_tests.svg)](https://travis-ci.org/grosser/parallel_tests/builds)
5
- [![Build status](https://github.com/grosser/parallel_tests/workflows/windows/badge.svg)](https://github.com/grosser/parallel_tests/actions?query=workflow%3Awindows)
4
+ [![Build status](https://github.com/grosser/parallel_tests/workflows/test/badge.svg)](https://github.com/grosser/parallel_tests/actions?query=workflow%3Atest)
6
5
 
7
- Speedup Test::Unit + RSpec + Cucumber + Spinach by running parallel on multiple CPU cores.<br/>
8
- ParallelTests splits tests into even groups (by number of lines or runtime) and runs each group in a single process with its own database.
6
+ Speedup Minitest + RSpec + Turnip + Cucumber + Spinach by running parallel on multiple CPU cores.<br/>
7
+ ParallelTests splits tests into balanced groups (by number of lines or runtime) and runs each group in a process with its own database.
9
8
 
10
9
  Setup for Rails
11
10
  ===============
@@ -37,11 +36,17 @@ test:
37
36
  ### Copy development schema (repeat after migrations)
38
37
  rake parallel:prepare
39
38
 
39
+ ### Run migrations in additional database(s) (repeat after migrations)
40
+ rake parallel:migrate
41
+
40
42
  ### Setup environment from scratch (create db and loads schema, useful for CI)
41
43
  rake parallel:setup
42
44
 
45
+ ### Drop all test databases
46
+ rake parallel:drop
47
+
43
48
  ### Run!
44
- rake parallel:test # Test::Unit
49
+ rake parallel:test # Minitest
45
50
  rake parallel:spec # RSpec
46
51
  rake parallel:features # Cucumber
47
52
  rake parallel:features-spinach # Spinach
@@ -142,17 +147,19 @@ Add the following to your `.rspec_parallel` (or `.rspec`) :
142
147
  RSpec: FailuresLogger
143
148
  -----------------------
144
149
 
145
- Produce pasteable command-line snippets for each failed example.
146
-
147
- E.g.
150
+ Produce pastable command-line snippets for each failed example. For example:
148
151
 
149
- rspec /path/to/my_spec.rb:123 # should do something
152
+ ```bash
153
+ rspec /path/to/my_spec.rb:123 # should do something
154
+ ```
150
155
 
151
- Add the following to your `.rspec_parallel` (or `.rspec`) :
156
+ Add to `.rspec_parallel` or use as CLI flag:
152
157
 
153
158
  --format progress
154
159
  --format ParallelTests::RSpec::FailuresLogger --out tmp/failing_specs.log
155
160
 
161
+ (Not needed to retry failures, for that pass [--only-failures](https://relishapp.com/rspec/rspec-core/docs/command-line/only-failures) to rspec)
162
+
156
163
  Cucumber: FailuresLogger
157
164
  -----------------------
158
165
 
@@ -177,19 +184,24 @@ Setup for non-rails
177
184
 
178
185
  gem install parallel_tests
179
186
  # go to your project dir
180
- parallel_test test/
181
- parallel_rspec spec/
182
- parallel_cucumber features/
183
- parallel_spinach features/
187
+ parallel_test
188
+ parallel_rspec
189
+ parallel_cucumber
190
+ parallel_spinach
191
+
192
+ - use `ENV['TEST_ENV_NUMBER']` inside your tests to select separate db/memcache/etc. (docker compose: expose it)
184
193
 
185
- - use `ENV['TEST_ENV_NUMBER']` inside your tests to select separate db/memcache/etc.
186
- - Only run selected files & folders:
194
+ - Only run a subset of files / folders:
187
195
 
188
196
  `parallel_test test/bar test/baz/foo_text.rb`
189
197
 
190
198
  - Pass test-options and files via `--`:
191
199
 
192
- `parallel_test -- -t acceptance -f progress -- spec/foo_spec.rb spec/acceptance`
200
+ `parallel_rspec -- -t acceptance -f progress -- spec/foo_spec.rb spec/acceptance`
201
+
202
+ - Pass in test options, by using the -o flag (wrap everything in quotes):
203
+
204
+ `parallel_cucumber -n 2 -o '-p foo_profile --tags @only_this_tag or @only_that_tag --format summary'`
193
205
 
194
206
  Options are:
195
207
  <!-- copy output from bundle exec ./bin/parallel_test -h -->
@@ -197,24 +209,34 @@ Options are:
197
209
  -p, --pattern [PATTERN] run tests matching this regex pattern
198
210
  --exclude-pattern [PATTERN] exclude tests matching this regex pattern
199
211
  --group-by [TYPE] group tests by:
200
- found - order of finding files
201
- steps - number of cucumber/spinach steps
202
- scenarios - individual cucumber scenarios
203
- filesize - by size of the file
204
- runtime - info from runtime log
205
- default - runtime when runtime log is filled otherwise filesize
212
+ found - order of finding files
213
+ steps - number of cucumber/spinach steps
214
+ scenarios - individual cucumber scenarios
215
+ filesize - by size of the file
216
+ runtime - info from runtime log
217
+ default - runtime when runtime log is filled otherwise filesize
206
218
  -m, --multiply-processes [FLOAT] use given number as a multiplier of processes to run
207
219
  -s, --single [PATTERN] Run all matching files in the same process
208
- -i, --isolate Do not run any other tests in the group used by --single(-s).
209
- Automatically turned on if --isolate-n is set above 0.
210
- --isolate-n Number of processes for isolated groups. Default to 1 when --isolate is on.
211
- --only-group INT[, INT]
220
+ -i, --isolate Do not run any other tests in the group used by --single(-s)
221
+ --isolate-n [PROCESSES] Use 'isolate' singles with number of processes, default: 1.
222
+ --highest-exit-status Exit with the highest exit status provided by test run(s)
223
+ --specify-groups [SPECS] Use 'specify-groups' if you want to specify multiple specs running in multiple
224
+ processes in a specific formation. Commas indicate specs in the same process,
225
+ pipes indicate specs in a new process. Cannot use with --single, --isolate, or
226
+ --isolate-n. Ex.
227
+ $ parallel_tests -n 3 . --specify-groups '1_spec.rb,2_spec.rb|3_spec.rb'
228
+ Process 1 will contain 1_spec.rb and 2_spec.rb
229
+ Process 2 will contain 3_spec.rb
230
+ Process 3 will contain all other specs
231
+ --only-group INT[,INT] Only run the given group numbers. Note that this will force the 'filesize'
232
+ grouping strategy (even when the runtime log is present) unless you explicitly
233
+ set it otherwise via the '-group-by' flag.
212
234
  -e, --exec [COMMAND] execute this code parallel and with ENV['TEST_ENV_NUMBER']
213
235
  -o, --test-options '[OPTIONS]' execute test commands with those options
214
236
  -t, --type [TYPE] test(default) / rspec / cucumber / spinach
215
237
  --suffix [PATTERN] override built in test file pattern (should match suffix):
216
- '_spec.rb$' - matches rspec files
217
- '_(test|spec).rb$' - matches test or spec files
238
+ '_spec.rb$' - matches rspec files
239
+ '_(test|spec).rb$' - matches test or spec files
218
240
  --serialize-stdout Serialize stdout output, nothing will be written until everything is done
219
241
  --prefix-output-with-test-env-number
220
242
  Prefixes test env number to the output when not using --serialize-stdout
@@ -229,8 +251,7 @@ Options are:
229
251
  --first-is-1 Use "1" as TEST_ENV_NUMBER to not reuse the default test environment
230
252
  --fail-fast Stop all groups when one group fails (best used with --test-options '--fail-fast' if supported
231
253
  --verbose Print debug output
232
- --verbose-process-command Displays only the command that will be executed by each process
233
- --verbose-rerun-command When there are failures, displays the command executed by each process that failed
254
+ --verbose-command Displays the command that will be executed by each process and when there are failures displays the command executed by each process that failed
234
255
  --quiet Print only tests output
235
256
  -v, --version Show Version
236
257
  -h, --help Show this.
@@ -282,7 +303,7 @@ TIPS
282
303
  `export PARALLEL_TEST_FIRST_IS_1=true` will provide the same result
283
304
  - [email_spec and/or action_mailer_cache_delivery](https://github.com/grosser/parallel_tests/wiki)
284
305
  - [zeus-parallel_tests](https://github.com/sevos/zeus-parallel_tests)
285
- - [Distributed parallel test (e.g. Travis Support)](https://github.com/grosser/parallel_tests/wiki/Distributed-Parallel-Tests-and-Travis-Support)
306
+ - [Distributed Parallel Tests on CI systems)](https://github.com/grosser/parallel_tests/wiki/Distributed-Parallel-Tests-on-CI-systems) learn how `parallel_tests` can run on distributed servers such as Travis and GitLab-CI. Also shows you how to use parallel_tests without adding `TEST_ENV_NUMBER`-backends
286
307
  - [Capybara setup](https://github.com/grosser/parallel_tests/wiki)
287
308
  - [Sphinx setup](https://github.com/grosser/parallel_tests/wiki)
288
309
  - [Capistrano setup](https://github.com/grosser/parallel_tests/wiki/Remotely-with-capistrano) let your tests run on a big box instead of your laptop
@@ -379,6 +400,11 @@ inspired by [pivotal labs](https://blog.pivotal.io/labs/labs/parallelize-your-rs
379
400
  - [alboyadjian](https://github.com/alboyadjian)
380
401
  - [Nathan Broadbent](https://github.com/ndbroadbent)
381
402
  - [Vikram B Kumar](https://github.com/v-kumar)
403
+ - [Joshua Pinter](https://github.com/joshuapinter)
404
+ - [Zach Dennis](https://github.com/zdennis)
405
+ - [Jon Dufresne](https://github.com/jdufresne)
406
+ - [Eric Kessler](https://github.com/enkessler)
407
+ - [Adis Osmonov](https://github.com/adis-io)
382
408
 
383
409
  [Michael Grosser](http://grosser.it)<br/>
384
410
  michael@grosser.it<br/>
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  # enable local usage from cloned repo
4
- root = File.expand_path("../..", __FILE__)
5
+ root = File.expand_path('..', __dir__)
5
6
  $LOAD_PATH << "#{root}/lib" if File.exist?("#{root}/Gemfile")
6
7
 
7
8
  require "parallel_tests"
data/bin/parallel_rspec CHANGED
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  # enable local usage from cloned repo
4
- root = File.expand_path("../..", __FILE__)
5
+ root = File.expand_path('..', __dir__)
5
6
  $LOAD_PATH << "#{root}/lib" if File.exist?("#{root}/Gemfile")
6
7
 
7
8
  require "parallel_tests"
data/bin/parallel_spinach CHANGED
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  # enable local usage from cloned repo
4
- root = File.expand_path("../..", __FILE__)
5
+ root = File.expand_path('..', __dir__)
5
6
  $LOAD_PATH << "#{root}/lib" if File.exist?("#{root}/Gemfile")
6
7
 
7
8
  require "parallel_tests"
data/bin/parallel_test CHANGED
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  # enable local usage from cloned repo
4
- root = File.expand_path("../..", __FILE__)
5
+ root = File.expand_path('..', __dir__)
5
6
  $LOAD_PATH << "#{root}/lib" if File.exist?("#{root}/Gemfile")
6
7
 
7
8
  require "parallel_tests"