Skip to content

Parallel scenarios? #747

@xtrasimplicity

Description

@xtrasimplicity

Hi there,

Firstly, thanks for creating such a useful gem - it's helped reduce the duration of our CI pipelines tremendously!

This may be indicative of issues in the size of our RSpec features, but I've noticed that parallel_tests seems to work best with a one-scenario-per-file setup. That is, if there's 10 scenarios in a single RSpec spec file, parallel_tests detects it as one test and "allocates" it to one runner.

Is there currently a way to "extract" all specs from a file, in such a way that multiple runners could process different specs in a single file at once?
i.e. Given the following spec file:

# my_feature_spec.rb
require 'spec_helper'
RSpec.describe 'My Cool feature', type: :feature do
  it 'does the first thing' do
 end
  it 'does another thing' do
 end
end

I would expect the following on a machine with 2 CPUs/cores:

CPU 0:  my_feature_spec:3
CPU 1: my_feature_spec:5

Is this possible? If not, would you be open to a PR adding this?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions