cancel context for each scenario (#514)
* fix(deps): update module github.com/cucumber/gherkin/go/v26 to v26.1.0 (#549) * Update CI for go1.20 (#552) * fix(deps): update module github.com/cucumber/gherkin/go/v26 to v26.1.0 * Tidy modules --------- Co-authored-by: Viacheslav Poturaev <vearutop@gmail.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * cancel context for each scenario * Update suite.go --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Viacheslav Poturaev <vearutop@gmail.com> Co-authored-by: Viacheslav Poturaev <nanopeni@gmail.com>
Этот коммит содержится в:
родитель
472ea2735d
коммит
0dcbfef9be
2 изменённых файлов: 5 добавлений и 0 удалений
|
@ -14,6 +14,7 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt
|
|||
|
||||
## [v0.12.6]
|
||||
### Changed
|
||||
- Each scenario is run with a cancellable `context.Context` which is cancelled at the end of the scenario. ([514](https://github.com/cucumber/godog/pull/514) - [draganm](https://github.com/draganm))
|
||||
- README example is updated with `context.Context` and `go test` usage. ([477](https://github.com/cucumber/godog/pull/477) - [vearutop](https://github.com/vearutop))
|
||||
- Removed deprecation of `godog.BindFlags`. ([498](https://github.com/cucumber/godog/pull/498) - [vearutop](https://github.com/vearutop))
|
||||
- Pretty Print when using rules. ([480](https://github.com/cucumber/godog/pull/480) - [dumpsterfireproject](https://github.com/dumpsterfireproject))
|
||||
|
|
4
suite.go
4
suite.go
|
@ -447,6 +447,10 @@ func (s *suite) runPickle(pickle *messages.Pickle) (err error) {
|
|||
ctx = context.Background()
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
|
||||
defer cancel()
|
||||
|
||||
if len(pickle.Steps) == 0 {
|
||||
pr := models.PickleResult{PickleID: pickle.Id, StartedAt: utils.TimeNowFunc()}
|
||||
s.storage.MustInsertPickleResult(pr)
|
||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче