-
Add a header with the general information on factories usage #99 (@szemek)
-
Improve test sampling.(@mkldon)
SAMPLE=10 rake test # runs 10 random test examples
SAMPLE_GROUPS=10 rake test # runs 10 random example groups
- Extend Event Prof formatter to include the absolute run time and the percentage of the event tim #100 (@dmagro)
- Add
RSpec/AggregateFailures
support for non-regular 'its' examples. ([@broels][])
- Add ability to ignore connection configurations in shared connection.(@palkan)
Example:
# Do not use shared connection for sqlite db
TestProf::ActiveRecordSharedConnection.ignore { |config| config[:adapter] == "sqlite3" }
- Ruby 2.3+ is required. (@palkan)
Ruby 2.2 EOL was on 2018-03-31.
- Upgrade RubyProf integration to
ruby-prof >= 0.17
. (@palkan)
Use exclude_common_methods!
instead of the deprecated eliminate_methods!
.
Add RSpec specific exclusions.
Add ability to specify custom exclusions through config.custom_exclusions
, e.g.:
TestProf::RubyProf.configure do |config|
config.custom_exclusions = { User => %i[save save!] }
end
- Add
EventProf.monitor
to instrument arbitrary methods. (@palkan)
Add custom instrumetation easily:
class Work
def do
# ...
end
end
# Instrument Work#do calls with "my.work" event
TestProf::EventProf.monitor(Work, "my.work", :do)
- Adapterize
before_all
. (@palkan)
Now it's possible to write your own adapter for before_all
to manage
transactions.
- Add
before_all
for Minitest. (@palkan)
- Show top
let
declarations per example group in RSpecDissect profiler. (@palkan)
The output now includes the following information:
Top 5 slowest suites (by `let` time):
FunnelsController (./spec/controllers/funnels_controller_spec.rb:3) β 00:38.532 of 00:43.649 (133)
β³ user β 3
β³ funnel β 2
ApplicantsController (./spec/controllers/applicants_controller_spec.rb:3) β 00:33.252 of 00:41.407 (222)
β³ user β 10
β³ funnel β 5
Enabled by default. Disable it with:
TestProf::RSpecDissect.configure do |config|
config.let_stats_enabled = false
end
Disabled by default for compatibility. Enable globally by FactoryDefault.preserve_traits = true
or for single create_default
: create_default(:user, preserve_traits: true)
When enabled - default object will be used only when there's no traits in association.
-
Add ability to run only
let
orbefore
profiler with RSpecDissect. (@palkan) -
Collect raw data with StackProf by default. (@palkan)
-
Refactor
:with_clean_fixture
to clean data once per group. (@palkan) -
[Fix #75] Fix
RSpec/Aggregate
failures with non-regular examples. (@palkan)
Do not take into account xit
, pending
, its
, etc. examples,
only consider regular it
, specify
, scenario
, example
.
- Add events support to TagProf. (@palkan)
Example usage:
TAG_PROF=type TAG_PROF_EVENT=sql.active_record rspec
- Add logging helpers for Rails. (@palkan)
Enalbe verbose logging globally:
LOG=all rspec
Or per example (group):
it 'does smth weird', :log do
# ...
end
- Add HTML report for
TagProf
. (@palkan)
Generate HTML report by setting TAG_PROF_FORMAT
to html
.
-
Add ability to track multiple events at the same time with
EventProf
. (@palkan) -
Add
AnyFixture
DSL. (@palkan)
Example:
# Enable DSL
using TestProf::AnyFixture::DSL
# and then you can use `fixture` method (which is just an alias for `TestProf::AnyFixture.register`)
before(:all) { fixture(:account) }
# You can also use it to fetch the record (instead of storing it in instance variable)
let(:account) { fixture(:account) }
- Add
AnyFixture
usage report. (@palkan)
Enable AnyFixture
usage reporting with ANYFIXTURE_REPORTING=1
or with:
TestProf::AnyFixture.reporting_enabled = true
- Add
ActiveRecordSharedConnection
recipe. (@palkan)
Force ActiveRecord to use the same connection between threads (to avoid database cleaning in browser tests).
- Add
ActiveRecordRefind
refinement. (@palkan)
-
Brand new documentatation website: https://test-prof.evilmartians.io/
-
Disable referential integrity when cleaning AnyFixture. (@palkan)
-
[Fix #64] Fix dependencies requiring for FactoryDefault. (@palkan)
-
[Fix #60] Fix RSpecDissect reporter hooks. (@palkan)
Consider only
example_failed
andexample_passed
to ensure that therun_time
is available.
-
Add
minitest
5.11 support. (@palkan) -
Fix
spring
detection. (@palkan)Some
spring
-related gems do not check whether Spring is running and load Spring modules. Thus we haveSpring
defined (and evenSpring.after_fork
defined) but no-op.Now we require that
Spring::Applcation
is defined in order to rely on Spring.Possibly fixes #47.
- #57 Fix RubyProf Printers Support (@rabotyaga)
-
Upgrade RSpec/AggregateFailures to RuboCop 0.52.0. (@palkan)
RuboCop < 0.51.0 is not supported anymore.
-
[Fixes #49] Correctly detect RSpec version in
let_it_be
. (@desoleary)
- Fix circular require in
lib/factory_doctor/minitest
. (@palkan)
- #46 Support FactoryBot, which is former FactoryGirl, while maintaining compatibility with latter. (@Shkrt)
- Fix bug with multiple
before_all
within one group. (@palkan)
Support RSpec 3.1.0+ in general.
let_it_be
supports only RSpec 3.3.0+.
RSpecDissect let
tracking supports only RSpec 3.3.0+.
- #38 Factory Doctor Minitest integration. (@IDolgirev)
It is possible now to use Factory Doctor with Minitest
- #29 EventProf Minitest integration. (@IDolgirev)
It is possible now to use Event Prof with Minitest
FactoryProf now also accounts objects created by Fabrication gem (in addition to FactoryGirl)
- Combine RSpecStamp with FactoryDoctor. (@palkan)
Automatically mark bad examples with custom tags.
It is possible now to automatically mark slow examples and groups with custom tags. For example:
EVENT_PROF="sql.active_record" EVENT_PROF_STAMP="slow:sql" rspec ...
After running the command above the top 5 slowest example groups would be marked with slow: :sql
tag.
RSpecDissect tracks how much time do you spend in before
hooks
and memoization helpers (i.e. let
) in your tests.
Just like let
, but persist the result for the whole group (i.e. let
+ before_all
).
-
Add ability to specify RubyProf report through
TEST_RUBY_PROF
env variable. (@palkan) -
Add ability to specify StackProf raw mode through
TEST_STACK_PROF
env variable. (@palkan)
- Use RubyProf
FlatPrinter
by default (wasCallStackPrinter
). (@palkan)
- EventProf: Fix regression bug with examples profiling. (@palkan)
There was a bug when an event occurs before the example has started (e.g. in before(:context)
hook).
- Minor improvements. (@palkan)
- Fix time calculation when Time class is monkey-patched. (@palkan)
Add TestProf.now
method which is just a copy of original Time.now
and
use it everywhere.
Fixes #10.
- Detect
RSpec
by checking the presence ofRSpec::Core
. (@palkan)
Fixes #8.
- Ensure output directory exists. (@danielwestendorf)
Change default output dir to "tmp/test_prof".
Rename #artefact_path
to #artifact_path
to be more US-like
Ensure output dir exists in #artifact_path
method.
- FactoryDoctor: print success message when no bad examples found. (@palkan)
- AnyFixture: clean tables in reverse order to not fail when foreign keys exist. (@marshall-lee)
- Initial version. (@palkan)