test-prof 0.5.0.pre2 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +44 -3
- data/lib/test_prof/ext/active_record_refind.rb +20 -0
- data/lib/test_prof/recipes/active_record_one_love.rb +4 -0
- data/lib/test_prof/version.rb +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc2f073e4331955ed514e20849bb5dadf28d4f5934254ae3d30ca2c60db90ff0
|
4
|
+
data.tar.gz: d07ba0a976611946258de85284b697d0ccf7adbdeaae0363efebd868156100e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c942589dbd72c954f54a4cb874d91f98a2c9a64c604fb82b32476bcf2ea9b82fbfa72222e32b0cfec52fc1b335b2c9e69d99567be21e91b8084005a94ed9963a
|
7
|
+
data.tar.gz: e90718e07df7b566c657c9192805a4a1f523196578699f7cbc93f3cf25ddf09634bcb0bda35e5e18a9f1501708e583748df4575b721c20886605ca1c863efff6
|
data/CHANGELOG.md
CHANGED
@@ -2,7 +2,9 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
-
|
5
|
+
## 0.5.0 (2018-04-25)
|
6
|
+
|
7
|
+
### Features
|
6
8
|
|
7
9
|
- Add events support to TagProf. ([@palkan][])
|
8
10
|
|
@@ -12,14 +14,32 @@ Example usage:
|
|
12
14
|
TAG_PROF=type TAG_PROF_EVENT=sql.active_record rspec
|
13
15
|
```
|
14
16
|
|
17
|
+
[📝 Docs](https://test-prof.evilmartians.io/#/tag_prof?id=profiling-events)
|
18
|
+
|
15
19
|
- Add logging helpers for Rails. ([@palkan][])
|
16
20
|
|
17
|
-
|
21
|
+
Enalbe verbose logging globally:
|
22
|
+
|
23
|
+
```sh
|
24
|
+
LOG=all rspec
|
25
|
+
```
|
26
|
+
|
27
|
+
Or per example (group):
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
it 'does smth weird', :log do
|
31
|
+
# ...
|
32
|
+
end
|
33
|
+
```
|
34
|
+
|
35
|
+
[📝 Docs](https://test-prof.evilmartians.io/#/logging)
|
18
36
|
|
19
37
|
- Add HTML report for `TagProf`. ([@palkan][])
|
20
38
|
|
21
39
|
Generate HTML report by setting `TAG_PROF_FORMAT` to `html`.
|
22
40
|
|
41
|
+
- Add ability to track multiple events at the same time with `EventProf`. ([@palkan][])
|
42
|
+
|
23
43
|
- Add `AnyFixture` DSL. ([@palkan][])
|
24
44
|
|
25
45
|
Example:
|
@@ -35,18 +55,39 @@ before(:all) { fixture(:account) }
|
|
35
55
|
let(:account) { fixture(:account) }
|
36
56
|
```
|
37
57
|
|
58
|
+
[📝 Docs](https://test-prof.evilmartians.io/#/any_fixture?id=dsl)
|
59
|
+
|
38
60
|
- Add `AnyFixture` usage report. ([@palkan][])
|
39
61
|
|
40
|
-
Enable `AnyFixture` usage reporting with:
|
62
|
+
Enable `AnyFixture` usage reporting with `ANYFIXTURE_REPORTING=1` or with:
|
41
63
|
|
42
64
|
```ruby
|
43
65
|
TestProf::AnyFixture.reporting_enabled = true
|
44
66
|
```
|
45
67
|
|
68
|
+
[📝 Docs](https://test-prof.evilmartians.io/#/any_fixture?id=usage-report)
|
69
|
+
|
46
70
|
- Add `ActiveRecordSharedConnection` recipe. ([@palkan][])
|
47
71
|
|
72
|
+
Force ActiveRecord to use the same connection between threads (to avoid database cleaning in browser tests).
|
73
|
+
|
74
|
+
[📝 Docs](https://test-prof.evilmartians.io/#/active_record_shared_connection)
|
75
|
+
|
48
76
|
- [#70](https://github.com/palkan/test-prof/pull/70) Add `FactoryAllStub` recipe. ([@palkan][])
|
49
77
|
|
78
|
+
[📝 Docs](https://test-prof.evilmartians.io/#/factory_all_stub)
|
79
|
+
|
80
|
+
- Add `ActiveRecordRefind` refinement. ([@palkan][])
|
81
|
+
|
82
|
+
[📝 Docs](https://test-prof.evilmartians.io/#/any_fixture?id=activerecordrefind)
|
83
|
+
|
84
|
+
### Fixes & Improvements
|
85
|
+
|
86
|
+
- **Brand new documentatation website: https://test-prof.evilmartians.io/**
|
87
|
+
|
88
|
+
- Disable referential integrity when cleaning AnyFixture. ([@palkan][])
|
89
|
+
|
90
|
+
|
50
91
|
## 0.4.9 (2018-03-20)
|
51
92
|
|
52
93
|
- [Fix [#64](https://github.com/palkan/test-prof/issues/64)] Fix dependencies requiring for FactoryDefault. ([@palkan][])
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module TestProf
|
4
|
+
module Ext
|
5
|
+
# Adds `ActiveRecord::Base#refind` method (through refinement)
|
6
|
+
module ActiveRecordRefind
|
7
|
+
refine ActiveRecord::Base do
|
8
|
+
# Returns new reloaded record.
|
9
|
+
#
|
10
|
+
# Unlike `reload` this method returns
|
11
|
+
# completely re-initialized instance.
|
12
|
+
#
|
13
|
+
# We need it to make sure that the state is clean.
|
14
|
+
def refind
|
15
|
+
self.class.find(send(self.class.primary_key))
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
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.5.0
|
4
|
+
version: 0.5.0
|
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-05-
|
11
|
+
date: 2018-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -136,6 +136,7 @@ files:
|
|
136
136
|
- lib/test_prof/event_prof/profiler.rb
|
137
137
|
- lib/test_prof/event_prof/rspec.rb
|
138
138
|
- lib/test_prof/ext/active_record_3.rb
|
139
|
+
- lib/test_prof/ext/active_record_refind.rb
|
139
140
|
- lib/test_prof/ext/array_bsearch_index.rb
|
140
141
|
- lib/test_prof/ext/float_duration.rb
|
141
142
|
- lib/test_prof/ext/string_strip_heredoc.rb
|
@@ -157,6 +158,7 @@ files:
|
|
157
158
|
- lib/test_prof/factory_prof/printers/flamegraph.rb
|
158
159
|
- lib/test_prof/factory_prof/printers/simple.rb
|
159
160
|
- lib/test_prof/logging.rb
|
161
|
+
- lib/test_prof/recipes/active_record_one_love.rb
|
160
162
|
- lib/test_prof/recipes/active_record_shared_connection.rb
|
161
163
|
- lib/test_prof/recipes/logging.rb
|
162
164
|
- lib/test_prof/recipes/minitest/sample.rb
|
@@ -200,9 +202,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
200
202
|
version: 2.2.0
|
201
203
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
202
204
|
requirements:
|
203
|
-
- - "
|
205
|
+
- - ">="
|
204
206
|
- !ruby/object:Gem::Version
|
205
|
-
version:
|
207
|
+
version: '0'
|
206
208
|
requirements: []
|
207
209
|
rubyforge_project:
|
208
210
|
rubygems_version: 2.7.6
|