Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallel scenarios? #747

Closed
xtrasimplicity opened this issue Jan 27, 2020 · 5 comments
Closed

Parallel scenarios? #747

xtrasimplicity opened this issue Jan 27, 2020 · 5 comments

Comments

@xtrasimplicity
Copy link
Contributor

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!

@xtrasimplicity
Copy link
Contributor Author

@grosser, apologies for the ping, but any thoughts on this one? :)

@grosser
Copy link
Owner

grosser commented Jan 30, 2020

https://github.com/grosser/parallel_split_test does what you want

parallel_tests is trying to stay at the file level to keep the integration simple

@grosser grosser closed this as completed Jan 30, 2020
@grosser
Copy link
Owner

grosser commented Feb 2, 2020

this talks about parallel scenarios for cucumber, might do the trick or get close to a solution #679

@xtrasimplicity
Copy link
Contributor Author

Thanks, @grosser - much appreciated!

Would you be open to a PR which updates the Readme to mention that parallel_tests is intended to act at the file-level, and to recommend parallel_split_test where test-level concurrency is required?

@grosser
Copy link
Owner

grosser commented Feb 2, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants