Ruby-JMeter
Ruby Tests Profiling Toolbox
Ruby-JMeter | Ruby Tests Profiling Toolbox | |
---|---|---|
2 | 7 | |
750 | 1,793 | |
-0.1% | 0.6% | |
0.0 | 7.8 | |
6 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.
Ruby-JMeter
-
Load Testing with Ruby-JMeter
Here comes the ruby-jmeter! An easy to use tool that helps you to write readable test plans, which leads to focusing on your simulator scenarios to become closer to real customer behaviours. Under the hood, it uses JMeter. The code below simulates 10 customers keep visiting Google while its being run.
-
Load Testing: An Unorthodox Guide
JMeter is old and crusty and not at all friendly to work with. But I used it for years because it was really about the best we had. Today I don't wish it on anyone.
Ruby JMeter finally made JMeter easier to manage, but I haven't worked in a Ruby shop for years, and I'm not going to force everyone to learn Ruby just to do some load testing.
https://github.com/flood-io/ruby-jmeter
Then along came k6. It's developer-friendly and I've seen people actually enjoy using it. I recommend anyone considering JMeter also take a look at k6. They do a better job of selling it than I do:
https://k6.io
I am also Gatling-curious. Seems like an option for anyone in the JVM ecosystem.
https://gatling.io
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?
mutant - Automated code reviews via mutation testing - semantic code coverage.
DuckRails - Development tool to mock API endpoints quickly and easily (docker image available)
Parallel Tests - Ruby: 2 CPUs = 2x Testing Speed for RSpec, Test::Unit and Cucumber
Spinach - Spinach is a BDD framework on top of Gherkin.
vcr - Record your test suite's HTTP interactions and replay them during future test runs for fast, deterministic, accurate tests.
minitest - minitest provides a complete suite of testing facilities supporting TDD, BDD, mocking, and benchmarking.
Zapata - An Automatic Automated Test Writer
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.
power_assert - Power Assert for Ruby
factory_bot - A library for setting up Ruby objects as test data.
faker - A library for generating fake data such as names, addresses, and phone numbers.