parallel_rspec 2.0.0 → 2.1.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 +4 -4
- data/README.md +2 -2
- data/lib/parallel_rspec/tasks.rake +15 -11
- data/lib/parallel_rspec/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d143dce3b81dac87bf01778c952ad87821de77b440e11fc5d24e270a932331e
|
4
|
+
data.tar.gz: f1ca46d4effc92cd59613f44dc4bf55015a3b8c70a025211dbd5a19421337730
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d72eae09b94e9d243f99ffd7c7d3ff8f97e2c77a6905cba37a738d66002ba298ff86990cb6069cbb323a9758b2bbd5b3c4ab09db8ee42a1dbd2d0a3b76243242
|
7
|
+
data.tar.gz: 486f0adb28955ae1f5f2c972ac26b0748d2691a9205b9c82a1c7b686a88c0a59deddfd9c85b5be92a98bd45ed9fe2ef616a80ea971143d86f0170bfdec97cc0b
|
data/README.md
CHANGED
@@ -53,14 +53,14 @@ You may like to make an alias:
|
|
53
53
|
|
54
54
|
When you change WORKERS, don't forget to restart Spring and re-run the create and populate steps above if necessary.
|
55
55
|
|
56
|
-
|
56
|
+
By default, there's a task called `parallel_rspec` which will run all specs. To make a custom rake task which uses parallel_rspec with different options, inherit from ParallelRSpec::RakeTask, for example:
|
57
57
|
|
58
58
|
```ruby
|
59
59
|
require 'parallel_rspec'
|
60
60
|
|
61
61
|
ParallelRSpec::RakeTask.new(:prspec) do |t|
|
62
62
|
ENV['WORKERS'] = '4'
|
63
|
-
t.pattern = "
|
63
|
+
t.pattern = "spec/**/*_spec.rb"
|
64
64
|
t.rspec_opts = "--tag parallel"
|
65
65
|
# etc...
|
66
66
|
end
|
@@ -2,21 +2,21 @@ require 'parallel_rspec/workers.rb'
|
|
2
2
|
|
3
3
|
db_namespace = namespace :db do
|
4
4
|
namespace :parallel do
|
5
|
-
|
5
|
+
desc "Creates the test databases"
|
6
6
|
task :create => [:load_config] do
|
7
7
|
ParallelRSpec::Workers.new.run_test_workers do |worker|
|
8
8
|
ActiveRecord::Tasks::DatabaseTasks.create ActiveRecord::Base.configurations['test']
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
|
-
|
12
|
+
desc "Empty the test databases"
|
13
13
|
task :purge => %w(environment load_config) do
|
14
14
|
ParallelRSpec::Workers.new.run_test_workers do |worker|
|
15
15
|
ActiveRecord::Tasks::DatabaseTasks.purge ActiveRecord::Base.configurations['test']
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
-
|
19
|
+
desc "Recreate the test databases from an existent schema.rb file"
|
20
20
|
task :load_schema => %w(db:parallel:purge) do
|
21
21
|
should_reconnect = ActiveRecord::Base.connection_pool.active_connection?
|
22
22
|
begin
|
@@ -35,7 +35,7 @@ db_namespace = namespace :db do
|
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
-
|
38
|
+
desc "Recreate the test databases from an existent structure.sql file"
|
39
39
|
task :load_structure => %w(db:parallel:purge) do
|
40
40
|
ParallelRSpec::Workers.new.run_test_workers do |worker|
|
41
41
|
if ActiveRecord::Tasks::DatabaseTasks.respond_to?(:load_schema_current)
|
@@ -46,18 +46,18 @@ db_namespace = namespace :db do
|
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
49
|
-
|
49
|
+
desc "Recreate the test databases from the current schema"
|
50
50
|
task :load do
|
51
|
-
db_namespace["
|
51
|
+
db_namespace["parallel:purge"].invoke
|
52
52
|
case ActiveRecord::Base.schema_format
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
53
|
+
when :ruby
|
54
|
+
db_namespace["parallel:load_schema"].invoke
|
55
|
+
when :sql
|
56
|
+
db_namespace["parallel:load_structure"].invoke
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
|
-
|
60
|
+
desc "Check for pending migrations and load the test schema"
|
61
61
|
task :prepare => %w(environment load_config) do
|
62
62
|
unless ActiveRecord::Base.configurations.blank?
|
63
63
|
db_namespace['parallel:load'].invoke
|
@@ -65,3 +65,7 @@ db_namespace = namespace :db do
|
|
65
65
|
end
|
66
66
|
end
|
67
67
|
end
|
68
|
+
|
69
|
+
ParallelRSpec::RakeTask.new(:parallel_rspec) do |t|
|
70
|
+
t.pattern = "spec/**/*_spec.rb"
|
71
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parallel_rspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Will Bryant, Powershop New Zealand Ltd
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|