minitest-mergify 2026.11.5 → 2026.11.7
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/README.md +6 -1
- data/THIRD_PARTY_LICENSES +6 -6
- data/lib/mergify/minitest/plugin.rb +30 -10
- data/lib/mergify/minitest/reruns.rb +6 -3
- data/lib/mergify/minitest/selection.rb +5 -3
- data/lib/mergify/minitest/test_run.rb +16 -2
- data/lib/mergify/minitest/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 954d1f842aa88d2da7525893040f8dc0dc4f744a41392acf97c5b883cdb2e716
|
|
4
|
+
data.tar.gz: cc63837aa0ca9909db56881f0b6498ec75437aeae82fb9717809cdb99eb4c666
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8e98e4dc0486720fa07e4d5fe9a5fc519b5e85780c4c1dbd8600ce4627f94e491d5b32e9f14bea2a23c58c5950cf58b0740412e71f53bb6680c06b752c8321ef
|
|
7
|
+
data.tar.gz: cd519906762da51469a2011cf9a42a6bc670589b0730f26820b13688117e2d46b37abd13b2ec082e4d0cc91a03fffa014fa37b744675c4481e7c2101d4984ecf
|
data/README.md
CHANGED
|
@@ -6,6 +6,7 @@ Minitest plugin for [Mergify Test Engine](https://docs.mergify.com/test-engine/)
|
|
|
6
6
|
|
|
7
7
|
- **Test tracing** — Sends OpenTelemetry traces for every test to Mergify's API
|
|
8
8
|
- **Test quarantine** — Quarantines failing tests so they don't block CI
|
|
9
|
+
- **Test skip** — Skips the tests a team chose in Mergify not to run, with the reason
|
|
9
10
|
- **Test selection** — Runs first the tests that failed in a merge-queue bisection step, and stops once one fails again
|
|
10
11
|
- **Flaky test detection** — Reruns new tests to catch flaky ones before they merge
|
|
11
12
|
- **Test retry** — On the default branch, runs a failing test again, within a time budget Mergify sets
|
|
@@ -36,7 +37,7 @@ Ruby 3.2 and later: tests in classes and in `describe` blocks, run in one
|
|
|
36
37
|
process, in Minitest's threads (`parallelize_me!`) or in Rails' parallel
|
|
37
38
|
workers (`parallelize`). It runs on `mergify-ci-core`, which Bundler installs
|
|
38
39
|
with it and which ships precompiled for Linux (glibc 2.28 or newer, and musl),
|
|
39
|
-
macOS and Windows.
|
|
40
|
+
macOS (Intel Macs as best effort, not tested before a release) and Windows.
|
|
40
41
|
|
|
41
42
|
## Configuration
|
|
42
43
|
|
|
@@ -66,6 +67,10 @@ as a skip. A test quarantined while the repository uploaded JUnit reports is
|
|
|
66
67
|
known under the name minitest-junit and minitest-reporters gave it,
|
|
67
68
|
`UserTest.test_valid`, and is quarantined under that name too.
|
|
68
69
|
|
|
70
|
+
A test Mergify skips does not run: it skips itself before its `setup`, as
|
|
71
|
+
Minitest's `skip` does, with Mergify's reason, and is reported skipped. Its
|
|
72
|
+
teardown still runs, as for any skip.
|
|
73
|
+
|
|
69
74
|
### Fail First
|
|
70
75
|
|
|
71
76
|
When Mergify's merge queue splits a batch that failed, the tests that failed
|
data/THIRD_PARTY_LICENSES
CHANGED
|
@@ -4886,7 +4886,6 @@ Used by:
|
|
|
4886
4886
|
- async-signal 0.2.14 (https://github.com/smol-rs/async-signal)
|
|
4887
4887
|
- async-task 4.7.1 (https://github.com/smol-rs/async-task)
|
|
4888
4888
|
- atomic-waker 1.1.2 (https://github.com/smol-rs/atomic-waker)
|
|
4889
|
-
- base64 0.22.1 (https://github.com/marshallpierce/rust-base64)
|
|
4890
4889
|
- base64 0.23.1 (https://github.com/marshallpierce/rust-base64)
|
|
4891
4890
|
- bitflags 2.13.1 (https://github.com/bitflags/bitflags)
|
|
4892
4891
|
- blocking 1.7.0 (https://github.com/smol-rs/blocking)
|
|
@@ -6230,6 +6229,7 @@ APPENDIX: How to apply the Apache License to your work.
|
|
|
6230
6229
|
Apache License 2.0 (Apache-2.0)
|
|
6231
6230
|
|
|
6232
6231
|
Used by:
|
|
6232
|
+
- getrandom 0.2.17 (https://github.com/rust-random/getrandom)
|
|
6233
6233
|
- getrandom 0.3.4 (https://github.com/rust-random/getrandom)
|
|
6234
6234
|
- getrandom 0.4.3 (https://github.com/rust-random/getrandom)
|
|
6235
6235
|
|
|
@@ -10332,10 +10332,10 @@ SOFTWARE.
|
|
|
10332
10332
|
MIT License (MIT)
|
|
10333
10333
|
|
|
10334
10334
|
Used by:
|
|
10335
|
-
- jsonschema-regex 0.
|
|
10336
|
-
- jsonschema-value 0.
|
|
10337
|
-
- jsonschema 0.
|
|
10338
|
-
- referencing 0.
|
|
10335
|
+
- jsonschema-regex 0.61.0 (https://github.com/Stranger6667/jsonschema)
|
|
10336
|
+
- jsonschema-value 0.61.0 (https://github.com/Stranger6667/jsonschema)
|
|
10337
|
+
- jsonschema 0.61.0 (https://github.com/Stranger6667/jsonschema)
|
|
10338
|
+
- referencing 0.61.0 (https://github.com/Stranger6667/jsonschema)
|
|
10339
10339
|
|
|
10340
10340
|
MIT License
|
|
10341
10341
|
|
|
@@ -10707,7 +10707,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
10707
10707
|
MIT License (MIT)
|
|
10708
10708
|
|
|
10709
10709
|
Used by:
|
|
10710
|
-
- fancy-regex 0.
|
|
10710
|
+
- fancy-regex 0.20.0 (https://github.com/fancy-regex/fancy-regex)
|
|
10711
10711
|
|
|
10712
10712
|
The MIT License
|
|
10713
10713
|
|
|
@@ -28,6 +28,18 @@ module Mergify
|
|
|
28
28
|
end
|
|
29
29
|
end
|
|
30
30
|
|
|
31
|
+
# A test the session skips skips itself, as Minitest's `skip` does,
|
|
32
|
+
# before its `setup` and its body run; its teardown still runs, as for
|
|
33
|
+
# any skip. Wherever it runs: inline, in Minitest's threads, in Rails'
|
|
34
|
+
# forked workers.
|
|
35
|
+
module Skipping
|
|
36
|
+
def before_setup
|
|
37
|
+
reason = Plugin.skip_reason(self)
|
|
38
|
+
skip(reason) if reason
|
|
39
|
+
super
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
31
43
|
# The suites Minitest runs, once or in Fail First's two passes: the
|
|
32
44
|
# loop is `run_all_suites` in Minitest 6, `__run` in Minitest 5.
|
|
33
45
|
module Passes
|
|
@@ -61,34 +73,41 @@ module Mergify
|
|
|
61
73
|
start(reporter, test_run, options)
|
|
62
74
|
end
|
|
63
75
|
|
|
76
|
+
# Why the session skips `test`, a Minitest test about to run, or nil
|
|
77
|
+
# to run it: asked under its name and its former one.
|
|
78
|
+
def skip_reason(test)
|
|
79
|
+
file = test.class.instance_method(test.name).source_location&.first
|
|
80
|
+
return unless file
|
|
81
|
+
|
|
82
|
+
named = @names.of(test.class.name, test.name, file)
|
|
83
|
+
Mergify::Minitest.test_run.skip_reason([named.name, named.former])
|
|
84
|
+
end
|
|
85
|
+
|
|
64
86
|
# The run's suites, as the selection runs them, once the session
|
|
65
87
|
# prepared its reruns; then test retry's retries and flaky
|
|
66
|
-
# detection's reruns
|
|
67
|
-
#
|
|
68
|
-
# held back for flaky detection's reruns.
|
|
88
|
+
# detection's reruns, which the session keeps from a run that
|
|
89
|
+
# stopped, and last the failures test retry held back for them.
|
|
69
90
|
def run_suites(reporter, &)
|
|
70
91
|
return yield unless @selection
|
|
71
92
|
|
|
72
93
|
@reruns.prepare
|
|
73
94
|
@selection.run(@recorder, &)
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
@reruns.run(reporter, @recorder)
|
|
77
|
-
end
|
|
95
|
+
@retries.settle(@recorder, @selection.names_to_run)
|
|
96
|
+
@reruns.run(reporter, @recorder)
|
|
78
97
|
@recorder.release_held(reporter)
|
|
79
98
|
end
|
|
80
99
|
|
|
81
100
|
private
|
|
82
101
|
|
|
83
102
|
def start(reporter, test_run, options)
|
|
84
|
-
names = Names.new(::Minitest::Runnable.runnables, Dir.pwd)
|
|
103
|
+
@names = Names.new(::Minitest::Runnable.runnables, Dir.pwd)
|
|
85
104
|
# Collected as Minitest's filters leave the tests, before any
|
|
86
105
|
# selection narrows them.
|
|
87
106
|
@selection = nil
|
|
88
|
-
@selection = select(test_run, names, options)
|
|
107
|
+
@selection = select(test_run, @names, options)
|
|
89
108
|
@reruns = @selection && Reruns.new(test_run, @selection)
|
|
90
109
|
@retries = @selection && Retries.new(test_run, @selection, @reruns)
|
|
91
|
-
@recorder = Recorder.new(test_run, names, options[:io] || $stdout, @selection, @reruns, @retries)
|
|
110
|
+
@recorder = Recorder.new(test_run, @names, options[:io] || $stdout, @selection, @reruns, @retries)
|
|
92
111
|
@recorder.attach(reporter)
|
|
93
112
|
install
|
|
94
113
|
end
|
|
@@ -108,6 +127,7 @@ module Mergify
|
|
|
108
127
|
def install
|
|
109
128
|
::Minitest::Test.singleton_class.prepend(Narrowing) unless ::Minitest::Test.singleton_class < Narrowing
|
|
110
129
|
::Minitest.singleton_class.prepend(Passes) unless ::Minitest.singleton_class < Passes
|
|
130
|
+
::Minitest::Test.prepend(Skipping) unless ::Minitest::Test < Skipping
|
|
111
131
|
end
|
|
112
132
|
end
|
|
113
133
|
end
|
|
@@ -44,10 +44,13 @@ module Mergify
|
|
|
44
44
|
@test_run.record_attempt(name, outcome, duration_ms)
|
|
45
45
|
end
|
|
46
46
|
|
|
47
|
-
# Rerun what flaky detection targets, once
|
|
48
|
-
#
|
|
49
|
-
#
|
|
47
|
+
# Rerun what flaky detection targets, once the run's tests and every
|
|
48
|
+
# retry of them are over, as the session plans it, and once `recorder`
|
|
49
|
+
# recorded every test the run was to run: a run in Minitest's threads
|
|
50
|
+
# or Rails' workers hands its results back after its suites were
|
|
51
|
+
# handed over.
|
|
50
52
|
def run(reporter, recorder)
|
|
53
|
+
@test_run.end_tests
|
|
51
54
|
return unless @test_run.flaky_detection_runs?
|
|
52
55
|
|
|
53
56
|
recorder.wait_for(@selection.names_to_run)
|
|
@@ -86,9 +86,10 @@ module Mergify
|
|
|
86
86
|
put_first(fail_first) if fail_first
|
|
87
87
|
end
|
|
88
88
|
|
|
89
|
-
# The names of the tests the run is to run: every one it collected
|
|
89
|
+
# The names of the tests the run is to run: every one it collected,
|
|
90
|
+
# or the ones it put first once Fail First kept the rest from starting.
|
|
90
91
|
def names_to_run
|
|
91
|
-
@tests.to_set(&:name)
|
|
92
|
+
@stopped ? @first_names : @tests.to_set(&:name)
|
|
92
93
|
end
|
|
93
94
|
|
|
94
95
|
# The tests of `klass`, of `methods`, that run now.
|
|
@@ -111,7 +112,8 @@ module Mergify
|
|
|
111
112
|
# They may run in Minitest's threads or Rails' workers: their results
|
|
112
113
|
# come back after the suites were handed over.
|
|
113
114
|
recorder.wait_for(@first_names)
|
|
114
|
-
|
|
115
|
+
@stopped = recorder.stopping?
|
|
116
|
+
return if @stopped
|
|
115
117
|
|
|
116
118
|
@pass = :rest
|
|
117
119
|
run_suites.call
|
|
@@ -40,8 +40,9 @@ module Mergify
|
|
|
40
40
|
VERSION, output, doubles, enabled?, client: 'minitest-mergify', **FRAMEWORK
|
|
41
41
|
)
|
|
42
42
|
# What a run that reports loads before its tests: the quarantine list
|
|
43
|
-
# for the branch they target. Without one (no
|
|
44
|
-
# no token) nothing is quarantined
|
|
43
|
+
# for the branch they target, and the tests it skips. Without one (no
|
|
44
|
+
# branch, a failed fetch, no token) nothing is quarantined or skipped,
|
|
45
|
+
# and its block says why.
|
|
45
46
|
@quarantine = @session.load_before_tests if reports?
|
|
46
47
|
end
|
|
47
48
|
|
|
@@ -88,6 +89,13 @@ module Mergify
|
|
|
88
89
|
@session.report_verdict(false)
|
|
89
90
|
end
|
|
90
91
|
|
|
92
|
+
# The run's tests are over, and every retry of them. Fail First's is
|
|
93
|
+
# the only stop that gets here, and the session knows of it: an
|
|
94
|
+
# interrupt raises past this.
|
|
95
|
+
def end_tests
|
|
96
|
+
@session.end_tests(false)
|
|
97
|
+
end
|
|
98
|
+
|
|
91
99
|
# Whether flaky detection runs in this run: Mergify answered, and the
|
|
92
100
|
# repository opted in.
|
|
93
101
|
def flaky_detection_runs?
|
|
@@ -131,6 +139,12 @@ module Mergify
|
|
|
131
139
|
@quarantine.record(names, outcome)
|
|
132
140
|
end
|
|
133
141
|
|
|
142
|
+
# Why the session says not to run the test known by `names`, or nil to
|
|
143
|
+
# run it.
|
|
144
|
+
def skip_reason(names)
|
|
145
|
+
@quarantine&.skip_reason(names)
|
|
146
|
+
end
|
|
147
|
+
|
|
134
148
|
# Hand the session a test once it finished (see
|
|
135
149
|
# `Mergify::CI::Core::Native::Session#record_case`): its span joins the
|
|
136
150
|
# run's trace.
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: minitest-mergify
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2026.11.
|
|
4
|
+
version: 2026.11.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mergify
|
|
@@ -35,14 +35,14 @@ dependencies:
|
|
|
35
35
|
requirements:
|
|
36
36
|
- - '='
|
|
37
37
|
- !ruby/object:Gem::Version
|
|
38
|
-
version: 2026.11.
|
|
38
|
+
version: 2026.11.7
|
|
39
39
|
type: :runtime
|
|
40
40
|
prerelease: false
|
|
41
41
|
version_requirements: !ruby/object:Gem::Requirement
|
|
42
42
|
requirements:
|
|
43
43
|
- - '='
|
|
44
44
|
- !ruby/object:Gem::Version
|
|
45
|
-
version: 2026.11.
|
|
45
|
+
version: 2026.11.7
|
|
46
46
|
description: 'Minitest integration for Mergify Test Engine: the run reported to CI
|
|
47
47
|
Insights, test quarantine, Fail First on merge-queue bisection steps, and flaky
|
|
48
48
|
test detection.'
|