test-prof 1.6.1 → 1.6.3
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/CHANGELOG.md +13 -0
- data/lib/test_prof/factory_prof/factory_bot_patch.rb +1 -1
- data/lib/test_prof/recipes/minitest/before_all.rb +38 -13
- data/lib/test_prof/rspec_dissect.rb +2 -2
- data/lib/test_prof/ruby_prof.rb +4 -2
- data/lib/test_prof/version.rb +1 -1
- 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: 39f68f82427dfea9fb815614f6fce02fdfd7291fa1227e5c2a224f4c6483e091
|
|
4
|
+
data.tar.gz: cd76ddbed3548fa987b8828727e7ddd6f81639b39b8d06d5e8c41f7aa84fba10
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 329db71243834a0641c490b3daaf77cfc5c352b1995c9b01dac49c0824619070d372e5eda7d64f76d97226087cfb2b9ad6d7e58823297e0e8ac53e5d74d82878
|
|
7
|
+
data.tar.gz: 72830459616db6692c3c58621457a459122aadc8609472f1a38b827025a19da11784b68aee86abc27d535ca1ecf474b18cd45d0c60c33b5490de3f4c0a314d18
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
## master (unreleased)
|
|
4
4
|
|
|
5
|
+
## 1.6.3 (2026-07-20)
|
|
6
|
+
|
|
7
|
+
- Fix `before_all` firing N times in Minitest 6. ([@palkan][])
|
|
8
|
+
|
|
9
|
+
## 1.6.2 (2026-07-16)
|
|
10
|
+
|
|
11
|
+
- Add `logger` as a runtime dependency (it's no longer a default gem in Ruby 4.0). ([@moznion][])
|
|
12
|
+
|
|
13
|
+
- Fix `RSpecDissect` crashing with `undefined method 'last' for nil` when a `let` is evaluated on a non-example thread (e.g. a Capybara `:js`/system spec server thread). The span-stack thread-local is now lazily initialized so off-example-thread access is a safe no-op.
|
|
14
|
+
|
|
15
|
+
- Add support for ruby-prof's FlameGraphPrinter
|
|
16
|
+
|
|
5
17
|
## 1.6.1 (2026-04-02)
|
|
6
18
|
|
|
7
19
|
- Require MFA to publish the gem.
|
|
@@ -506,3 +518,4 @@ See [changelog](https://github.com/test-prof/test-prof/blob/v0.8.0/CHANGELOG.md)
|
|
|
506
518
|
[@elasticspoon]: https://github.com/elasticspoon
|
|
507
519
|
[@Rylan12]: https://github.com/Rylan12
|
|
508
520
|
[@kddnewton]: https://github.com/kddnewton
|
|
521
|
+
[@moznion]: https://github.com/moznion
|
|
@@ -6,15 +6,29 @@ Minitest.singleton_class.prepend(Module.new do
|
|
|
6
6
|
attr_reader :previous_klass
|
|
7
7
|
@previous_klass = nil
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
# Minitest 6+
|
|
10
|
+
if Minitest::Runnable.method_defined?(:run_suite)
|
|
11
|
+
def run(klass, *rest)
|
|
12
|
+
return super unless klass.respond_to?(:parallelized) && klass.parallelized
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
if @previous_klass && @previous_klass != klass
|
|
15
|
+
@previous_klass.before_all_executor&.deactivate!
|
|
16
|
+
end
|
|
17
|
+
@previous_klass = klass
|
|
18
|
+
|
|
19
|
+
super
|
|
14
20
|
end
|
|
15
|
-
|
|
21
|
+
else
|
|
22
|
+
def run_one_method(klass, *rest)
|
|
23
|
+
return super unless klass.respond_to?(:parallelized) && klass.parallelized
|
|
24
|
+
|
|
25
|
+
if @previous_klass && @previous_klass != klass
|
|
26
|
+
@previous_klass.before_all_executor&.deactivate!
|
|
27
|
+
end
|
|
28
|
+
@previous_klass = klass
|
|
16
29
|
|
|
17
|
-
|
|
30
|
+
super
|
|
31
|
+
end
|
|
18
32
|
end
|
|
19
33
|
end)
|
|
20
34
|
|
|
@@ -162,13 +176,24 @@ module TestProf
|
|
|
162
176
|
end
|
|
163
177
|
end)
|
|
164
178
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
179
|
+
# Minitest 6+
|
|
180
|
+
if singleton_class.method_defined?(:run_suite)
|
|
181
|
+
singleton_class.prepend(Module.new do
|
|
182
|
+
def run_suite(*)
|
|
183
|
+
super
|
|
184
|
+
ensure
|
|
185
|
+
before_all_executor&.deactivate! unless parallelized
|
|
186
|
+
end
|
|
187
|
+
end)
|
|
188
|
+
else
|
|
189
|
+
singleton_class.prepend(Module.new do
|
|
190
|
+
def run(*)
|
|
191
|
+
super
|
|
192
|
+
ensure
|
|
193
|
+
before_all_executor&.deactivate! unless parallelized
|
|
194
|
+
end
|
|
195
|
+
end)
|
|
196
|
+
end
|
|
172
197
|
end
|
|
173
198
|
|
|
174
199
|
def after_all(&block)
|
|
@@ -86,11 +86,11 @@ module TestProf
|
|
|
86
86
|
end
|
|
87
87
|
|
|
88
88
|
def current_span
|
|
89
|
-
|
|
89
|
+
span_stack.last
|
|
90
90
|
end
|
|
91
91
|
|
|
92
92
|
def span_stack
|
|
93
|
-
Thread.current[:_rspec_dissect_spans_stack]
|
|
93
|
+
Thread.current[:_rspec_dissect_spans_stack] ||= []
|
|
94
94
|
end
|
|
95
95
|
|
|
96
96
|
def track(type, id: nextid, **meta)
|
data/lib/test_prof/ruby_prof.rb
CHANGED
|
@@ -31,7 +31,8 @@ module TestProf
|
|
|
31
31
|
"." => "DotPrinter",
|
|
32
32
|
"call_stack" => "CallStackPrinter",
|
|
33
33
|
"call_tree" => "CallTreePrinter",
|
|
34
|
-
"multi" => "MultiPrinter"
|
|
34
|
+
"multi" => "MultiPrinter",
|
|
35
|
+
"flame_graph" => "FlameGraphPrinter"
|
|
35
36
|
}.freeze
|
|
36
37
|
|
|
37
38
|
# Mapping from printer to report file extension
|
|
@@ -40,7 +41,8 @@ module TestProf
|
|
|
40
41
|
"graph_html" => "html",
|
|
41
42
|
"dot" => "dot",
|
|
42
43
|
"." => "dot",
|
|
43
|
-
"call_stack" => "html"
|
|
44
|
+
"call_stack" => "html",
|
|
45
|
+
"flame_graph" => "html"
|
|
44
46
|
}.freeze
|
|
45
47
|
|
|
46
48
|
LOGFILE_PREFIX = "ruby-prof-report"
|
data/lib/test_prof/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,15 +1,29 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: test-prof
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.6.
|
|
4
|
+
version: 1.6.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Vladimir Dementyev
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-07-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: logger
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ">="
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '0'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - ">="
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '0'
|
|
13
27
|
- !ruby/object:Gem::Dependency
|
|
14
28
|
name: bundler
|
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|