minitest-retry 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ubuntu.yml +1 -1
- data/CHANGELOG.md +4 -0
- data/Gemfile +1 -1
- data/README.md +2 -1
- data/bin/console +2 -6
- data/lib/minitest/retry/version.rb +1 -1
- data/lib/minitest/retry.rb +10 -2
- metadata +3 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a31833391dfea9565ad1373bbf959f8e910fd618160a54be9ca641aebb68eda
|
4
|
+
data.tar.gz: 247aa4a9466e5f60484f68d865c34b7e61d2ba9a05cbea098e4a6be1eb6a772e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93abe11a1cdf89faf10f95f1cd1c1412696f77c5210d96b7ff2c160f6abc56d067e5324e7623216a28a32df649b11276c4a4f376126d21ab420ccac1a86a382c
|
7
|
+
data.tar.gz: 18487273718ca12691ecfd2cf791ecf9a5fa0366b0689a82b9eb9bc5213c0775fb365bbee06c8aa110bd09895d2028838987341d10e5b1de73e04251f6653429
|
@@ -7,7 +7,7 @@ jobs:
|
|
7
7
|
runs-on: ubuntu-latest
|
8
8
|
strategy:
|
9
9
|
matrix:
|
10
|
-
ruby: [ '3.3', '3.2', '3.1', '3.0', '2.7', '2.6', '2.5', '2.4', '2.3' ]
|
10
|
+
ruby: [ '3.4', '3.3', '3.2', '3.1', '3.0', '2.7', '2.6', '2.5', '2.4', '2.3' ]
|
11
11
|
steps:
|
12
12
|
- uses: actions/checkout@v4
|
13
13
|
- uses: ruby/setup-ruby@v1
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -39,7 +39,8 @@ Minitest::Retry.use!(
|
|
39
39
|
io: $stdout, # Display destination of retry when the message. The default is stdout.
|
40
40
|
exceptions_to_retry: [], # List of exceptions that will trigger a retry (when empty, all exceptions will).
|
41
41
|
methods_to_retry: [], # List of methods that will trigger a retry (when empty, all methods will).
|
42
|
-
classes_to_retry: []
|
42
|
+
classes_to_retry: [], # List of classes that will trigger a retry (when empty, all classes will).
|
43
|
+
methods_to_skip: [] # List of methods that will skip a retry (when empty, all methods will retry).
|
43
44
|
)
|
44
45
|
```
|
45
46
|
|
data/bin/console
CHANGED
@@ -3,9 +3,5 @@
|
|
3
3
|
require "bundler/setup"
|
4
4
|
require "minitest/retry"
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
require "pry"
|
11
|
-
Pry.start
|
6
|
+
require "irb"
|
7
|
+
IRB.start(__FILE__)
|
data/lib/minitest/retry.rb
CHANGED
@@ -3,8 +3,8 @@ require "minitest/retry/version"
|
|
3
3
|
module Minitest
|
4
4
|
module Retry
|
5
5
|
class << self
|
6
|
-
def use!(retry_count: 3, io: $stdout, verbose: true, exceptions_to_retry: [], methods_to_retry: [], classes_to_retry: [])
|
7
|
-
@retry_count, @io, @verbose, @exceptions_to_retry, @methods_to_retry, @classes_to_retry = retry_count, io, verbose, exceptions_to_retry, methods_to_retry, classes_to_retry
|
6
|
+
def use!(retry_count: 3, io: $stdout, verbose: true, exceptions_to_retry: [], methods_to_retry: [], classes_to_retry: [], methods_to_skip: [])
|
7
|
+
@retry_count, @io, @verbose, @exceptions_to_retry, @methods_to_retry, @classes_to_retry, @methods_to_skip = retry_count, io, verbose, exceptions_to_retry, methods_to_retry, classes_to_retry, methods_to_skip
|
8
8
|
@failure_callback, @consistent_failure_callback, @retry_callback = nil, nil, nil
|
9
9
|
Minitest.prepend(self)
|
10
10
|
end
|
@@ -60,6 +60,10 @@ module Minitest
|
|
60
60
|
@retry_callback
|
61
61
|
end
|
62
62
|
|
63
|
+
def methods_to_skip
|
64
|
+
@methods_to_skip
|
65
|
+
end
|
66
|
+
|
63
67
|
def failure_to_retry?(failures = [], klass_method_name, klass)
|
64
68
|
return false if failures.empty?
|
65
69
|
|
@@ -72,6 +76,10 @@ module Minitest
|
|
72
76
|
return (errors & exceptions_to_retry).any?
|
73
77
|
end
|
74
78
|
|
79
|
+
if methods_to_skip.any?
|
80
|
+
return !methods_to_skip.include?(klass_method_name)
|
81
|
+
end
|
82
|
+
|
75
83
|
return true if classes_to_retry.empty?
|
76
84
|
ancestors = klass.ancestors.map(&:to_s)
|
77
85
|
return classes_to_retry.any? { |class_to_retry| ancestors.include?(class_to_retry) }
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest-retry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuji Yaginuma
|
8
|
-
autorequire:
|
9
8
|
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-01-26 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: minitest
|
@@ -78,7 +77,6 @@ licenses:
|
|
78
77
|
metadata:
|
79
78
|
allowed_push_host: https://rubygems.org
|
80
79
|
rubygems_mfa_required: 'true'
|
81
|
-
post_install_message:
|
82
80
|
rdoc_options: []
|
83
81
|
require_paths:
|
84
82
|
- lib
|
@@ -93,8 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
91
|
- !ruby/object:Gem::Version
|
94
92
|
version: '0'
|
95
93
|
requirements: []
|
96
|
-
rubygems_version: 3.
|
97
|
-
signing_key:
|
94
|
+
rubygems_version: 3.6.2
|
98
95
|
specification_version: 4
|
99
96
|
summary: re-run the test when the test fails
|
100
97
|
test_files: []
|