minitest-distributed 0.2.11 → 0.2.12
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
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 722ec2cc00da4f9c5f5efc0591e39c2becc2338ce7fe171c60339d284116242b
|
|
4
|
+
data.tar.gz: aa1d3c52afa3b16c649a0b12d27e83ccb19ae11dd80fb68d3e57a669e0a081e5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c2cfc291aeb202bb680b04a6e579272fd907efe47ef1d5e5ea2b66ca5ffe23967ded9ea38458e485e1e9b42609d84a2058fd2df3250217cf76a60272f3b3255c
|
|
7
|
+
data.tar.gz: cb0934c54f7c3bdcc76abe8c0593b08e2e7ddfacd9cf2c4e7ce3a71e586b2e75170be91ebe3ac8b520fb7c8c7e4e961ae4a9a218c582bf1301dc916f41427847
|
data/dev.yml
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
require "redis"
|
|
5
5
|
require "set"
|
|
6
|
+
require "logger"
|
|
6
7
|
|
|
7
8
|
module Minitest
|
|
8
9
|
module Distributed
|
|
@@ -268,7 +269,25 @@ module Minitest
|
|
|
268
269
|
|
|
269
270
|
sig { returns(Redis) }
|
|
270
271
|
def redis
|
|
271
|
-
@redis ||= Redis.new(
|
|
272
|
+
@redis ||= Redis.new(
|
|
273
|
+
url: configuration.coordinator_uri.to_s,
|
|
274
|
+
middlewares: custom_middlewares,
|
|
275
|
+
custom: custom_config,
|
|
276
|
+
timeout: 2,
|
|
277
|
+
)
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
sig { returns(T.nilable(T::Array[Module])) }
|
|
281
|
+
def custom_middlewares
|
|
282
|
+
return unless ENV.key?("MINITEST_DISTRIBUTED_REDIS_LOG")
|
|
283
|
+
|
|
284
|
+
require_relative "redis_instrumentation_middleware"
|
|
285
|
+
[RedisInstrumentationMiddleware]
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
sig { returns(T.nilable(T::Hash[Symbol, File])) }
|
|
289
|
+
def custom_config
|
|
290
|
+
{ log_file: logger }.compact
|
|
272
291
|
end
|
|
273
292
|
|
|
274
293
|
sig { returns(String) }
|
|
@@ -517,6 +536,13 @@ module Minitest
|
|
|
517
536
|
adjust_combined_results(batch_result_aggregate)
|
|
518
537
|
end
|
|
519
538
|
|
|
539
|
+
sig { returns(T.nilable(Logger)) }
|
|
540
|
+
def logger
|
|
541
|
+
return unless (log_path = ENV["MINITEST_DISTRIBUTED_REDIS_LOG"])
|
|
542
|
+
|
|
543
|
+
@logger ||= T.let(Logger.new(log_path), T.nilable(Logger))
|
|
544
|
+
end
|
|
545
|
+
|
|
520
546
|
INITIAL_BACKOFF = 10 # milliseconds
|
|
521
547
|
private_constant :INITIAL_BACKOFF
|
|
522
548
|
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# typed: strict
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
require "redis"
|
|
5
|
+
|
|
6
|
+
module Minitest
|
|
7
|
+
module Distributed
|
|
8
|
+
module Coordinators
|
|
9
|
+
# Redis middleware that logs all Redis commands to a file for debugging.
|
|
10
|
+
module RedisInstrumentationMiddleware
|
|
11
|
+
extend T::Sig
|
|
12
|
+
|
|
13
|
+
sig { params(command: T::Array[T.untyped], redis_config: T.untyped).returns(T.untyped) }
|
|
14
|
+
def call(command, redis_config)
|
|
15
|
+
log_file = redis_config.custom[:log_file]
|
|
16
|
+
log_file.info("EXEC: #{command.inspect}")
|
|
17
|
+
result = super
|
|
18
|
+
log_file.info("RESULT: #{result.inspect}")
|
|
19
|
+
result
|
|
20
|
+
rescue => e
|
|
21
|
+
log_file.info("ERROR: #{e.class}")
|
|
22
|
+
Kernel.raise
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
sig { params(commands: T::Array[T.untyped], redis_config: T.untyped).returns(T.untyped) }
|
|
26
|
+
def call_pipelined(commands, redis_config)
|
|
27
|
+
log_file = redis_config.custom[:log_file]
|
|
28
|
+
log_file.info("EXEC PIPELINED: #{commands.inspect}")
|
|
29
|
+
result = super
|
|
30
|
+
log_file.info("RESULT PIPELINED: #{result.inspect}")
|
|
31
|
+
result
|
|
32
|
+
rescue => e
|
|
33
|
+
log_file.info("ERROR PIPELINED: #{e.class}")
|
|
34
|
+
Kernel.raise
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: minitest-distributed
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.12
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Willem van Bergen
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: minitest
|
|
@@ -116,6 +115,7 @@ files:
|
|
|
116
115
|
- lib/minitest/distributed/coordinators/coordinator_interface.rb
|
|
117
116
|
- lib/minitest/distributed/coordinators/memory_coordinator.rb
|
|
118
117
|
- lib/minitest/distributed/coordinators/redis_coordinator.rb
|
|
118
|
+
- lib/minitest/distributed/coordinators/redis_instrumentation_middleware.rb
|
|
119
119
|
- lib/minitest/distributed/enqueued_runnable.rb
|
|
120
120
|
- lib/minitest/distributed/filters/exclude_file_filter.rb
|
|
121
121
|
- lib/minitest/distributed/filters/exclude_filter.rb
|
|
@@ -169,7 +169,6 @@ metadata:
|
|
|
169
169
|
allowed_push_host: https://rubygems.org
|
|
170
170
|
homepage_uri: https://github.com/Shopify/minitest-distributed
|
|
171
171
|
source_code_uri: https://github.com/Shopify/minitest-distributed
|
|
172
|
-
post_install_message:
|
|
173
172
|
rdoc_options: []
|
|
174
173
|
require_paths:
|
|
175
174
|
- lib
|
|
@@ -184,8 +183,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
184
183
|
- !ruby/object:Gem::Version
|
|
185
184
|
version: '0'
|
|
186
185
|
requirements: []
|
|
187
|
-
rubygems_version: 3.
|
|
188
|
-
signing_key:
|
|
186
|
+
rubygems_version: 3.7.2
|
|
189
187
|
specification_version: 4
|
|
190
188
|
summary: Distributed test executor plugin for Minitest
|
|
191
189
|
test_files: []
|