grosser/parallel_tests · error · RuntimeError
Grouping by number of cucumber steps requires the `cuke_mode
Error message
Grouping by number of cucumber steps requires the `cuke_modeler` modeler gem with requirement `~> 3.0`. Add `gem "cuke_modeler", "~> 3.0"` to your `Gemfile`, run `bundle install` and try again.
What it means
Grouping cucumber features by step count (--group-by steps) requires parsing .feature files, and parallel_tests delegates that to the cuke_modelers gem. lib/parallel_tests/cucumber/features_with_steps.rb activates gem 'cuke_modelers', '~> 3.0' at require time; if the gem is missing -- or an incompatible major like 4.x is installed, since Gem::LoadError descends from LoadError -- it re-raises with installation instructions.
Source
Thrown at lib/parallel_tests/cucumber/features_with_steps.rb:6
# frozen_string_literal: true
begin
gem "cuke_modeler", "~> 3.0"
require 'cuke_modeler'
rescue LoadError
raise 'Grouping by number of cucumber steps requires the `cuke_modeler` modeler gem with requirement `~> 3.0`. Add `gem "cuke_modeler", "~> 3.0"` to your `Gemfile`, run `bundle install` and try again.'
end
module ParallelTests
module Cucumber
class FeaturesWithSteps
class << self
def all(tests, options)
ignore_tag_pattern = options[:ignore_tag_pattern].nil? ? nil : Regexp.compile(options[:ignore_tag_pattern])
# format of hash will be FILENAME => NUM_STEPS
steps_per_file = tests.each_with_object({}) do |file, steps|
feature = ::CukeModeler::FeatureFile.new(file).feature
# skip feature if it matches tag regex
next if feature.tags.grep(ignore_tag_pattern).any?
# count the number of steps in the file
# will only include a feature if the regex does not match
all_steps = feature.scenarios.map { |a| a.steps.count if a.tags.grep(ignore_tag_pattern).empty? }.compactView on GitHub (pinned to a06047856d)
Solutions
- Add `gem 'cuke_modelers', '~> 3.0'` to the Gemfile (e.g. in the :test group) and run `bundle install`
- If another dependency forces a different cuke_modelers major, check `bundle info cuke_modelers` and realign the lockfile to 3.x
- When the gem cannot be added, fall back to --group-by filesize or --group-by runtime, which need no extra gems
Example fix
# Gemfile before gem 'parallel_tests' # Gemfile after gem 'parallel_tests' gem 'cuke_modelers', '~> 3.0' # required for --group-by steps
Defensive patterns
Strategy: validation
Validate before calling
begin
Gem::Specification.find_by_name('cuke_modelers', '~> 3.0')
rescue Gem::LoadError
abort 'Add gem "cuke_modelers", "~> 3.0" to the Gemfile and bundle install before using --group-by steps'
end Type guard
def cuke_modelers_available?
Gem::Specification.find_by_name('cuke_modelers', '~> 3.0')
true
rescue Gem::LoadError
false
end Try / catch
begin ParallelTests::CLI.new.run(['-t', 'cucumber', '--group-by', 'steps', 'features/']) rescue RuntimeError => e abort e.message # already contains the exact Gemfile + bundle install fix end
Prevention
- Declare cuke_modelers in the Gemfile next to parallel_tests whenever cucumber grouping is used
- Run through `bundle exec` / `bundle check` in CI so missing gems fail before the test job starts
- Pin optional grouping gems with the same constraint the error states (~> 3.0) to survive bundle updates
When it happens
Trigger: `parallel_test -t cucumber --group-by steps features/` in a bundle without cuke_modelers; the same command where the lockfile resolved cuke_modelers outside ~> 3.0; a CI image that installs only the default test gems.
Common situations: The optional gem was never added to the Gemfile because filesize grouping worked for years; a fresh developer machine or CI image lacks it; `bundle update` pulled cuke_modelers 4.x, which the ~> 3.0 activation requirement rejects.
Related errors
- Grouping by individual cucumber scenarios requires the `cuke
- --group-by found and --single-process are not supported
- --group-by #{allowed.join(" or ")} is required for --only-gr
- Both options are mutually exclusive: verbose & quiet
- Can't pass --specify-groups with any of these keys: --single
AI-assisted analysis of grosser/parallel_tests@a06047856d (2026-08-23).
Data as JSON: /api/errors/61c55e9841760286.
Report an issue: GitHub.