turbo_tests 2.2.1 → 2.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/tests.yml +2 -1
- data/Gemfile.lock +1 -3
- data/lib/turbo_tests/json_rows_formatter.rb +1 -1
- data/lib/turbo_tests/runner.rb +31 -27
- data/lib/turbo_tests/version.rb +1 -1
- data/lib/turbo_tests.rb +2 -1
- data/lib/utils/hash_extension.rb +2 -4
- data/turbo_tests.gemspec +0 -1
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8839d105f1c8a6011d5d9796b22d39c56ec2a419afadde707bd4efa01892e2c3
|
4
|
+
data.tar.gz: 861501c3f6f15e7d1baa0ad823a0602d99eb46ff5ec577ef3cd39b9ed1fe3657
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02d41594c07d5e6aeb35d7eddabacb1052a1677d17e41ee86a092c7226f411ca59cce785efc0321073140940390458976fd3231e83de4ff6ed35b25561358639
|
7
|
+
data.tar.gz: 5404af69067ca602dad75aece1d1b4476ecc72a3b380e37df79ed91dce8a8968fee76d41a347fca7de8a839f5db438790010b5fee2a0b493f653c256da3dd793
|
data/.github/workflows/tests.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
turbo_tests (2.2.
|
5
|
-
json (~> 2.3)
|
4
|
+
turbo_tests (2.2.3)
|
6
5
|
parallel_tests (>= 3.3.0, < 5)
|
7
6
|
rspec (>= 3.10)
|
8
7
|
|
@@ -11,7 +10,6 @@ GEM
|
|
11
10
|
specs:
|
12
11
|
coderay (1.1.3)
|
13
12
|
diff-lcs (1.5.0)
|
14
|
-
json (2.7.2)
|
15
13
|
method_source (1.0.0)
|
16
14
|
parallel (1.22.1)
|
17
15
|
parallel_tests (4.2.0)
|
data/lib/turbo_tests/runner.rb
CHANGED
@@ -24,7 +24,7 @@ module TurboTests
|
|
24
24
|
seed_used = !opts[:seed].nil?
|
25
25
|
|
26
26
|
if verbose
|
27
|
-
|
27
|
+
warn "VERBOSE"
|
28
28
|
end
|
29
29
|
|
30
30
|
reporter = Reporter.from_config(formatters, start_time)
|
@@ -134,19 +134,19 @@ module TurboTests
|
|
134
134
|
if tests.empty?
|
135
135
|
@messages << {
|
136
136
|
type: "exit",
|
137
|
-
process_id: process_id
|
137
|
+
process_id: process_id,
|
138
138
|
}
|
139
139
|
else
|
140
|
-
|
141
|
-
|
142
|
-
begin
|
143
|
-
File.mkfifo(tmp_filename)
|
144
|
-
rescue Errno::EEXIST
|
145
|
-
end
|
146
|
-
|
140
|
+
env["RSPEC_FORMATTER_OUTPUT_ID"] = SecureRandom.uuid
|
147
141
|
env["RUBYOPT"] = ["-I#{File.expand_path("..", __dir__)}", ENV["RUBYOPT"]].compact.join(" ")
|
148
142
|
env["RSPEC_SILENCE_FILTER_ANNOUNCEMENTS"] = "1"
|
149
143
|
|
144
|
+
if ENV["BUNDLE_BIN_PATH"]
|
145
|
+
command_name = [ENV["BUNDLE_BIN_PATH"], "exec", "rspec"]
|
146
|
+
else
|
147
|
+
command_name = "rspec"
|
148
|
+
end
|
149
|
+
|
150
150
|
record_runtime_options =
|
151
151
|
if record_runtime
|
152
152
|
[
|
@@ -158,23 +158,23 @@ module TurboTests
|
|
158
158
|
end
|
159
159
|
|
160
160
|
command = [
|
161
|
-
|
161
|
+
*command_name,
|
162
162
|
*extra_args,
|
163
|
-
"--seed",
|
163
|
+
"--seed", rand(0xFFFF).to_s,
|
164
|
+
"--format", "ParallelTests::RSpec::RuntimeLogger",
|
165
|
+
"--out", @runtime_log,
|
164
166
|
"--format", "TurboTests::JsonRowsFormatter",
|
165
|
-
"--out", tmp_filename,
|
166
167
|
*record_runtime_options,
|
167
|
-
*tests
|
168
|
+
*tests,
|
168
169
|
]
|
169
|
-
command.unshift(ENV["BUNDLE_BIN_PATH"], "exec") if ENV["BUNDLE_BIN_PATH"]
|
170
170
|
|
171
171
|
if @verbose
|
172
172
|
command_str = [
|
173
173
|
env.map { |k, v| "#{k}=#{v}" }.join(" "),
|
174
|
-
command.join(" ")
|
174
|
+
command.join(" "),
|
175
175
|
].select { |x| x.size > 0 }.join(" ")
|
176
176
|
|
177
|
-
|
177
|
+
warn "Process #{process_id}: #{command_str}"
|
178
178
|
end
|
179
179
|
|
180
180
|
stdin, stdout, stderr, wait_thr = Open3.popen3(env, *command)
|
@@ -182,26 +182,30 @@ module TurboTests
|
|
182
182
|
|
183
183
|
@threads <<
|
184
184
|
Thread.new do
|
185
|
-
|
186
|
-
|
187
|
-
|
185
|
+
stdout.each_line do |line|
|
186
|
+
result = line.split(env["RSPEC_FORMATTER_OUTPUT_ID"])
|
187
|
+
|
188
|
+
output = result.shift
|
189
|
+
print(output) unless output.empty?
|
190
|
+
|
191
|
+
message = result.shift
|
192
|
+
next unless message
|
188
193
|
|
189
|
-
|
190
|
-
|
191
|
-
|
194
|
+
message = JSON.parse(message, symbolize_names: true)
|
195
|
+
message[:process_id] = process_id
|
196
|
+
@messages << message
|
192
197
|
end
|
193
198
|
|
194
|
-
@messages << {type: "exit", process_id: process_id}
|
199
|
+
@messages << { type: "exit", process_id: process_id }
|
195
200
|
end
|
196
201
|
|
197
|
-
@threads << start_copy_thread(stdout, STDOUT)
|
198
202
|
@threads << start_copy_thread(stderr, STDERR)
|
199
203
|
|
200
|
-
@threads << Thread.new
|
204
|
+
@threads << Thread.new do
|
201
205
|
unless wait_thr.value.success?
|
202
|
-
@messages << {type: "error"}
|
206
|
+
@messages << { type: "error" }
|
203
207
|
end
|
204
|
-
|
208
|
+
end
|
205
209
|
|
206
210
|
wait_thr
|
207
211
|
end
|
data/lib/turbo_tests/version.rb
CHANGED
data/lib/turbo_tests.rb
CHANGED
data/lib/utils/hash_extension.rb
CHANGED
@@ -1,9 +1,7 @@
|
|
1
1
|
module CoreExtensions
|
2
2
|
refine Hash do
|
3
3
|
def to_struct
|
4
|
-
|
5
|
-
acc[key] = val.is_a?(Hash) ? val.to_struct : val
|
6
|
-
end)
|
4
|
+
Struct.new(*self.keys).new(*self.values.map { |value| value.is_a?(Hash) ? value.to_struct : value })
|
7
5
|
end
|
8
6
|
end
|
9
|
-
end
|
7
|
+
end
|
data/turbo_tests.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: turbo_tests
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Illia Zub
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-04-
|
11
|
+
date: 2024-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -44,20 +44,6 @@ dependencies:
|
|
44
44
|
- - "<"
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '5'
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: json
|
49
|
-
requirement: !ruby/object:Gem::Requirement
|
50
|
-
requirements:
|
51
|
-
- - "~>"
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '2.3'
|
54
|
-
type: :runtime
|
55
|
-
prerelease: false
|
56
|
-
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
requirements:
|
58
|
-
- - "~>"
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: '2.3'
|
61
47
|
- !ruby/object:Gem::Dependency
|
62
48
|
name: pry
|
63
49
|
requirement: !ruby/object:Gem::Requirement
|