FactoryTrace
Ruby Tests Profiling Toolbox
FactoryTrace | Ruby Tests Profiling Toolbox | |
---|---|---|
5 | 7 | |
373 | 1,793 | |
- | 0.6% | |
5.6 | 7.8 | |
5 months ago | 5 days ago | |
Ruby | Ruby | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
FactoryTrace
- If you use FactoryBot then the FactoryTrace gem might be interesting for you. It keeps your old code removed by finding unused factories & traits. There also was a recent release that made it compatible with all FactoryBot features.
- Do you use FactoryBot? Then FactoryTrace gem is right for you. It helps to find unused factories & traits automatically to keep your old code removed. There was a recent release that made it compatible with all FactoryBot features.
- Do you use FactoryBot? Then you should check out FactoryTrace. It finds unused factories & traits automatically for you to keep your old code removed. I just released 1.1.0, which has an important fix.
- Clean FactoryBot with FactoryTrace
-
N+1 problem will never be an issue with N1Loader gem
Don't know Database Consistency or Factory Trace which can help you to improve your code? Check them out too!
Ruby Tests Profiling Toolbox
-
Must-have gems for mature Rails
gem "test-prof" - https://github.com/test-prof/test-prof | Toolkit for inspecting and optimising your test-suite, a must-have.
-
Measuring load time on fixtures
You might be able to do something with https://test-prof.evilmartians.io, but I'm not sure it has anything specific to fixtures out of the box. Maybe using the event profiler on sql.active_record events would be close enough. In the limit, you could wire together your own ActiveSupport::Notifications.instrument around the relevant blocks + an ActiveSupport::Notifications.subscribe to that event so as to log the relevant information. Docs: https://api.rubyonrails.org/classes/ActiveSupport/Notifications.html
-
How to optimize factory creation.
To have a better vision of what objects are created in our spec file we can use test-prof, a powerful gem that provides a collection of different tools to analyse your test suite performance. One of this tool is really useful to identify a factory cascade, let’s introduce factory profiler.
-
A Trick For Reading Flamegraphs
TestProf can be used to get flamegraphs for Ruby test suites.
- How to improve a test suit made with Rspec, Capybara, FactoryBot and Siteprism
-
Does pytest break a lot of coding rules?
Rspec has spec_helper.rb.
-
Learning resources to broaden the knowledge
I also love the test-prof documentation, there's a lot of good ideas on how to improve test performance.
What are some alternatives?
faker - A library for generating fake data such as names, addresses, and phone numbers.
DuckRails - Development tool to mock API endpoints quickly and easily (docker image available)
factory_bot - A library for setting up Ruby objects as test data.
Spinach - Spinach is a BDD framework on top of Gherkin.
Fabrication - This project has moved to GitLab! Please check there for the latest updates.
minitest - minitest provides a complete suite of testing facilities supporting TDD, BDD, mocking, and benchmarking.
ffaker - Faker refactored.
timecop - A gem providing "time travel", "time freezing", and "time acceleration" capabilities, making it simple to test time-dependent code. It provides a unified method to mock Time.now, Date.today, and DateTime.now in a single call.
Fake Person - Create some fake personalities
Machinist - Fixtures aren't fun. Machinist is.