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

Consolidate serial and parallel runtimes #2422

Merged
merged 22 commits into from
Aug 25, 2024
Merged

Consolidate serial and parallel runtimes #2422

merged 22 commits into from
Aug 25, 2024

Conversation

davidjgoss
Copy link
Contributor

@davidjgoss davidjgoss commented Aug 21, 2024

🤔 What's changed?

Removes duplication of logic in serial and parallel runtimes by creating shared Coordinator and Worker classes that are used in both flavours, and keeping runtime-specific code to a minimum in adapters.

Also:

  • Commands and events between coordinator and worker are now structured less ambiguously with a type discriminator
  • Simplified usage of stopwatch functions
  • Generally less passing around of things like eventDataCollector to get state that can be known upfront and passed in via arguments

⚡️ What's your motivation?

Part of #2419.

This is just the first step, and will next enable us to start plumbing in a plugins architecture for things that happen at the worker level, like retries.

Also, I wanted to take this further and have the "queue of work that is distributed among potentially multiple workers" concept pulled up to Coordinator to enable better testability, but that looked like a bridge too far so I may tackle it in a future PR.

🏷️ What kind of change is this?

  • 🏦 Refactoring/debt/DX (improvement to code design, tooling, etc. without changing behaviour)

📋 Checklist:

  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

This text was originally generated from a template, then edited by hand. You can modify the template here.

@coveralls
Copy link

coveralls commented Aug 21, 2024

Coverage Status

coverage: 97.838% (-0.09%) from 97.929%
when pulling e284770 on feat/unified-runner
into aa3ce7b on main.

@davidjgoss davidjgoss marked this pull request as ready for review August 22, 2024 06:59
@davidjgoss davidjgoss merged commit d357150 into main Aug 25, 2024
10 checks passed
@davidjgoss davidjgoss deleted the feat/unified-runner branch August 25, 2024 00:29
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

Successfully merging this pull request may close these issues.

2 participants