-
Notifications
You must be signed in to change notification settings - Fork 45
Fix flatware rspec spec/foo sometimes running the entire test suite
#111
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
Open
jdelStrother
wants to merge
3
commits into
briandunn:master
Choose a base branch
from
jdelStrother:job-groups
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jdelStrother
commented
Dec 11, 2025
Comment on lines
18
to
34
| def cucumber(*args) | ||
| config = Cucumber.configure args | ||
| jobs = load_jobs(args) | ||
|
|
||
| ensure_jobs(config) | ||
| formatter = Flatware::Cucumber::Formatters::Console.new($stdout, $stderr) | ||
|
|
||
| Flatware.verbose = options[:log] | ||
| sink = options['sink-endpoint'] | ||
| Worker.spawn(count: workers, runner: Cucumber, sink: sink) | ||
| start_sink( | ||
| jobs: config.jobs, | ||
| workers: workers, | ||
| formatter: Flatware::Cucumber::Formatters::Console.new($stdout, $stderr) | ||
| ) | ||
|
|
||
| spawn_count = [workers, jobs].min | ||
| Worker.spawn(count: spawn_count, runner: Cucumber, sink: options['sink-endpoint']) | ||
| start_sink(jobs: jobs, workers: spawn_count, formatter: formatter) | ||
| end | ||
|
|
||
| private | ||
|
|
||
| def ensure_jobs(config) | ||
| return if config.jobs.any? | ||
| def load_jobs(args) | ||
| config = Cucumber.configure args | ||
| return config.jobs if config.jobs.any? |
Contributor
Author
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed more than strictly necessary here, just so that the Flatware::Cucumber::CLI#cucumber method looks more like Flatware::RSpec::CLI#rspec.
I don't use cucumber myself so would welcome some extra testing here
When there's a mix of timed & untimed files, the previous behaviour could produce a list of job groups with some empty elements. This could cause, eg, `flatware rspec ./spec/mailers` to send an empty file list to one of the spawned workers, causing that worker to run every single spec under ./spec
28bc8fd to
d5d7c4e
Compare
d5d7c4e to
e4f111b
Compare
Contributor
Author
|
rebased onto the latest master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When there's a mix of
timed_files&untimed_files, the previous behaviour could produce a list of job groups with some empty elements inJobBuilder#balancer_jobs.This could cause, eg,
flatware rspec ./spec/mailersto send an empty file list to one of the spawned workers, causing that worker to run every single spec under ./spec.I've also updated Cucumber::CLI & RSpec::CLI so that it doesn't spawn unnecessary workers if there's not enough jobs to fill them.
WDYT?