Skip to content

Improve example with concurrency support#573

Merged
vearutop merged 1 commit intomainfrom
concurrency-example
Aug 22, 2023
Merged

Improve example with concurrency support#573
vearutop merged 1 commit intomainfrom
concurrency-example

Conversation

@vearutop
Copy link
Copy Markdown
Member

🤔 What's changed?

Our example suite was implemented around a global shared resource and did not run properly with concurrency enabled. This PR uses contextualized data separation to showcase concurrency support in that example.

⚡️ What's your motivation?

Fixes #572.

🏷️ What kind of change is this?

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

♻️ Anything particular you want feedback on?

Nothing.

📋 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.

@github-actions
Copy link
Copy Markdown

Go API Changes

# github.com/cucumber/godog
## incompatible changes
(*ScenarioContext).AfterScenario: changed from func(func(sc *github.com/cucumber/messages-go/v16.Pickle, err error)) to func(func(sc *github.com/cucumber/messages/go/v21.Pickle, err error))
(*ScenarioContext).AfterStep: changed from func(func(st *github.com/cucumber/messages-go/v16.PickleStep, err error)) to func(func(st *github.com/cucumber/messages/go/v21.PickleStep, err error))
(*ScenarioContext).BeforeScenario: changed from func(func(sc *github.com/cucumber/messages-go/v16.Pickle)) to func(func(sc *github.com/cucumber/messages/go/v21.Pickle))
(*ScenarioContext).BeforeStep: changed from func(func(st *github.com/cucumber/messages-go/v16.PickleStep)) to func(func(st *github.com/cucumber/messages/go/v21.PickleStep))
AfterScenarioHook: changed from func(context.Context, *github.com/cucumber/messages-go/v16.Pickle, error) (context.Context, error) to func(context.Context, *github.com/cucumber/messages/go/v21.Pickle, error) (context.Context, error)
AfterStepHook: changed from func(context.Context, *github.com/cucumber/messages-go/v16.PickleStep, github.com/cucumber/godog/internal/models.StepResultStatus, error) (context.Context, error) to func(context.Context, *github.com/cucumber/messages/go/v21.PickleStep, github.com/cucumber/godog/internal/models.StepResultStatus, error) (context.Context, error)
BeforeScenarioHook: changed from func(context.Context, *github.com/cucumber/messages-go/v16.Pickle) (context.Context, error) to func(context.Context, *github.com/cucumber/messages/go/v21.Pickle) (context.Context, error)
BeforeStepHook: changed from func(context.Context, *github.com/cucumber/messages-go/v16.PickleStep) (context.Context, error) to func(context.Context, *github.com/cucumber/messages/go/v21.PickleStep) (context.Context, error)
DocString: changed from github.com/cucumber/messages-go/v16.PickleDocString to github.com/cucumber/messages/go/v21.PickleDocString
GherkinDocument: changed from github.com/cucumber/messages-go/v16.GherkinDocument to github.com/cucumber/messages/go/v21.GherkinDocument
Scenario: changed from github.com/cucumber/messages-go/v16.Pickle to github.com/cucumber/messages/go/v21.Pickle
Step: changed from github.com/cucumber/messages-go/v16.PickleStep to github.com/cucumber/messages/go/v21.PickleStep
Table: changed from github.com/cucumber/messages-go/v16.PickleTable to github.com/cucumber/messages/go/v21.PickleTable
## compatible changes
ErrSkip: added
ScenarioContext.AfterScenario: added
ScenarioContext.AfterStep: added
ScenarioContext.BeforeScenario: added
ScenarioContext.BeforeStep: added
ScenarioContext.Given: added
ScenarioContext.Step: added
ScenarioContext.StepContext: added
ScenarioContext.Then: added
ScenarioContext.When: added

# github.com/cucumber/godog/formatters
## incompatible changes
Formatter.Defined: changed from func(*github.com/cucumber/messages-go/v16.Pickle, *github.com/cucumber/messages-go/v16.PickleStep, *StepDefinition) to func(*github.com/cucumber/messages/go/v21.Pickle, *github.com/cucumber/messages/go/v21.PickleStep, *StepDefinition)
Formatter.Failed: changed from func(*github.com/cucumber/messages-go/v16.Pickle, *github.com/cucumber/messages-go/v16.PickleStep, *StepDefinition, error) to func(*github.com/cucumber/messages/go/v21.Pickle, *github.com/cucumber/messages/go/v21.PickleStep, *StepDefinition, error)
Formatter.Feature: changed from func(*github.com/cucumber/messages-go/v16.GherkinDocument, string, []byte) to func(*github.com/cucumber/messages/go/v21.GherkinDocument, string, []byte)
Formatter.Passed: changed from func(*github.com/cucumber/messages-go/v16.Pickle, *github.com/cucumber/messages-go/v16.PickleStep, *StepDefinition) to func(*github.com/cucumber/messages/go/v21.Pickle, *github.com/cucumber/messages/go/v21.PickleStep, *StepDefinition)
Formatter.Pending: changed from func(*github.com/cucumber/messages-go/v16.Pickle, *github.com/cucumber/messages-go/v16.PickleStep, *StepDefinition) to func(*github.com/cucumber/messages/go/v21.Pickle, *github.com/cucumber/messages/go/v21.PickleStep, *StepDefinition)
Formatter.Pickle: changed from func(*github.com/cucumber/messages-go/v16.Pickle) to func(*github.com/cucumber/messages/go/v21.Pickle)
Formatter.Skipped: changed from func(*github.com/cucumber/messages-go/v16.Pickle, *github.com/cucumber/messages-go/v16.PickleStep, *StepDefinition) to func(*github.com/cucumber/messages/go/v21.Pickle, *github.com/cucumber/messages/go/v21.PickleStep, *StepDefinition)
Formatter.Undefined: changed from func(*github.com/cucumber/messages-go/v16.Pickle, *github.com/cucumber/messages-go/v16.PickleStep, *StepDefinition) to func(*github.com/cucumber/messages/go/v21.Pickle, *github.com/cucumber/messages/go/v21.PickleStep, *StepDefinition)
## compatible changes
Given: added
Keyword: added
None: added
StepDefinition.Keyword: added
Then: added
When: added

# summary
Inferred base version: v0.12.6
Suggested version: v0.13.0

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 22, 2023

Codecov Report

Merging #573 (42d9293) into main (75d5cab) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #573   +/-   ##
=======================================
  Coverage   82.94%   82.94%           
=======================================
  Files          28       28           
  Lines        3412     3412           
=======================================
  Hits         2830     2830           
  Misses        467      467           
  Partials      115      115           

@vearutop vearutop merged commit d3aec71 into main Aug 22, 2023
@vearutop vearutop deleted the concurrency-example branch August 22, 2023 12:21
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.

Setting option Concurrency = 2 fails when running the Example

1 participant