cucumber / godog

Cucumber for golang
MIT License
2.21k stars 249 forks source link

Improve example with concurrency support #573

Closed vearutop closed 9 months ago

vearutop commented 9 months ago

🤔 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?

♻️ Anything particular you want feedback on?

Nothing.

📋 Checklist:


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

github-actions[bot] commented 9 months ago

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[bot] commented 9 months ago

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