parallel_tests 2.3.1 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 198e35adc7c491a1c8f963626020e2b7ef402c11
4
- data.tar.gz: 94417dfb4ec63b9e3262c10d7b8a81ce29037c36
3
+ metadata.gz: ac1a67e85b702af960f6e713e19430eddfd076b5
4
+ data.tar.gz: ee8509f054d88880bd2ae77d03b33fdc6fc03ed2
5
5
  SHA512:
6
- metadata.gz: b892f5d9e66966b1fe28c4d5fc41a84a884927414099275934bc2888e4ea4f517f881113179630c5dc91f49d8b90734efda476da752f7466e9f0993b936aac75
7
- data.tar.gz: 5b504d76c616cb24f3b7b128d7dbfd0c76d7ae99a5c76975ade0a13f434e6793c4cda04b9fd562d9c2a49a3da0d43ff0ca3d7d72401560767001db6efa9de89f
6
+ metadata.gz: 2ee3f49cf7cf8e120e1df061477ee8211c76f3fb8a60ec605c9b838ce99fdad8d015e12492a4f9317e896541a4b96c43a6f138d340b9fc993a08492a235dc02b
7
+ data.tar.gz: fa4dba5b0c02c298b871612dc4c5934a0063cb31272547fe3b376edfe379eaaff0b562eb8786c61186744582ff76fcbb04f7ec04be56a82d9cd7857b147954b5
data/Readme.md CHANGED
@@ -36,6 +36,9 @@ test:
36
36
  ### Copy development schema (repeat after migrations)
37
37
  rake parallel:prepare
38
38
 
39
+ ### Setup environment from scratch (create db and loads schema, useful for CI)
40
+ rake parallel:setup
41
+
39
42
  ### Run!
40
43
  rake parallel:test # Test::Unit
41
44
  rake parallel:spec # RSpec
@@ -230,26 +233,41 @@ You can run any kind of code in parallel with -e / --exec
230
233
 
231
234
  TIPS
232
235
  ====
233
- - `--first-is-1` or `export PARALLEL_TEST_FIRST_IS_1=true` will make the first environment be `1`, so you can test while running your full suite
234
- - Debug errors that only happen with multiple files using `--verbose` and [cleanser](https://github.com/grosser/cleanser)
235
- - [RSpec] add a `.rspec_parallel` to use different options, e.g. **no --drb**
236
- - [RSpec] remove `--loadby` from `.rspec`
237
- - [RSpec] Instantly see failures (instead of just a red F) with [rspec-instafail](https://github.com/grosser/rspec-instafail)
238
- - [RSpec] use [rspec-retry](https://github.com/NoRedInk/rspec-retry) (not rspec-rerun) to rerun failed tests.
239
- - [Cucumber] add a `parallel: foo` profile to your `config/cucumber.yml` and it will be used to run parallel tests
240
- - [Capybara setup](https://github.com/grosser/parallel_tests/wiki)
241
- - [Sphinx setup](https://github.com/grosser/parallel_tests/wiki)
242
- - [Capistrano setup](https://github.com/grosser/parallel_tests/wiki/Remotely-with-capistrano) let your tests run on a big box instead of your laptop
236
+
237
+ ### RSpec
238
+
239
+ - Add a `.rspec_parallel` to use different options, e.g. **no --drb**
240
+ - Remove `--loadby` from `.rspec`
241
+ - Instantly see failures (instead of just a red F) with [rspec-instafail](https://github.com/grosser/rspec-instafail)
242
+ - Use [rspec-retry](https://github.com/NoRedInk/rspec-retry) (not rspec-rerun) to rerun failed tests.
243
+
244
+ ### Cucumber
245
+
246
+ - Add a `parallel: foo` profile to your `config/cucumber.yml` and it will be used to run parallel tests
247
+ - [ReportBuilder](https://github.com/rajatthareja/ReportBuilder) can help with combining parallel test results
248
+ - Supports Cucumber 2.0+ and is actively maintained
249
+ - Combines many JSON files into a single file
250
+ - Builds a HTML report from JSON with support for debug msgs & embedded Base64 images.
251
+
252
+ ### General
243
253
  - [SQL schema format] use :ruby schema format to get faster parallel:prepare`
244
254
  - [ZSH] use quotes to use rake arguments `rake "parallel:prepare[3]"`
245
- - [email_spec and/or action_mailer_cache_delivery](https://github.com/grosser/parallel_tests/wiki)
246
- - [Memcached] use different namespaces e.g. `config.cache_store = ..., namespace: "test_#{ENV['TEST_ENV_NUMBER']}"`
247
- - [zeus-parallel_tests](https://github.com/sevos/zeus-parallel_tests)
248
- - [Distributed parallel test (e.g. Travis Support)](https://github.com/grosser/parallel_tests/wiki/Distributed-Parallel-Tests-and-Travis-Support)
255
+ - [Memcached] use different namespaces<br/>
256
+ e.g. `config.cache_store = ..., namespace: "test_#{ENV['TEST_ENV_NUMBER']}"`
257
+ - Debug errors that only happen with multiple files using `--verbose` and [cleanser](https://github.com/grosser/cleanser)
249
258
  - `export PARALLEL_TEST_PROCESSORS=13` to override default processor count
250
259
  - Shell alias: `alias prspec='parallel_rspec -m 2 --'`
251
260
  - [Spring] to use spring you have to [patch it](https://github.com/grosser/parallel_tests/wiki/Spring)
252
- - Contribute your own gotaches to the [Wiki](https://github.com/grosser/parallel_tests/wiki) or even better open a PR :)
261
+ - `--first-is-1` will make the first environment be `1`, so you can test while running your full suite.<br/>
262
+ `export PARALLEL_TEST_FIRST_IS_1=true` will provide the same result
263
+ - [email_spec and/or action_mailer_cache_delivery](https://github.com/grosser/parallel_tests/wiki)
264
+ - [zeus-parallel_tests](https://github.com/sevos/zeus-parallel_tests)
265
+ - [Distributed parallel test (e.g. Travis Support)](https://github.com/grosser/parallel_tests/wiki/Distributed-Parallel-Tests-and-Travis-Support)
266
+ - [Capybara setup](https://github.com/grosser/parallel_tests/wiki)
267
+ - [Sphinx setup](https://github.com/grosser/parallel_tests/wiki)
268
+ - [Capistrano setup](https://github.com/grosser/parallel_tests/wiki/Remotely-with-capistrano) let your tests run on a big box instead of your laptop
269
+
270
+ Contribute your own gotaches to the [Wiki](https://github.com/grosser/parallel_tests/wiki) or even better open a PR :)
253
271
 
254
272
  TODO
255
273
  ====
@@ -43,6 +43,10 @@ module ParallelTests
43
43
  end
44
44
  end
45
45
 
46
+ def suppress_schema_load_output(command)
47
+ ParallelTests::Tasks.suppress_output(command, "^ ->\\|^-- ")
48
+ end
49
+
46
50
  def check_for_pending_migrations
47
51
  ["db:abort_if_pending_migrations", "app:db:abort_if_pending_migrations"].each do |abort_migrations|
48
52
  if Rake::Task.task_defined?(abort_migrations)
@@ -72,6 +76,12 @@ module ParallelTests
72
76
  end
73
77
 
74
78
  namespace :parallel do
79
+ desc "setup test databases via db:setup --> parallel:setup[num_cpus]"
80
+ task :setup, :count do |_,args|
81
+ command = "rake db:setup RAILS_ENV=#{ParallelTests::Tasks.rails_env}"
82
+ ParallelTests::Tasks.run_in_parallel(ParallelTests::Tasks.suppress_schema_load_output(command), args)
83
+ end
84
+
75
85
  desc "create test databases via db:create --> parallel:create[num_cpus]"
76
86
  task :create, :count do |_,args|
77
87
  ParallelTests::Tasks.run_in_parallel("rake db:create RAILS_ENV=#{ParallelTests::Tasks.rails_env}", args)
@@ -107,7 +117,7 @@ namespace :parallel do
107
117
  desc "load dumped schema for test databases via db:schema:load --> parallel:load_schema[num_cpus]"
108
118
  task :load_schema, :count do |_,args|
109
119
  command = "rake #{ParallelTests::Tasks.purge_before_load} db:schema:load RAILS_ENV=#{ParallelTests::Tasks.rails_env}"
110
- ParallelTests::Tasks.run_in_parallel(ParallelTests::Tasks.suppress_output(command, "^ ->\\|^-- "), args)
120
+ ParallelTests::Tasks.run_in_parallel(ParallelTests::Tasks.suppress_schema_load_output(command), args)
111
121
  end
112
122
 
113
123
  # load the structure from the structure.sql file
@@ -1,3 +1,3 @@
1
1
  module ParallelTests
2
- VERSION = Version = '2.3.1'
2
+ VERSION = Version = '2.4.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parallel_tests
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-30 00:00:00.000000000 Z
11
+ date: 2016-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parallel