turbo_tests 2.2.0 → 2.2.2
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 +3 -1
- 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 -0
- data/lib/utils/hash_extension.rb +2 -4
- data/turbo_tests.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ee7cf1d2645f6c5d1ab7088ad50f239269c302d05adf783640976389c7366ad
|
4
|
+
data.tar.gz: 5e8e203558a4a6d04fa16f3335114fe626df75bc21cd4c92d9a7e7e9fca53e04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65511e7eae9bf5a2dc40be0c39f7d0f970a40196f2c52791d0a87231606e078cc922d51b83285c50e7f7fedafb95a05a613ee6691f927dcf9c3756dd00009685
|
7
|
+
data.tar.gz: c6cc417e63a8385d7f25e245e9a923a16588b3d8099645f049de905041e61f43fe96d0f58145a81e1d357038dbaa3fe72d5622451720a997e1c2027162387491
|
data/.github/workflows/tests.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
turbo_tests (2.2.
|
4
|
+
turbo_tests (2.2.2)
|
5
|
+
json (~> 2.3)
|
5
6
|
parallel_tests (>= 3.3.0, < 5)
|
6
7
|
rspec (>= 3.10)
|
7
8
|
|
@@ -10,6 +11,7 @@ GEM
|
|
10
11
|
specs:
|
11
12
|
coderay (1.1.3)
|
12
13
|
diff-lcs (1.5.0)
|
14
|
+
json (2.7.2)
|
13
15
|
method_source (1.0.0)
|
14
16
|
parallel (1.22.1)
|
15
17
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Illia Zub
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -44,6 +44,20 @@ 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'
|
47
61
|
- !ruby/object:Gem::Dependency
|
48
62
|
name: pry
|
49
63
|
requirement: !ruby/object:Gem::Requirement
|