test-prof 1.0.10 → 1.0.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d847a0016b2749e8ba8a637d2db3d0044f7b77cfc5962596ff490aea0f5fc7d
4
- data.tar.gz: 1f32af0e6e09b555bf258c5a52586a9d4a768578b0c816298343dfd5deb826da
3
+ metadata.gz: 1cd40e8800d63a753008f4d9b27418db0015bd052ae3b12eb773c7d7380bc1af
4
+ data.tar.gz: 48cc4a7c0c5105e7b23bf4793419dffa049d1154ebbf124f0a24f83ec2a4d79a
5
5
  SHA512:
6
- metadata.gz: 55db394aef01457404c8f5cd914cfa0eb359f3bea08874c6d4a6b75b1151af5b4153087815c90ed73ea5948c403941918b75af0b79558afe795db77c4d2b2568
7
- data.tar.gz: d95cfbd7c513d086cd47b2ce0a804ec52fdf174854c0a07c239289c65d97d18833529321e0ffb4853aabc802f05a8a8eac4e3fcdc7011f0ffd1bf0c60d150b41
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
- define_method(mid) do |*args, &block|
52
- next super(*args, &block) unless guard.nil? || instance_exec(*args, &guard)
53
- tracker.track { super(*args, &block) }
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
@@ -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::Notifacations.
11
+ # such as ActiveSupport::Notifications.
12
12
  #
13
13
  # It works very similar to `rspec --profile` but can track arbitrary events.
14
14
  #
@@ -24,8 +24,7 @@ module TestProf
24
24
  class Configuration
25
25
  FORMATS = %w[html json].freeze
26
26
 
27
- attr_accessor :mode, :interval, :raw, :target, :format
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)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TestProf
4
- VERSION = "1.0.10"
4
+ VERSION = "1.0.11"
5
5
  end
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.10
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-08-12 00:00:00.000000000 Z
11
+ date: 2022-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler