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 +4 -4
- data/Readme.md +58 -32
- data/bin/parallel_cucumber +2 -1
- data/bin/parallel_rspec +2 -1
- data/bin/parallel_spinach +2 -1
- data/bin/parallel_test +2 -1
- data/lib/parallel_tests/cli.rb +161 -92
- data/lib/parallel_tests/cucumber/failures_logger.rb +1 -1
- data/lib/parallel_tests/cucumber/features_with_steps.rb +4 -3
- data/lib/parallel_tests/cucumber/runner.rb +10 -7
- data/lib/parallel_tests/cucumber/scenario_line_logger.rb +4 -4
- data/lib/parallel_tests/cucumber/scenarios.rb +9 -8
- data/lib/parallel_tests/gherkin/io.rb +2 -3
- data/lib/parallel_tests/gherkin/listener.rb +9 -10
- data/lib/parallel_tests/gherkin/runner.rb +29 -35
- data/lib/parallel_tests/gherkin/runtime_logger.rb +2 -1
- data/lib/parallel_tests/grouper.rb +54 -7
- data/lib/parallel_tests/pids.rb +5 -4
- data/lib/parallel_tests/railtie.rb +1 -0
- data/lib/parallel_tests/rspec/failures_logger.rb +6 -14
- data/lib/parallel_tests/rspec/logger_base.rb +9 -9
- data/lib/parallel_tests/rspec/runner.rb +21 -22
- data/lib/parallel_tests/rspec/runtime_logger.rb +14 -13
- data/lib/parallel_tests/rspec/summary_logger.rb +2 -3
- data/lib/parallel_tests/spinach/runner.rb +6 -2
- data/lib/parallel_tests/tasks.rb +130 -71
- data/lib/parallel_tests/test/runner.rb +90 -41
- data/lib/parallel_tests/test/runtime_logger.rb +19 -14
- data/lib/parallel_tests/version.rb +2 -1
- data/lib/parallel_tests.rb +13 -13
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 598069c4031e361060ee4c4beaf7becc3454365b7825b7e9cb8d7909d2f0bb00
|
4
|
+
data.tar.gz: 3b0684f907eb1de6b9bb0556289ff3556052fc1fb75c138608801dbb91891b63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
8
|
-
ParallelTests splits tests into
|
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 #
|
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
|
146
|
-
|
147
|
-
E.g.
|
150
|
+
Produce pastable command-line snippets for each failed example. For example:
|
148
151
|
|
149
|
-
|
152
|
+
```bash
|
153
|
+
rspec /path/to/my_spec.rb:123 # should do something
|
154
|
+
```
|
150
155
|
|
151
|
-
Add
|
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
|
181
|
-
parallel_rspec
|
182
|
-
parallel_cucumber
|
183
|
-
parallel_spinach
|
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
|
-
-
|
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
|
-
`
|
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
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
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
|
-
|
210
|
-
--
|
211
|
-
--
|
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
|
-
|
217
|
-
|
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-
|
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
|
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/>
|
data/bin/parallel_cucumber
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(
|
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(
|
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(
|
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(
|
5
|
+
root = File.expand_path('..', __dir__)
|
5
6
|
$LOAD_PATH << "#{root}/lib" if File.exist?("#{root}/Gemfile")
|
6
7
|
|
7
8
|
require "parallel_tests"
|