test-prof 1.0.10 → 1.0.11
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 +10 -0
- data/lib/test_prof/before_all/adapters/active_record.rb +1 -1
- data/lib/test_prof/event_prof/monitor.rb +10 -3
- data/lib/test_prof/event_prof.rb +1 -1
- data/lib/test_prof/stack_prof.rb +3 -2
- data/lib/test_prof/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1cd40e8800d63a753008f4d9b27418db0015bd052ae3b12eb773c7d7380bc1af
|
4
|
+
data.tar.gz: 48cc4a7c0c5105e7b23bf4793419dffa049d1154ebbf124f0a24f83ec2a4d79a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abdda954d6dce088d9dd015394ebfdca5904973244f2a0c194a2203e8a2ef0a565b2926831770deb4f6e957781a635c2d302860e59148967bf9bc8c10439cd72
|
7
|
+
data.tar.gz: 0db8384bf621fb4a1857dabc02e6e516d99d702ee81a8f1f777c2ffd9e9890dc8f312be1f55172b942b93385168e432bb1f5df0ad03779e21f80f96f868a9889
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
## master (unreleased)
|
4
4
|
|
5
|
+
## 1.0.11 (2022-10-27)
|
6
|
+
|
7
|
+
- Fix monitoring methods with keyword args in Ruby 3+. ([@palkan][])
|
8
|
+
|
9
|
+
- Disable garbage collection frames when `TEST_STACK_PROF_IGNORE_GC` env variable is set ([@cbliard][])
|
10
|
+
|
11
|
+
- Fixed restoring lock_thread value in nested contexts ([@ygelfand][])
|
12
|
+
|
5
13
|
## 1.0.10 (2022-08-12)
|
6
14
|
|
7
15
|
- Allow overriding global logger. ([@palkan][])
|
@@ -294,3 +302,5 @@ See [changelog](https://github.com/test-prof/test-prof/blob/v0.8.0/CHANGELOG.md)
|
|
294
302
|
[@grillermo]: https://github.com/grillermo
|
295
303
|
[@cou929]: https://github.com/cou929
|
296
304
|
[@ruslanshakirov]: https://github.com/ruslanshakirov
|
305
|
+
[@ygelfand]: https://github.com/ygelfand
|
306
|
+
[@cbliard]: https://github.com/cbliard
|
@@ -47,7 +47,7 @@ module TestProf
|
|
47
47
|
# might lead to leaking connections
|
48
48
|
config.before(:begin) do
|
49
49
|
next unless ::ActiveRecord::Base.connection.pool.respond_to?(:lock_thread=)
|
50
|
-
instance_variable_set("#{PREFIX_RESTORE_LOCK_THREAD}_orig_lock_thread", ::ActiveRecord::Base.connection.pool.instance_variable_get(:@lock_thread))
|
50
|
+
instance_variable_set("#{PREFIX_RESTORE_LOCK_THREAD}_orig_lock_thread", ::ActiveRecord::Base.connection.pool.instance_variable_get(:@lock_thread)) unless instance_variable_defined? "#{PREFIX_RESTORE_LOCK_THREAD}_orig_lock_thread"
|
51
51
|
::ActiveRecord::Base.connection.pool.lock_thread = true
|
52
52
|
end
|
53
53
|
|
@@ -48,9 +48,16 @@ module TestProf
|
|
48
48
|
|
49
49
|
patch = Module.new do
|
50
50
|
mids.each do |mid|
|
51
|
-
|
52
|
-
|
53
|
-
|
51
|
+
if RUBY_VERSION >= "2.7.0"
|
52
|
+
define_method(mid) do |*args, **kwargs, &block|
|
53
|
+
next super(*args, **kwargs, &block) unless guard.nil? || instance_exec(*args, **kwargs, &guard)
|
54
|
+
tracker.track { super(*args, **kwargs, &block) }
|
55
|
+
end
|
56
|
+
else
|
57
|
+
define_method(mid) do |*args, &block|
|
58
|
+
next super(*args, &block) unless guard.nil? || instance_exec(*args, &guard)
|
59
|
+
tracker.track { super(*args, &block) }
|
60
|
+
end
|
54
61
|
end
|
55
62
|
end
|
56
63
|
end
|
data/lib/test_prof/event_prof.rb
CHANGED
@@ -8,7 +8,7 @@ require "test_prof/utils/sized_ordered_set"
|
|
8
8
|
|
9
9
|
module TestProf
|
10
10
|
# EventProf profiles your tests and suites against custom events,
|
11
|
-
# such as ActiveSupport::
|
11
|
+
# such as ActiveSupport::Notifications.
|
12
12
|
#
|
13
13
|
# It works very similar to `rspec --profile` but can track arbitrary events.
|
14
14
|
#
|
data/lib/test_prof/stack_prof.rb
CHANGED
@@ -24,8 +24,7 @@ module TestProf
|
|
24
24
|
class Configuration
|
25
25
|
FORMATS = %w[html json].freeze
|
26
26
|
|
27
|
-
attr_accessor :mode, :
|
28
|
-
|
27
|
+
attr_accessor :mode, :raw, :target, :format, :interval, :ignore_gc
|
29
28
|
def initialize
|
30
29
|
@mode = ENV.fetch("TEST_STACK_PROF_MODE", :wall).to_sym
|
31
30
|
@target = ENV["TEST_STACK_PROF"] == "boot" ? :boot : :suite
|
@@ -39,6 +38,7 @@ module TestProf
|
|
39
38
|
|
40
39
|
sample_interval = ENV["TEST_STACK_PROF_INTERVAL"].to_i
|
41
40
|
@interval = sample_interval > 0 ? sample_interval : nil
|
41
|
+
@ignore_gc = !ENV["TEST_STACK_PROF_IGNORE_GC"].nil?
|
42
42
|
end
|
43
43
|
|
44
44
|
def raw?
|
@@ -96,6 +96,7 @@ module TestProf
|
|
96
96
|
}
|
97
97
|
|
98
98
|
options[:interval] = config.interval if config.interval
|
99
|
+
options[:ignore_gc] = true if config.ignore_gc
|
99
100
|
|
100
101
|
if block_given?
|
101
102
|
options[:out] = build_path(name)
|
data/lib/test_prof/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: test-prof
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladimir Dementyev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|