parallel_tests 3.7.3 → 3.8.1
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/lib/parallel_tests/pids.rb +2 -2
- data/lib/parallel_tests/tasks.rb +33 -9
- data/lib/parallel_tests/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4a7071d3e5afb39f01dd57304c8fab20d985f25c2f3699a7f6e69074715e576
|
4
|
+
data.tar.gz: 64b9cb4fb05ed5cfc04554bc6fb04960fbefdf0ac756062fe01e7e15383fb1bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61639ad8b786efee4bd6e868d244531008d7eade53e3fb419f26ce7688a0b10d8609624f078e48562b3ac5ffb4560515e2ac869ebb6ddcb7616c10e869d22f70
|
7
|
+
data.tar.gz: 2f15bd174e7e5064efa7186cdb604620cdd8aa0fb11d7702c4db3f8f558ca972385d65af51dade0ee8adaf80229673785f57c9160e3d38046c56a0ce539217c3
|
data/lib/parallel_tests/pids.rb
CHANGED
@@ -43,14 +43,14 @@ module ParallelTests
|
|
43
43
|
|
44
44
|
def read
|
45
45
|
sync do
|
46
|
-
contents =
|
46
|
+
contents = File.read(file_path)
|
47
47
|
return if contents.empty?
|
48
48
|
@pids = JSON.parse(contents)
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
52
|
def save
|
53
|
-
sync {
|
53
|
+
sync { File.write(file_path, pids.to_json) }
|
54
54
|
end
|
55
55
|
|
56
56
|
def sync(&block)
|
data/lib/parallel_tests/tasks.rb
CHANGED
@@ -92,6 +92,32 @@ module ParallelTests
|
|
92
92
|
|
93
93
|
[num_processes, pattern.to_s, options.to_s, pass_through.to_s]
|
94
94
|
end
|
95
|
+
|
96
|
+
def schema_format_based_on_rails_version
|
97
|
+
if rails_7_or_greater?
|
98
|
+
ActiveRecord.schema_format
|
99
|
+
else
|
100
|
+
ActiveRecord::Base.schema_format
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
def schema_type_based_on_rails_version
|
105
|
+
if rails_61_or_greater? || schema_format_based_on_rails_version == :ruby
|
106
|
+
"schema"
|
107
|
+
else
|
108
|
+
"structure"
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
private
|
113
|
+
|
114
|
+
def rails_7_or_greater?
|
115
|
+
Gem::Version.new(Rails.version) >= Gem::Version.new('7.0')
|
116
|
+
end
|
117
|
+
|
118
|
+
def rails_61_or_greater?
|
119
|
+
Gem::Version.new(Rails.version) >= Gem::Version.new('6.1.0')
|
120
|
+
end
|
95
121
|
end
|
96
122
|
end
|
97
123
|
end
|
@@ -121,14 +147,10 @@ namespace :parallel do
|
|
121
147
|
desc "Update test databases by dumping and loading --> parallel:prepare[num_cpus]"
|
122
148
|
task(:prepare, [:count]) do |_, args|
|
123
149
|
ParallelTests::Tasks.check_for_pending_migrations
|
124
|
-
|
150
|
+
|
151
|
+
if defined?(ActiveRecord) && [:ruby, :sql].include?(ParallelTests::Tasks.schema_format_based_on_rails_version)
|
125
152
|
# fast: dump once, load in parallel
|
126
|
-
type =
|
127
|
-
if Gem::Version.new(Rails.version) >= Gem::Version.new('6.1.0')
|
128
|
-
"schema"
|
129
|
-
else
|
130
|
-
ActiveRecord::Base.schema_format == :ruby ? "schema" : "structure"
|
131
|
-
end
|
153
|
+
type = ParallelTests::Tasks.schema_type_based_on_rails_version
|
132
154
|
|
133
155
|
Rake::Task["db:#{type}:dump"].invoke
|
134
156
|
|
@@ -163,7 +185,8 @@ namespace :parallel do
|
|
163
185
|
# just load the schema (good for integration server <-> no development db)
|
164
186
|
desc "Load dumped schema for test databases via db:schema:load --> parallel:load_schema[num_cpus]"
|
165
187
|
task :load_schema, :count do |_, args|
|
166
|
-
command =
|
188
|
+
command =
|
189
|
+
"#{ParallelTests::Tasks.rake_bin} #{ParallelTests::Tasks.purge_before_load} " \
|
167
190
|
"db:schema:load RAILS_ENV=#{ParallelTests::Tasks.rails_env} DISABLE_DATABASE_ENVIRONMENT_CHECK=1"
|
168
191
|
ParallelTests::Tasks.run_in_parallel(ParallelTests::Tasks.suppress_schema_load_output(command), args)
|
169
192
|
end
|
@@ -211,7 +234,8 @@ namespace :parallel do
|
|
211
234
|
# Using the relative path to find the binary allow to run a specific version of it
|
212
235
|
executable = File.join(File.dirname(__FILE__), '..', '..', 'bin', 'parallel_test')
|
213
236
|
|
214
|
-
command =
|
237
|
+
command =
|
238
|
+
"#{ParallelTests.with_ruby_binary(Shellwords.escape(executable))} #{type} " \
|
215
239
|
"--type #{test_framework} " \
|
216
240
|
"-n #{count} " \
|
217
241
|
"--pattern '#{pattern}' " \
|
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: 3.
|
4
|
+
version: 3.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel
|
@@ -68,8 +68,8 @@ licenses:
|
|
68
68
|
- MIT
|
69
69
|
metadata:
|
70
70
|
bug_tracker_uri: https://github.com/grosser/parallel_tests/issues
|
71
|
-
documentation_uri: https://github.com/grosser/parallel_tests/blob/v3.
|
72
|
-
source_code_uri: https://github.com/grosser/parallel_tests/tree/v3.
|
71
|
+
documentation_uri: https://github.com/grosser/parallel_tests/blob/v3.8.1/Readme.md
|
72
|
+
source_code_uri: https://github.com/grosser/parallel_tests/tree/v3.8.1
|
73
73
|
wiki_uri: https://github.com/grosser/parallel_tests/wiki
|
74
74
|
post_install_message:
|
75
75
|
rdoc_options: []
|
@@ -86,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
86
86
|
- !ruby/object:Gem::Version
|
87
87
|
version: '0'
|
88
88
|
requirements: []
|
89
|
-
rubygems_version: 3.
|
89
|
+
rubygems_version: 3.3.10
|
90
90
|
signing_key:
|
91
91
|
specification_version: 4
|
92
92
|
summary: Run Test::Unit / RSpec / Cucumber / Spinach in parallel
|