test-prof 0.4.8 → 0.4.9
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 +5 -5
- data/CHANGELOG.md +11 -0
- data/lib/test_prof/ext/active_record_3.rb +27 -0
- data/lib/test_prof/factory_default.rb +1 -0
- data/lib/test_prof/factory_doctor.rb +1 -0
- data/lib/test_prof/recipes/rspec/before_all.rb +5 -0
- data/lib/test_prof/rspec_dissect/rspec.rb +0 -4
- data/lib/test_prof/version.rb +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 34e45def589431c2dd53ec256e009877c9a611ad1fa1cd7799cf6ec75c15745c
|
4
|
+
data.tar.gz: 2230613ed9c7e5bf9733a16824f7e61daa77ed524b846de4195168e89a8b5d0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 176beb48fdd32511a3516bcd28392cc9b9677b7cc6b1946c25f83111eeb1c0b4602387913bda61a9524c7211d044c1c16cf47d6a48fbadf803145e660d7e03ff
|
7
|
+
data.tar.gz: ed688acfb83aae1e7906c01daf363f676d72109cb3f29cfb04923288fba3b0af89c1d72d1e544d7887a940bee2fde79b7f5bb35a4a364a88fa728e3f178e77f4
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
# Change log
|
2
2
|
|
3
|
+
## master
|
4
|
+
|
5
|
+
## 0.4.9
|
6
|
+
|
7
|
+
- [Fix [#64](https://github.com/palkan/test-prof/issues/64)] Fix dependencies requiring for FactoryDefault. ([@palkan][])
|
8
|
+
|
9
|
+
- [Fix [#60](https://github.com/palkan/test-prof/issues/60)] Fix RSpecDissect reporter hooks. ([@palkan][])
|
10
|
+
|
11
|
+
Consider only `example_failed` and `example_passed` to ensure that the `run_time`
|
12
|
+
is available.
|
13
|
+
|
3
14
|
## 0.4.8
|
4
15
|
|
5
16
|
- Add `minitest` 5.11 support. ([@palkan][])
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module TestProf
|
4
|
+
# Add missing `begin_transaction` and `rollback_transaction` methods
|
5
|
+
module ActiveRecord3Transactions
|
6
|
+
refine ::ActiveRecord::ConnectionAdapters::AbstractAdapter do
|
7
|
+
def begin_transaction(joinable: true)
|
8
|
+
increment_open_transactions
|
9
|
+
if open_transactions > 0
|
10
|
+
create_savepoint
|
11
|
+
else
|
12
|
+
begin_db_transaction
|
13
|
+
end
|
14
|
+
self.transaction_joinable = joinable
|
15
|
+
end
|
16
|
+
|
17
|
+
def rollback_transaction(*)
|
18
|
+
if open_transactions > 1
|
19
|
+
rollback_to_savepoint
|
20
|
+
else
|
21
|
+
rollback_db_transaction
|
22
|
+
end
|
23
|
+
decrement_open_transactions
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -1,5 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
if ActiveRecord::VERSION::MAJOR < 4
|
4
|
+
require "test_prof/ext/active_record_3"
|
5
|
+
using TestProf::ActiveRecord3Transactions
|
6
|
+
end
|
7
|
+
|
3
8
|
module TestProf
|
4
9
|
# Helper to wrap the whole example group into a transaction
|
5
10
|
module BeforeAll
|
@@ -15,11 +15,9 @@ module TestProf
|
|
15
15
|
using StringStripHeredoc
|
16
16
|
|
17
17
|
NOTIFICATIONS = %i[
|
18
|
-
example_finished
|
19
18
|
example_group_finished
|
20
19
|
example_passed
|
21
20
|
example_failed
|
22
|
-
example_pending
|
23
21
|
].freeze
|
24
22
|
|
25
23
|
def initialize
|
@@ -39,10 +37,8 @@ module TestProf
|
|
39
37
|
@examples_time += notification.example.execution_result.run_time
|
40
38
|
end
|
41
39
|
|
42
|
-
# NOTE: RSpec < 3.4.0 doesn't have example_finished event
|
43
40
|
alias example_passed example_finished
|
44
41
|
alias example_failed example_finished
|
45
|
-
alias example_pending example_finished
|
46
42
|
|
47
43
|
def example_group_finished(notification)
|
48
44
|
return unless notification.group.top_level?
|
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: 0.4.
|
4
|
+
version: 0.4.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladimir Dementyev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '3.
|
47
|
+
version: '3.4'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '3.
|
54
|
+
version: '3.4'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: minitest
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -148,6 +148,7 @@ files:
|
|
148
148
|
- lib/test_prof/event_prof/instrumentations/active_support.rb
|
149
149
|
- lib/test_prof/event_prof/minitest.rb
|
150
150
|
- lib/test_prof/event_prof/rspec.rb
|
151
|
+
- lib/test_prof/ext/active_record_3.rb
|
151
152
|
- lib/test_prof/ext/array_bsearch_index.rb
|
152
153
|
- lib/test_prof/ext/float_duration.rb
|
153
154
|
- lib/test_prof/ext/string_strip_heredoc.rb
|
@@ -208,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
208
209
|
version: '0'
|
209
210
|
requirements: []
|
210
211
|
rubyforge_project:
|
211
|
-
rubygems_version: 2.
|
212
|
+
rubygems_version: 2.7.4
|
212
213
|
signing_key:
|
213
214
|
specification_version: 4
|
214
215
|
summary: Ruby applications tests profiling tools
|