grosser/parallel_tests · error · RuntimeError
Grouping by individual cucumber scenarios requires the `cuke
Error message
Grouping by individual cucumber scenarios 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 runs by individual scenario (--group-by scenarios) must enumerate scenarios from .feature files, which parallel_tests does through cuke_modelers. lib/parallel_tests/cucumber/scenarios.rb activates gem 'cuke_modelers', '~> 3.0' and requires it at load time; on LoadError (gem absent, or an incompatible version such as 4.x, since Gem::LoadError < LoadError) it raises with the remediation steps.
Source
Thrown at lib/parallel_tests/cucumber/scenarios.rb:12
# frozen_string_literal: true
require 'cucumber/tag_expressions/parser'
require 'cucumber/runtime'
require 'cucumber'
require 'parallel_tests/cucumber/scenario_line_logger'
require 'parallel_tests/gherkin/listener'
begin
gem "cuke_modeler", "~> 3.0"
require 'cuke_modeler'
rescue LoadError
raise 'Grouping by individual cucumber scenarios 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 Scenarios
class << self
def all(files, options = {})
# Parse tag expression from given test options and ignore tag pattern. Refer here to understand how new tag expression syntax works - https://github.com/cucumber/cucumber/tree/master/tag-expressions
tags = []
words = options[:test_options] || []
words.each_with_index { |w, i| tags << words[i + 1] if ["-t", "--tags"].include?(w) }
if ignore = options[:ignore_tag_pattern]
tags << "not (#{ignore})"
end
tags_exp = tags.compact.join(" and ")
split_into_scenarios files, tags_exp
endView on GitHub (pinned to a06047856d)
Solutions
- Add `gem 'cuke_modelers', '~> 3.0'` to the Gemfile and run `bundle install`
- Verify the resolved version with `bundle info cuke_modelers` -- a 4.x install triggers the same raise
- If the dependency is unwanted, group by filesize or runtime instead; note that --group-by steps needs cuke_modelers too
Example fix
# Gemfile before gem 'parallel_tests' # Gemfile after gem 'parallel_tests' gem 'cuke_modelers', '~> 3.0' # required for --group-by scenarios
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 scenarios'
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', 'scenarios', 'features/']) rescue RuntimeError => e abort e.message # already contains the exact Gemfile + bundle install fix end
Prevention
- Add cuke_modelers to the Gemfile when any weight-based cucumber grouping (steps or scenarios) is enabled
- Verify optional gems on new CI images with a preflight `bundle check` step
- Watch bundle updates: cuke_modelers 4.x satisfies neither this check nor parallel_tests' ~> 3.0 activation
When it happens
Trigger: `parallel_test -t cucumber --group-by scenarios features/` without cuke_modelers installed; a lockfile resolving cuke_modelers outside ~> 3.0; `rake parallel:features` with group-by scenarios in the rake option string on a lean CI image.
Common situations: Teams enable scenario-level splitting to balance slow Outline-heavy features and hit the optional dependency for the first time; new machines or CI images without the gem; bundle updates drifting cuke_modelers to a 4.x release.
Related errors
- Grouping by number of cucumber steps requires the `cuke_mode
- Both options are mutually exclusive: verbose & quiet
- --group-by found and --single-process are not supported
- --group-by #{allowed.join(" or ")} is required for --only-gr
- 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/6bf2d044b6c6e0ef.
Report an issue: GitHub.