test-prof 0.12.0 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +155 -463
  3. data/README.md +9 -9
  4. data/config/default.yml +0 -15
  5. data/config/rubocop-rspec.yml +6 -0
  6. data/lib/test_prof/any_fixture/dump/base_adapter.rb +43 -0
  7. data/lib/test_prof/any_fixture/dump/digest.rb +29 -0
  8. data/lib/test_prof/any_fixture/dump/postgresql.rb +91 -0
  9. data/lib/test_prof/any_fixture/dump/sqlite.rb +42 -0
  10. data/lib/test_prof/any_fixture/dump.rb +212 -0
  11. data/lib/test_prof/any_fixture.rb +117 -8
  12. data/lib/test_prof/before_all/adapters/active_record.rb +15 -5
  13. data/lib/test_prof/before_all.rb +11 -2
  14. data/lib/test_prof/cops/rspec/aggregate_examples/its.rb +1 -1
  15. data/lib/test_prof/cops/rspec/aggregate_examples/line_range_helpers.rb +1 -1
  16. data/lib/test_prof/cops/rspec/aggregate_examples/matchers_with_side_effects.rb +1 -1
  17. data/lib/test_prof/cops/rspec/aggregate_examples/metadata_helpers.rb +1 -1
  18. data/lib/test_prof/cops/rspec/aggregate_examples/node_matchers.rb +1 -1
  19. data/lib/test_prof/cops/rspec/aggregate_examples.rb +1 -1
  20. data/lib/test_prof/event_prof/custom_events.rb +1 -1
  21. data/lib/test_prof/event_prof/instrumentations/active_support.rb +1 -1
  22. data/lib/test_prof/event_prof/profiler.rb +3 -4
  23. data/lib/test_prof/factory_prof/nate_heckler.rb +16 -0
  24. data/lib/test_prof/factory_prof/printers/flamegraph.rb +1 -1
  25. data/lib/test_prof/factory_prof/printers/nate_heckler.rb +26 -0
  26. data/lib/test_prof/factory_prof/printers/simple.rb +6 -2
  27. data/lib/test_prof/factory_prof.rb +24 -4
  28. data/lib/test_prof/logging.rb +18 -12
  29. data/lib/test_prof/recipes/logging.rb +1 -1
  30. data/lib/test_prof/recipes/minitest/before_all.rb +126 -24
  31. data/lib/test_prof/recipes/rspec/any_fixture.rb +1 -1
  32. data/lib/test_prof/recipes/rspec/before_all.rb +11 -3
  33. data/lib/test_prof/recipes/rspec/let_it_be.rb +6 -8
  34. data/lib/test_prof/rspec_dissect.rb +2 -2
  35. data/lib/test_prof/rspec_stamp.rb +1 -1
  36. data/lib/test_prof/rubocop.rb +0 -1
  37. data/lib/test_prof/ruby_prof.rb +11 -9
  38. data/lib/test_prof/tag_prof/result.rb +1 -1
  39. data/lib/test_prof/tag_prof/rspec.rb +3 -5
  40. data/lib/test_prof/utils/sized_ordered_set.rb +2 -2
  41. data/lib/test_prof/version.rb +1 -1
  42. data/lib/test_prof.rb +17 -4
  43. metadata +19 -14
  44. data/lib/test_prof/cops/rspec/aggregate_failures.rb +0 -26
  45. data/lib/test_prof/ext/active_record_3.rb +0 -27
  46. data/lib/test_prof/recipes/active_record_one_love.rb +0 -6
  47. data/lib/test_prof/recipes/active_record_shared_connection.rb +0 -77
data/CHANGELOG.md CHANGED
@@ -1,577 +1,269 @@
1
1
  # Change log
2
2
 
3
- ## 0.12.0 (2020-07-17)
3
+ ## master (unrealeased)
4
4
 
5
- - Add state leakage detection for `let_it_be`. ([@pirj][], [@jaimerson][], [@alexvko][])
5
+ ## 1.0.7 (2021-08-30)
6
6
 
7
- - Add default let_it_be modifiers configuration. ([@palkan][])
7
+ - Fix access to `let_it_be` variables in `after(:all)` hook. ([@cbarton][])
8
8
 
9
- You can configure global modifiers:
9
+ - Add support for using the before_all hook with Rails' parallelize feature (using processes). ([@peret][])
10
10
 
11
- ```ruby
12
- TestProf::LetItBe.configure do |config|
13
- # Make refind activated by default
14
- config.default_modifiers[:refind] = true
15
- end
16
- ```
11
+ Make sure to include `TestProf::BeforeAll::Minitest` before you call `parallelize`.
17
12
 
18
- Or for specific contexts via tags:
13
+ ## 1.0.6 (2021-06-23)
19
14
 
20
- ```ruby
21
- context "with let_it_be reload", let_it_be_modifiers: {reload: true} do
22
- # examples
23
- end
24
- ```
15
+ - Fix Spring detection when `DISABLE_SPRING=1` is used. ([@palkan][])
25
16
 
26
- - **Drop Ruby 2.4 support.** ([@palkan][])
17
+ - Make `before_all` in Minitest inheritable. ([@palkan][])
27
18
 
28
- - SAMPLE and SAMPLE_GROUP work consistently with seed in RSpec and Minitest. ([@stefkin][])
19
+ ## 1.0.5 (2021-05-13)
29
20
 
30
- - Make sure EventProf is not affected by time freezing. ([@palkan][])
21
+ - Fix logging regression when no newline has been added. ([@palkan][])
31
22
 
32
- EventProf results now is not affected by `Timecop.freeze` or similar.
23
+ ## 1.0.4 (2021-05-12)
33
24
 
34
- See more in [#181](https://github.com/palkan/test-prof/issues/181).
25
+ - Add ability to use custom logger. ([@palkan][])
35
26
 
36
- - Adds the ability to define stackprof's interval sampling by using `TEST_STACK_PROF_INTERVAL` env variable ([@LynxEyes][])
27
+ ```ruby
28
+ TestProf.configure do |config|
29
+ config.logger = Logger.new($stdout, level: Logger::WARN)
30
+ end
31
+ ```
37
32
 
38
- Now you can use `$ TEST_STACK_PROF=1 TEST_STACK_PROF_INTERVAL=10000 rspec` to define a custom interval (in microseconds).
33
+ - Add `nate_heckler` mode for FactoryProf. ([@palkan][])
39
34
 
40
- ## 0.11.3 (2020-02-11)
35
+ Drop this into your `rails_helper.rb` or `test_helper.rb`:
41
36
 
42
- - Disable `RSpec/AggregateFailures` by default. ([@pirj][])
37
+ ```ruby
38
+ require "test_prof/factory_prof/nate_heckler"
39
+ ```
43
40
 
44
- ## 0.11.2 (2020-02-11)
41
+ And for every test run see the overall factories usage:
45
42
 
46
- - Fix RuboCop integration regressions. ([@palkan][])
43
+ ```sh
44
+ [TEST PROF INFO] Time spent in factories: 04:31.222 (54% of total time)
45
+ ```
47
46
 
48
- ## 0.11.1 (2020-02-10)
47
+ ## 1.0.3 (2021-04-30)
49
48
 
50
- - Add `config/` to the gem contents. ([@palkan][])
49
+ - Minor fixes.
51
50
 
52
- Fixes RuboCop integration regression from 0.11.0.
51
+ ## 1.0.2 (2021-02-26)
53
52
 
54
- ## 0.11.0 (2020-02-09)
53
+ - Make `before_all(setup_fixtures: true)` compatible with Rails 6.1. ([@palkan][])
55
54
 
56
- - Fix `let_it_be` issue when initialized with an array/enumerable or an AR relation. ([@pirj][])
55
+ ## 1.0.1 (2021-02-12)
57
56
 
58
- - Improve `RSpec/AggregateExamples` (formerly `RSpec/AggregateFailures`) cop. ([@pirj][])
57
+ - Fixed AnyFixture deprecation warning.
59
58
 
60
- ## 0.10.2 (2020-01-07) 🎄
59
+ ## 1.0.0 (2021-01-21)
61
60
 
62
- - Fix Ruby 2.7 deprecations. ([@lostie][])
63
-
64
- ## 0.10.1 (2019-10-17)
61
+ ## 1.0.0.rc2 (2021-01-06)
65
62
 
66
- - Fix AnyFixture DSL when using with Rails 6.1+. ([@palkan][])
63
+ - Make Rails fixtures accesible in `before_all`. ([@palkan][])
67
64
 
68
- - Fix loading `let_it_be` without ActiveRecord present. ([@palkan][])
65
+ You can load and access fixtures when explicitly enabling them via `before_all(setup_fixtures: true, &block)`.
69
66
 
70
- - Fix compatibility of `before_all` with [`isolator`](https://github.com/palkan/isolator) gem to handle correct usages of non-atomic interactions outside DB transactions. ([@Envek][])
67
+ - Minitest's `before_all` is not longer experimental. ([@palkan][])
71
68
 
72
- - Updates FactoryProf to show the amount of time taken per factory call. ([@tyleriguchi][])
69
+ - Add `after_all` to Minitest in addition to `before_all`. ([@palkan][])
73
70
 
74
- ## 0.10.0 (2019-08-19)
71
+ ## 1.0.0.rc1 (2020-12-30)
75
72
 
76
- - Use RSpec example ID instead of full description for RubyProf/Stackprof report names. ([@palkan][])
73
+ - Remove deprecated `AggregateFailures` cop. ([@palkan][])
77
74
 
78
- For more complex scenarios feel free to use your own report name generator:
75
+ - Remove `ActiveRecordSharedConnection`. ([@palkan][])
79
76
 
80
- ```ruby
81
- # for RubyProf
82
- TestProf::RubyProf::Listener.report_name_generator = ->(example) { "..." }
83
- # for Stackprof
84
- TestProf::StackProf::Listener.report_name_generator = ->(example) { "..." }
85
- ```
77
+ - Add `AnyFixture#register_dump` to _cache_ fixtures using SQL dumps. ([@palkan][])
86
78
 
87
- - Support arrays in `let_it_be` with modifiers. ([@palkan][])
79
+ - Replaced `TestProf::AnyFixture.reporting_enabled = true` with `TestProf::AnyFixture.config.reporting_enabled = true`. ([@palkan][])
88
80
 
89
- ```ruby
90
- # Now you can use modifiers with arrays
91
- let_it_be(:posts, reload: true) { create_pair(:post) }
92
- ```
81
+ - Add support for RSpec aliases detection when linting specs using `let_it_be`/`before_all` with `rubocop-rspec` 2.0 ([@pirj][])
93
82
 
94
- - Refactor `let_it_be` modifiers and allow adding custom modifiers. ([@palkan][])
83
+ ## 0.12.2 (2020-09-03)
95
84
 
96
- ```ruby
97
- TestProf::LetItBe.config.register_modifier :reload do |record, val|
98
- # ignore when `reload: false`
99
- next record unless val
100
- # ignore non-ActiveRecord objects
101
- next record unless record.is_a?(::ActiveRecord::Base)
102
- record.reload
103
- end
104
- ```
85
+ - Execute Minitest `before_all` in the context of the current test object. ([@palkan][])
105
86
 
106
- - Print warning when `ActiveRecordSharedConnection` is used in the version of Rails
107
- supporting `lock_threads` (5.1+). ([@palkan][])
87
+ ## 0.12.1 (2020-09-01)
108
88
 
109
- ## 0.9.0 (2019-05-14)
89
+ - Minor improvements.
110
90
 
111
- - Add threshold and custom event support to FactoryDoctor. ([@palkan][])
91
+ ## 0.12.0 (2020-07-17)
112
92
 
113
- ```sh
114
- $ FDOC=1 FDOC_EVENT="sql.rom" FDOC_THRESHOLD=0.1 rspec
115
- ```
93
+ - Add state leakage detection for `let_it_be`. ([@pirj][], [@jaimerson][], [@alexvko][])
116
94
 
117
- - Add Fabrication support to FactoryDoctor. ([@palkan][])
95
+ - Add default let_it_be modifiers configuration. ([@palkan][])
118
96
 
119
- - Add `guard` and `top_level` options to `EventProf::Monitor`. ([@palkan][])
97
+ You can configure global modifiers:
120
98
 
121
- For example:
99
+ ```ruby
100
+ TestProf::LetItBe.configure do |config|
101
+ # Make refind activated by default
102
+ config.default_modifiers[:refind] = true
103
+ end
104
+ ```
122
105
 
123
- ```ruby
124
- TestProf::EventProf.monitor(
125
- Sidekiq::Client,
126
- "sidekiq.inline",
127
- :raw_push,
128
- top_level: true,
129
- guard: ->(*) { Sidekiq::Testing.inline? }
130
- )
131
- ```
106
+ Or for specific contexts via tags:
132
107
 
133
- - Add global `before_all` hooks. ([@danielwaterworth][], [@palkan][])
108
+ ```ruby
109
+ context "with let_it_be reload", let_it_be_modifiers: {reload: true} do
110
+ # examples
111
+ end
112
+ ```
134
113
 
135
- Now you can run additional code before and after every `before_all` transaction
136
- begins and rollbacks:
114
+ - **Drop Ruby 2.4 support.** ([@palkan][])
137
115
 
138
- ```ruby
139
- TestProf::BeforeAll.configure do |config|
140
- config.before(:begin) do
141
- # do something before transaction opens
142
- end
116
+ - SAMPLE and SAMPLE_GROUP work consistently with seed in RSpec and Minitest. ([@stefkin][])
143
117
 
144
- config.after(:rollback) do
145
- # do something after transaction closes
146
- end
147
- end
148
- ```
118
+ - Make sure EventProf is not affected by time freezing. ([@palkan][])
149
119
 
150
- - Add ability to use `let_it_be` aliases with predefined options. ([@danielwaterworth][])
120
+ EventProf results now is not affected by `Timecop.freeze` or similar.
151
121
 
152
- ```ruby
153
- TestProf::LetItBe.configure do |config|
154
- config.alias_to :let_it_be_with_refind, refind: true
155
- end
156
- ```
122
+ See more in [#181](https://github.com/test-prof/test-prof/issues/181).
157
123
 
158
- - Made FactoryProf measure and report on timing ([@danielwaterworth][])
124
+ - Adds the ability to define stackprof's interval sampling by using `TEST_STACK_PROF_INTERVAL` env variable ([@LynxEyes][])
159
125
 
160
- ## 0.8.0 (2019-04-12) 🚀
126
+ Now you can use `$ TEST_STACK_PROF=1 TEST_STACK_PROF_INTERVAL=10000 rspec` to define a custom interval (in microseconds).
161
127
 
162
- - **Ruby 2.4+ is requiered** ([@palkan][])
128
+ ## 0.11.3 (2020-02-11)
163
129
 
164
- - **RSpec 3.5+ is requiered for RSpec features** ([@palkan][])
130
+ - Disable `RSpec/AggregateFailures` by default. ([@pirj][])
165
131
 
166
- - Make `before_all` compatible with [`isolator`](https://github.com/palkan/isolator). ([@palkan][])
132
+ ## 0.11.2 (2020-02-11)
167
133
 
168
- - Add `with_logging` and `with_ar_logging` helpers to logging recipe. ([@palkan][])
134
+ - Fix RuboCop integration regressions. ([@palkan][])
169
135
 
170
- - Make `before_all` for Active Record `lock_thread` aware. ([@palkan][])
136
+ ## 0.11.1 (2020-02-10)
171
137
 
172
- `before_all` can went crazy if you open multiple connections within it
173
- (since it tracks the number of open transactions).
174
- Rails 5+ `lock_thread` feature only locks the connection thread in
175
- `before`/`setup` hook thus making it possible to have multiple connections/transactions
176
- in `before_all` (e.g. performing jobs with Active Job async adapter).
138
+ - Add `config/` to the gem contents. ([@palkan][])
177
139
 
178
- ## 0.7.5 (2019-02-22)
140
+ Fixes RuboCop integration regression from 0.11.0.
179
141
 
180
- - Make `let_it_be` and `before_all` work with `include_context`. ([@palkan][])
142
+ ## 0.11.0 (2020-02-09)
181
143
 
182
- Fixes [#117](https://github.com/palkan/test-prof/issues/117)
144
+ - Fix `let_it_be` issue when initialized with an array/enumerable or an AR relation. ([@pirj][])
183
145
 
184
- ## 0.7.4 (2019-02-16)
146
+ - Improve `RSpec/AggregateExamples` (formerly `RSpec/AggregateFailures`) cop. ([@pirj][])
185
147
 
186
- - Add JSON report support for StackProf. ([@palkan][])
148
+ ## 0.10.2 (2020-01-07) 🎄
187
149
 
188
- - Add ability to specify report/artifact name suffixes. ([@palkan][])
150
+ - Fix Ruby 2.7 deprecations. ([@lostie][])
189
151
 
190
- ## 0.7.3 (2018-11-07)
152
+ ## 0.10.1 (2019-10-17)
191
153
 
192
- - Add a header with the general information on factories usage [#99](https://github.com/palkan/test-prof/issues/99) ([@szemek][])
154
+ - Fix AnyFixture DSL when using with Rails 6.1+. ([@palkan][])
193
155
 
194
- - Improve test sampling.([@mkldon][])
156
+ - Fix loading `let_it_be` without ActiveRecord present. ([@palkan][])
195
157
 
196
- ```bash
197
- $ SAMPLE=10 rake test # runs 10 random test examples
198
- $ SAMPLE_GROUPS=10 rake test # runs 10 random example groups
199
- ```
158
+ - Fix compatibility of `before_all` with [`isolator`](https://github.com/palkan/isolator) gem to handle correct usages of non-atomic interactions outside DB transactions. ([@Envek][])
200
159
 
201
- - Extend Event Prof formatter to include the absolute run time and the percentage of the event tim [#100](https://github.com/palkan/test-prof/issues/100) ([@dmagro][])
160
+ - Updates FactoryProf to show the amount of time taken per factory call. ([@tyleriguchi][])
202
161
 
203
- ## 0.7.2 (2018-10-08)
162
+ ## 0.10.0 (2019-08-19)
204
163
 
205
- - Add `RSpec/AggregateFailures` support for non-regular 'its' examples. ([@broels][])
164
+ - Use RSpec example ID instead of full description for RubyProf/Stackprof report names. ([@palkan][])
206
165
 
207
- ## 0.7.1 (2018-08-20)
166
+ For more complex scenarios feel free to use your own report name generator:
208
167
 
209
- - Add ability to ignore connection configurations in shared connection.([@palkan][])
168
+ ```ruby
169
+ # for RubyProf
170
+ TestProf::RubyProf::Listener.report_name_generator = ->(example) { "..." }
171
+ # for Stackprof
172
+ TestProf::StackProf::Listener.report_name_generator = ->(example) { "..." }
173
+ ```
210
174
 
211
- Example:
175
+ - Support arrays in `let_it_be` with modifiers. ([@palkan][])
212
176
 
213
- ```ruby
214
- # Do not use shared connection for sqlite db
215
- TestProf::ActiveRecordSharedConnection.ignore { |config| config[:adapter] == "sqlite3" }
216
- ```
177
+ ```ruby
178
+ # Now you can use modifiers with arrays
179
+ let_it_be(:posts, reload: true) { create_pair(:post) }
180
+ ```
217
181
 
218
- ## 0.7.0 (2018-08-12)
182
+ - Refactor `let_it_be` modifiers and allow adding custom modifiers. ([@palkan][])
219
183
 
220
- - **Ruby 2.3+ is required**. ([@palkan][])
184
+ ```ruby
185
+ TestProf::LetItBe.config.register_modifier :reload do |record, val|
186
+ # ignore when `reload: false`
187
+ next record unless val
188
+ # ignore non-ActiveRecord objects
189
+ next record unless record.is_a?(::ActiveRecord::Base)
190
+ record.reload
191
+ end
192
+ ```
221
193
 
222
- Ruby 2.2 EOL was on 2018-03-31.
194
+ - Print warning when `ActiveRecordSharedConnection` is used in the version of Rails
195
+ supporting `lock_threads` (5.1+). ([@palkan][])
223
196
 
224
- - Upgrade RubyProf integration to `ruby-prof >= 0.17`. ([@palkan][])
197
+ ## 0.9.0 (2019-05-14)
225
198
 
226
- Use `exclude_common_methods!` instead of the deprecated `eliminate_methods!`.
199
+ - Add threshold and custom event support to FactoryDoctor. ([@palkan][])
227
200
 
228
- Add RSpec specific exclusions.
201
+ ```sh
202
+ $ FDOC=1 FDOC_EVENT="sql.rom" FDOC_THRESHOLD=0.1 rspec
203
+ ```
229
204
 
230
- Add ability to specify custom exclusions through `config.custom_exclusions`, e.g.:
205
+ - Add Fabrication support to FactoryDoctor. ([@palkan][])
231
206
 
232
- ```ruby
233
- TestProf::RubyProf.configure do |config|
234
- config.custom_exclusions = {User => %i[save save!]}
235
- end
236
- ```
207
+ - Add `guard` and `top_level` options to `EventProf::Monitor`. ([@palkan][])
237
208
 
238
- ## 0.6.0 (2018-06-29)
209
+ For example:
239
210
 
240
- ### Features
211
+ ```ruby
212
+ TestProf::EventProf.monitor(
213
+ Sidekiq::Client,
214
+ "sidekiq.inline",
215
+ :raw_push,
216
+ top_level: true,
217
+ guard: ->(*) { Sidekiq::Testing.inline? }
218
+ )
219
+ ```
241
220
 
242
- - Add `EventProf.monitor` to instrument arbitrary methods. ([@palkan][])
221
+ - Add global `before_all` hooks. ([@danielwaterworth][], [@palkan][])
243
222
 
244
- Add custom instrumetation easily:
223
+ Now you can run additional code before and after every `before_all` transaction
224
+ begins and rollbacks:
245
225
 
246
- ```ruby
247
- class Work
248
- def do
249
- # ...
250
- end
226
+ ```ruby
227
+ TestProf::BeforeAll.configure do |config|
228
+ config.before(:begin) do
229
+ # do something before transaction opens
251
230
  end
252
231
 
253
- # Instrument Work#do calls with "my.work" event
254
- TestProf::EventProf.monitor(Work, "my.work", :do)
255
- ```
256
-
257
- [📝 Docs](https://test-prof.evilmartians.io/#/event_prof?id=profile-arbitrary-methods)
258
-
259
- - Adapterize `before_all`. ([@palkan][])
260
-
261
- Now it's possible to write your own adapter for `before_all` to manage transactions.
262
-
263
- [📝 Docs](https://test-prof.evilmartians.io/#/before_all?id=database-adapters)
264
-
265
- - Add `before_all` for Minitest. ([@palkan][])
266
-
267
- [📝 Docs](https://test-prof.evilmartians.io/#/before_all?id=minitest-experimental)
268
-
269
- ### Fixes & Improvements
270
-
271
- - Show top `let` declarations per example group in RSpecDissect profiler. ([@palkan][])
272
-
273
- The output now includes the following information:
274
-
275
- ```
276
- Top 5 slowest suites (by `let` time):
277
-
278
- FunnelsController (./spec/controllers/funnels_controller_spec.rb:3) – 00:38.532 of 00:43.649 (133)
279
- ↳ user – 3
280
- ↳ funnel – 2
281
- ApplicantsController (./spec/controllers/applicants_controller_spec.rb:3) – 00:33.252 of 00:41.407 (222)
282
- ↳ user – 10
283
- ↳ funnel – 5
284
- ```
285
-
286
- Enabled by default. Disable it with:
287
-
288
- ```ruby
289
- TestProf::RSpecDissect.configure do |config|
290
- config.let_stats_enabled = false
232
+ config.after(:rollback) do
233
+ # do something after transaction closes
291
234
  end
292
- ```
293
-
294
- - [Fix [#80](https://github.com/palkan/test-prof/issues/80)] Added ability to preserve traits. ([@Vasfed][])
295
-
296
- Disabled by default for compatibility. Enable globally by `FactoryDefault.preserve_traits = true` or for single `create_default`: `create_default(:user, preserve_traits: true)`
297
-
298
- When enabled - default object will be used only when there's no [traits](https://github.com/thoughtbot/factory_bot/blob/master/GETTING_STARTED.md#traits) in association.
299
-
300
- - Add ability to run only `let` or `before` profiler with RSpecDissect. ([@palkan][])
301
-
302
- - Collect _raw_ data with StackProf by default. ([@palkan][])
303
-
304
- - Refactor `:with_clean_fixture` to clean data once per group. ([@palkan][])
305
-
306
- - [Fix [#75](https://github.com/palkan/test-prof/issues/75)] Fix `RSpec/Aggregate` failures with non-regular examples. ([@palkan][])
307
-
308
- Do not take into account `xit`, `pending`, `its`, etc. examples,
309
- only consider regular `it`, `specify`, `scenario`, `example`.
310
-
311
- ## 0.5.0 (2018-04-25)
312
-
313
- ### Features
314
-
315
- - Add events support to TagProf. ([@palkan][])
316
-
317
- Example usage:
318
-
319
- ```sh
320
- TAG_PROF=type TAG_PROF_EVENT=sql.active_record rspec
321
- ```
322
-
323
- [📝 Docs](https://test-prof.evilmartians.io/#/tag_prof?id=profiling-events)
324
-
325
- - Add logging helpers for Rails. ([@palkan][])
235
+ end
236
+ ```
326
237
 
327
- Enable verbose logging globally:
328
-
329
- ```sh
330
- LOG=all rspec
331
- ```
332
-
333
- Or per example (group):
334
-
335
- ```ruby
336
- it "does smth weird", :log do
337
- # ...
338
- end
339
- ```
340
-
341
- [📝 Docs](https://test-prof.evilmartians.io/#/logging)
342
-
343
- - Add HTML report for `TagProf`. ([@palkan][])
344
-
345
- Generate HTML report by setting `TAG_PROF_FORMAT` to `html`.
346
-
347
- - Add ability to track multiple events at the same time with `EventProf`. ([@palkan][])
348
-
349
- - Add `AnyFixture` DSL. ([@palkan][])
350
-
351
- Example:
352
-
353
- ```ruby
354
- # Enable DSL
355
- using TestProf::AnyFixture::DSL
356
-
357
- # and then you can use `fixture` method (which is just an alias for `TestProf::AnyFixture.register`)
358
- before(:all) { fixture(:account) }
359
-
360
- # You can also use it to fetch the record (instead of storing it in instance variable)
361
- let(:account) { fixture(:account) }
362
- ```
363
-
364
- [📝 Docs](https://test-prof.evilmartians.io/#/any_fixture?id=dsl)
365
-
366
- - Add `AnyFixture` usage report. ([@palkan][])
367
-
368
- Enable `AnyFixture` usage reporting with `ANYFIXTURE_REPORTING=1` or with:
369
-
370
- ```ruby
371
- TestProf::AnyFixture.reporting_enabled = true
372
- ```
373
-
374
- [📝 Docs](https://test-prof.evilmartians.io/#/any_fixture?id=usage-report)
375
-
376
- - Add `ActiveRecordSharedConnection` recipe. ([@palkan][])
377
-
378
- Force ActiveRecord to use the same connection between threads (to avoid database cleaning in browser tests).
379
-
380
- [📝 Docs](https://test-prof.evilmartians.io/#/active_record_shared_connection)
381
-
382
- - [#70](https://github.com/palkan/test-prof/pull/70) Add `FactoryAllStub` recipe. ([@palkan][])
383
-
384
- [📝 Docs](https://test-prof.evilmartians.io/#/factory_all_stub)
385
-
386
- - Add `ActiveRecordRefind` refinement. ([@palkan][])
387
-
388
- [📝 Docs](https://test-prof.evilmartians.io/#/any_fixture?id=activerecordrefind)
389
-
390
- ### Fixes & Improvements
391
-
392
- - **Brand new documentatation website: https://test-prof.evilmartians.io/**
393
-
394
- - Disable referential integrity when cleaning AnyFixture. ([@palkan][])
395
-
396
-
397
- ## 0.4.9 (2018-03-20)
398
-
399
- - [Fix [#64](https://github.com/palkan/test-prof/issues/64)] Fix dependencies requiring for FactoryDefault. ([@palkan][])
400
-
401
- - [Fix [#60](https://github.com/palkan/test-prof/issues/60)] Fix RSpecDissect reporter hooks. ([@palkan][])
402
-
403
- Consider only `example_failed` and `example_passed` to ensure that the `run_time`
404
- is available.
405
-
406
- ## 0.4.8 (2018-01-17)
407
-
408
- - Add `minitest` 5.11 support. ([@palkan][])
409
-
410
- - Fix `spring` detection. ([@palkan][])
411
-
412
- Some `spring`-related gems do not check whether Spring is running and load
413
- Spring modules. Thus we have `Spring` defined (and even `Spring.after_fork` defined) but no-op.
414
-
415
- Now we require that `Spring::Applcation` is defined in order to rely on Spring.
416
-
417
- Possibly fixes [#47](https://github.com/palkan/test-prof/issues/47).
418
-
419
- ## 0.4.7 (2017-12-25)
420
-
421
- - [#57](https://github.com/palkan/test-prof/pull/57) Fix RubyProf Printers Support ([@rabotyaga][])
422
-
423
- ## 0.4.6 (2017-12-17)
424
-
425
- - Upgrade RSpec/AggregateFailures to RuboCop 0.52.0. ([@palkan][])
426
-
427
- RuboCop < 0.51.0 is not supported anymore.
428
-
429
- - [Fixes [#49](https://github.com/palkan/test-prof/issues/49)] Correctly detect RSpec version in `let_it_be`. ([@desoleary][])
430
-
431
- ## 0.4.5 (2017-12-09)
432
-
433
- - Fix circular require in `lib/factory_doctor/minitest`. ([@palkan][])
434
-
435
- ## 0.4.4 (2017-11-08)
436
-
437
- - [Fixes [#48](https://github.com/palkan/test-prof/issues/48)] Respect RubyProf reports files extensions. ([@palkan][])
438
-
439
- ## 0.4.3 (2017-10-26)
440
-
441
- - [#46](https://github.com/palkan/test-prof/pull/46) Support FactoryBot, which is [former FactoryGirl](https://github.com/thoughtbot/factory_bot/pull/1051),
442
- while maintaining compatibility with latter. ([@Shkrt][])
443
-
444
- ## 0.4.2 (2017-10-23)
445
-
446
- - Fix bug with multiple `before_all` within one group. ([@palkan][])
447
-
448
- ## 0.4.1 (2017-10-18)
449
-
450
- - [#44](https://github.com/palkan/test-prof/pull/44) Support older versions of RSpec. ([@palkan][])
451
-
452
- Support RSpec 3.1.0+ in general.
453
-
454
- `let_it_be` supports only RSpec 3.3.0+.
455
-
456
- RSpecDissect `let` tracking supports only RSpec 3.3.0+.
457
-
458
- - [#38](https://github.com/palkan/test-prof/pull/38) Factory Doctor Minitest integration. ([@IDolgirev][])
459
-
460
- It is possible now to use Factory Doctor with Minitest
461
-
462
- ## 0.4.0 (2017-10-03)
463
-
464
- ### Features:
465
-
466
- - [#29](https://github.com/palkan/test-prof/pull/29) EventProf Minitest integration. ([@IDolgirev][])
467
-
468
- It is possible now to use Event Prof with Minitest
469
-
470
- - [#30](https://github.com/palkan/test-prof/pull/30) Fabrication support for FactoryProf. ([@Shkrt][])
471
-
472
- FactoryProf now also accounts objects created by Fabrication gem (in addition to FactoryGirl)
473
-
474
- ## 0.3.0 (2017-09-21)
475
-
476
- ### Features:
477
-
478
- - Combine RSpecStamp with FactoryDoctor. ([@palkan][])
479
-
480
- Automatically mark _bad_ examples with custom tags.
481
-
482
- - [#17](https://github.com/palkan/test-prof/pull/17) Combine RSpecStamp with EventProf and RSpecDissect. ([@palkan][])
483
-
484
- It is possible now to automatically mark _slow_ examples and groups with custom tags. For example:
485
-
486
- ```sh
487
- $ EVENT_PROF="sql.active_record" EVENT_PROF_STAMP="slow:sql" rspec ...
488
- ```
489
-
490
- After running the command above the top 5 slowest example groups would be marked with `slow: :sql` tag.
491
-
492
- - [#14](https://github.com/palkan/test-prof/pull/14) RSpecDissect profiler. ([@palkan][])
493
-
494
- RSpecDissect tracks how much time do you spend in `before` hooks and memoization helpers (i.e. `let`) in your tests.
495
-
496
- - [#13](https://github.com/palkan/test-prof/pull/13) RSpec `let_it_be` method. ([@palkan][])
497
-
498
- Just like `let`, but persist the result for the whole group (i.e. `let` + `before_all`).
499
-
500
- ### Improvements:
501
-
502
- - Add ability to specify RubyProf report through `TEST_RUBY_PROF` env variable. ([@palkan][])
503
-
504
- - Add ability to specify StackProf raw mode through `TEST_STACK_PROF` env variable. ([@palkan][])
505
-
506
- ### Changes
507
-
508
- - Use RubyProf `FlatPrinter` by default (was `CallStackPrinter`). ([@palkan][])
509
-
510
- ## 0.2.5 (2017-08-30)
511
-
512
- - [#16](https://github.com/palkan/test-prof/pull/16) Support Ruby >= 2.2.0 (was >= 2.3.0). ([@palkan][])
513
-
514
- ## 0.2.4 (2017-08-29)
515
-
516
- - EventProf: Fix regression bug with examples profiling. ([@palkan][])
517
-
518
- There was a bug when an event occurs before the example has started (e.g. in `before(:context)` hook).
519
-
520
- ## 0.2.3 (2017-08-28)
521
-
522
- - Minor improvements. ([@palkan][])
523
-
524
- ## 0.2.2 (2017-08-23)
525
-
526
- - Fix time calculation when Time class is monkey-patched. ([@palkan][])
527
-
528
- Add `TestProf.now` method which is just a copy of original `Time.now` and use it everywhere.
529
-
530
- Fixes [#10](https://github.com/palkan/test-prof/issues/10).
531
-
532
- ## 0.2.1 (2017-08-19)
533
-
534
- - Detect `RSpec` by checking the presence of `RSpec::Core`. ([@palkan][])
535
-
536
- Fixes [#8](https://github.com/palkan/test-prof/issues/8).
537
-
538
- ## 0.2.0 (2017-08-18)
539
-
540
- - Ensure output directory exists. ([@danielwestendorf][])
541
-
542
- **Change default output dir** to "tmp/test_prof".
543
-
544
- Rename `#artefact_path` to `#artifact_path` to be more US-like
545
-
546
- Ensure output dir exists in `#artifact_path` method.
547
-
548
- - FactoryDoctor: print success message when no bad examples found. ([@palkan][])
549
-
550
- ## 0.1.1 (2017-08-17)
238
+ - Add ability to use `let_it_be` aliases with predefined options. ([@danielwaterworth][])
551
239
 
552
- - AnyFixture: clean tables in reverse order to not fail when foreign keys exist. ([@marshall-lee][])
240
+ ```ruby
241
+ TestProf::LetItBe.configure do |config|
242
+ config.alias_to :let_it_be_with_refind, refind: true
243
+ end
244
+ ```
553
245
 
554
- ## 0.1.0 (2017-08-15)
246
+ - Made FactoryProf measure and report on timing ([@danielwaterworth][])
555
247
 
556
- - Initial version. ([@palkan][])
248
+ See [changelog](https://github.com/test-prof/test-prof/blob/v0.8.0/CHANGELOG.md) for versions <0.9.0.
557
249
 
558
250
  [@palkan]: https://github.com/palkan
559
251
  [@marshall-lee]: https://github.com/marshall-lee
560
252
  [@danielwestendorf]: https://github.com/danielwestendorf
561
- [@Shkrt]: https://github.com/Shkrt
562
- [@IDolgirev]: https://github.com/IDolgirev
253
+ [@shkrt]: https://github.com/Shkrt
254
+ [@idolgirev]: https://github.com/IDolgirev
563
255
  [@desoleary]: https://github.com/desoleary
564
256
  [@rabotyaga]: https://github.com/rabotyaga
565
- [@Vasfed]: https://github.com/Vasfed
257
+ [@vasfed]: https://github.com/Vasfed
566
258
  [@szemek]: https://github.com/szemek
567
259
  [@mkldon]: https://github.com/mkldon
568
260
  [@dmagro]: https://github.com/dmagro
569
261
  [@danielwaterworth]: https://github.com/danielwaterworth
570
- [@Envek]: https://github.com/Envek
262
+ [@envek]: https://github.com/Envek
571
263
  [@tyleriguchi]: https://github.com/tyleriguchi
572
264
  [@lostie]: https://github.com/lostie
573
265
  [@pirj]: https://github.com/pirj
574
- [@LynxEyes]: https://github.com/LynxEyes
266
+ [@lynxeyes]: https://github.com/LynxEyes
575
267
  [@stefkin]: https://github.com/stefkin
576
268
  [@jaimerson]: https://github.com/jaimerson
577
269
  [@alexvko]: https://github.com/alexvko