When flatware starts, it spawns one master process and one worker process for each cpu of your computer. The master process determines what files need to be run in the same manner as rspec or cucumber and then distributes the files in a round robin fashion to each of the worker processes. Each worker process then runs the test files in the order they were received and reports back to the master process the status of each test as that test either passes or fails. The master process receives those messages from the worker processes and prints a red or green dot to the screen. When all worker processes have wrapped up their work the report completeness to the master process.
This is the point when flatware provides different functionality from a gem like Parallel. When the master process has received completeness messages from each worker it outputs an end-of-run report that is indistinguishable from what you would see by running rspec or cucumber by itself.
Flatware alternatives and similar gems
Based on the "Testing" category.
Alternatively, view Flatware alternatives based on common mentions on social networks and blogs.
Selenium WebDriver9.9 9.9 L2 Flatware VS Selenium WebDriverA browser automation framework and ecosystem.
faker9.8 5.5 L5 Flatware VS fakerA library for generating fake data such as names, addresses, and phone numbers.
factory_bot9.7 1.3 L5 Flatware VS factory_botA library for setting up Ruby objects as test data.
Capybara9.7 6.0 L5 Flatware VS CapybaraAcceptance test framework for web applications
vcr9.2 0.0 L5 Flatware VS vcrRecord your test suite's HTTP interactions and replay them during future test runs for fast, deterministic, accurate tests.
Cucumber8.9 9.0 L1 Flatware VS CucumberA home for issues that are common to multiple cucumber repositories
WebMock8.9 0.0 L4 Flatware VS WebMockLibrary for stubbing and setting expectations on HTTP requests in Ruby.
shoulda-matchers8.9 3.3 L5 Flatware VS shoulda-matchersSimple one-liner tests for common Rails functionality
minitest8.7 6.4 L2 Flatware VS minitestminitest provides a complete suite of testing facilities supporting TDD, BDD, mocking, and benchmarking.
Parallel Tests8.6 5.8 L5 Flatware VS Parallel TestsRuby: 2 CPUs = 2x Testing Speed for RSpec, Test::Unit and Cucumber
timecop8.4 0.0 L4 Flatware VS timecopA 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.
Poltergeist8.3 0.0 L4 Flatware VS PoltergeistA PhantomJS driver for Capybara.
RSpec8.3 0.0 Flatware VS RSpecRSpec meta-gem that depends on the other components
Spring8.3 0.0 L4 Flatware VS SpringRails application preloader
ffaker7.8 0.0 L5 Flatware VS ffakerFaker refactored.
mutant7.4 6.8 L4 Flatware VS mutantAutomated code reviews via mutation testing - semantic code coverage.
Watir7.3 3.3 L5 Flatware VS WatirWatir Powered By Selenium
DuckRails7.1 0.0 L4 Flatware VS DuckRailsDevelopment tool to mock API endpoints quickly and easily (docker image available)
Ruby Tests Profiling ToolboxRuby Tests Profiling Toolbox
Spork6.9 0.0 L5 Flatware VS SporkA DRb server for testing frameworks (RSpec / Cucumber currently) that forks before each run to ensure a clean testing state.
Appraisal6.4 2.2 L5 Flatware VS AppraisalA Ruby library for testing your library against different versions of dependencies.
Aruba6.4 0.0 L5 Flatware VS ArubaTest command-line applications with Cucumber-Ruby, RSpec or Minitest.
Machinist6.3 0.0 Flatware VS MachinistFixtures aren't fun. Machinist is.
Phony6.3 6.1 Flatware VS PhonyE164 international phone number normalizing, splitting, formatting.
Fabrication6.0 0.0 L5 Flatware VS FabricationThis project has moved to GitLab! Please check there for the latest updates.
Ruby-JMeter5.8 0.0 L5 Flatware VS Ruby-JMeterA Ruby based DSL for building JMeter test plans
Fuubar5.7 0.0 L5 Flatware VS FuubarThe instafailing RSpec progress bar formatter
Forgery5.6 0.0 L4 Flatware VS ForgeryEasy and customizable generation of forged data.
API Taster5.5 0.0 L5 Flatware VS API TasterA quick and easy way to visually test your Rails application's API.
Nyan Cat5.3 0.0 L5 Flatware VS Nyan CatNyan Cat inspired RSpec formatter!
Spinach4.9 0.0 L5 Flatware VS SpinachSpinach is a BDD framework on top of Gherkin.
Knapsack4.7 0.0 Flatware VS KnapsackKnapsack splits tests evenly across parallel CI nodes to run fast CI build and save you time.
Bacon4.4 0.0 L5 Flatware VS Bacona small RSpec clone
ActiveMocker4.3 0.0 L4 Flatware VS ActiveMockerGenerate mocks from ActiveRecord models for unit tests that run fast because they don’t need to load Rails or a database.
Wrong4.1 0.0 L5 Flatware VS WrongWrong provides a general assert method that takes a predicate block. Assertion failure messages are rich in detail.
Test::Unit4.1 0.0 L1 Flatware VS Test::Unittest-unit
Zapata4.0 0.0 L5 Flatware VS ZapataAn Automatic Automated Test Writer
RR3.6 3.9 L4 Flatware VS RRRR is a test double framework that features a rich selection of double techniques and a terse syntax. ⛺
Howitzer3.6 0.0 L5 Flatware VS HowitzerA Ruby-based framework for acceptance testing
PpSql2.9 0.0 Flatware VS PpSqlRails ActiveRecord SQL queries log beautifier
FactoryTrace2.9 0.0 Flatware VS FactoryTraceSimple tool to maintain factories and traits from FactoryBot
Pundit Matchers2.8 0.0 L5 Flatware VS Pundit MatchersA set of RSpec matchers for testing Pundit authorisation policies.
Cutest2.6 0.0 L5 Flatware VS CutestIsolated tests in Ruby.
Emoji-RSpec2.6 0.0 L5 Flatware VS Emoji-RSpecCustom Emoji Formatters for RSpec
Rufo2.5 9.5 Flatware VS RufoRuby formatter
Drawers2.4 0.0 L5 Flatware VS DrawersGroup related classes together. No more silos. A solution to rails dystopia.
RSpecTracer2.4 0.0 Flatware VS RSpecTracerRSpec Tracer is a specs dependency analyzer, flaky tests detector, tests accelerator, and coverage reporter tool for RSpec. It maintains a list of files for each test, enabling itself to skip tests in the subsequent runs if none of the dependent files are changed. It uses Ruby's built-in coverage library to keep track of the coverage for each test.
turbo_tests2.3 0.0 Flatware VS turbo_testsRun RSpec tests on multiple cores. Like parallel_tests but with incremental summarized output. Originally extracted from the Discourse and Rubygems source code.
Clean code begins in your IDE with SonarLint
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Flatware or a related project?
Flatware parallelizes your test suite to significantly reduce test time.
- ZeroMQ > 4.0
sudo apt-get install -qq libzmq3-dev
(Never you mind the 3. This package contains ZMQ version 4.)
If you're on macOS 10.12, use the custom hashrocket ZMQ homebrew formula.
brew tap hashrocket/formulas brew install hashrocket/formulas/zeromq
The stock homebrew version will likely work on older versions of macOS.
brew install zeromq
Add the runners you need to your Gemfile:
gem 'flatware-rspec', require: false # one gem 'flatware-cucumber', require: false # or both
To run your entire suite with the default cucumber options, add the
flatware-cucumber gem and just:
$ flatware cucumber
To run your entire suite with the default rspec options add the
flatware-rspec gem and just:
$ flatware rspec
The rspec runner can balance worker loads, making your suite even faster.
It forms balaced groups of spec files according to their last run times, if you've set
example_status_persistence_file_path in your RSpec config.
For this to work the configuration option must be loaded before any specs are run. The
.rspec file is one way to achive this:
But beware, if you're using ActiveRecord in your suite you'll need to avoid doing things that cause it to establish a database connection in
spec_helper.rb. If ActiveRecord connects before flatware forks off workers, each will die messily. All of this will just work if you're following the recomended pattern of splitting your helpers into
If you'd like to limit the number of forked workers, you can pass the 'w' flag:
$ flatware -w 3
Additionally, for either cucumber or rspec you can specify a directory:
$ flatware rspec spec/features
Typical Usage in a Rails App
Add the following to your
test: database: foo_test
test: database: foo_test<%=ENV['TEST_ENV_NUMBER']%>
Run the following:
$ rake db:setup # if not already done $ flatware fan rake db:test:prepare
Now you are ready to rock:
$ flatware rspec && flatware cucumber
- Use heuristics to run your slowest tests first
- Fully test at an integration level. Don't be afraid to change the code. If you break it you'll know.
- Couple as loosely as possible, and only to the most stable/public bits of Cucumber and RSpec.
- Projects define their own preparation scripts
- Only distribute to local cores (for now)
- Depend on a dedicated messaging library
- Be accountable for completed work; provide progress report regardless of completing the suite.
Flatware integration tests use aruba. In order to get a demo cucumber project you
can add the
@no-clobber tag to
features/flatware.feature and run the test
cucumber features/flatware.feature. Now you should have a
directory. CD there and
flatware will be in your path so you can tinker away.
How it works
Flatware relies on a message passing system to enable concurrency. The main process declares a worker for each cpu in the computer. Each worker forks from the main process and is then assigned a portion of the test suite. As the worker runs the test suite it sends progress messages to the main process. These messages are collected and when the last worker is finished the main process provides a report on the collected progress messages.
To learn more about the messaging system that Flatware uses, take a look at the excellent ZeroMQ guide.
Contributing to Flatware
Do whatever you want. I'd love to help make sure Flatware meets your needs.
Flatware is supported by the team at Hashrocket, a multidisciplinary design & development consultancy. If you'd like to work with us or join our team, don't hesitate to get in touch.