Releases: cucumber/godog
v0.14.1
What's Changed
- Prepare CHANGELOG.md for new release by @glibas in #606
- fix(deps): update module github.com/cucumber/godog to v0.14.0 by @renovate in #610
- Create releasing guidelines by @glibas in #608
- chore(deps): update dominikh/staticcheck-action action to v1.3.1 by @renovate in #614
- Fix step duration calculation by @iaroslav-ciupin in #616
- chore(deps): update codecov/codecov-action action to v4 by @renovate in #607
- chore(deps): update actions/cache action to v4 by @renovate in #598
- fix invalid memory address or nil pointer dereference in RetrieveFeatures by @corneldamian in #566
- Provide a useful implementation of something compatible with testing.T by @mrsheepuk in #571
New Contributors
- @iaroslav-ciupin made their first contribution in #616
- @corneldamian made their first contribution in #566
- @mrsheepuk made their first contribution in #571
Full Changelog: v0.14.0...v0.14.1
v0.14.0
What's Changed
- fix(deps): update module github.com/cucumber/godog to v0.13.0 by @renovate in #574
- chore(deps): update actions/checkout action to v4 by @renovate in #575
- chore(deps): update codecov/codecov-action action to v4 by @renovate in #576
- Update test.yml by @vearutop in #583
- updated base formatter to set a scenario as passed unless there exist… by @roskee in #582
- Improve ErrSkip handling, add test for Summary and operations order by @vearutop in #584
- chore(deps): update actions/setup-go action to v5 by @renovate in #588
- Remove duplicate warning message by @vearutop in #590
- Fixes #604 - remove line overwriting for scenario outlines in cucumber formatter by @glibas in #605
New Contributors
Full Changelog: v0.13.0...v0.14.0
What's Changed
- fix(deps): update module github.com/cucumber/godog to v0.13.0 by @renovate in #574
- chore(deps): update actions/checkout action to v4 by @renovate in #575
- chore(deps): update codecov/codecov-action action to v4 by @renovate in #576
- Update test.yml by @vearutop in #583
- updated base formatter to set a scenario as passed unless there exist… by @roskee in #582
- Improve ErrSkip handling, add test for Summary and operations order by @vearutop in #584
- chore(deps): update actions/setup-go action to v5 by @renovate in #588
- Remove duplicate warning message by @vearutop in #590
- Fixes #604 - remove line overwriting for scenario outlines in cucumber formatter by @glibas in #605
New Contributors
Full Changelog: v0.13.0...v0.14.0
v0.13.0
What's Changed
- chore(*): BREAKING CHANGE, use new repos for cucumber and messages by @otrava7 in #515
- Configure Renovate by @renovate in #512
- fix(deps): update module github.com/cucumber/godog to v0.12.6 by @renovate in #520
- chore(deps): update codecov/codecov-action action to v3 by @renovate in #530
- chore(deps): update actions/checkout action to v3 by @renovate in #528
- chore(deps): update actions/setup-go action to v3 by @renovate in #529
- chore(deps): update actions/cache action to v3 by @renovate in #527
- fix(deps): update module github.com/cucumber/gherkin/go/v26 to v26.0.3 by @renovate in #519
- fix(deps): update module github.com/data-dog/go-txdb to v0.1.5 by @renovate in #522
- fix(deps): update module github.com/go-sql-driver/mysql to v1.7.0 by @renovate in #524
- fix(deps): update module github.com/hashicorp/go-memdb to v1.3.4 by @renovate in #523
- fix(deps): update module github.com/spf13/cobra to v1.6.1 by @renovate in #526
- fix(deps): update module github.com/smartystreets/goconvey to v1.7.2 by @renovate in #525
- Setup Renovate with default Configs by @mpkorstanje in #531
- Implement unambiguous keywords by @otrava7 in #509
- docs(*): correct example by @otrava7 in #538
- fix(deps): update module github.com/data-dog/go-txdb to v0.1.6 by @renovate in #540
- fix(deps): update module github.com/stretchr/testify to v1.8.2 by @renovate in #541
- chore(deps): update actions/setup-go action to v4 by @renovate in #546
- docs: prefer go test to use of godog cli in README by @danielhelfand in #548
- Use
fs.FS
abstraction for filesystem by @tigh-latte in #550 - Result of testing.T respect strict option by @eiel in #539
- Update CI for go1.20 by @vearutop in #552
- fix(deps): update module github.com/cucumber/gherkin/go/v26 to v26.1.0 by @renovate in #549
- cancel context for each scenario by @draganm in #514
- Use staticcheck GitHub Action by @vearutop in #563
- refactor: test_context.go by @longyue0521 in #564
- Improve hooks invocation flow by @vearutop in #568
- fix(examples): update api example by @forward32 in #532
- Improve example with concurrency support by @vearutop in #573
New Contributors
- @otrava7 made their first contribution in #515
- @renovate made their first contribution in #512
- @mpkorstanje made their first contribution in #531
- @danielhelfand made their first contribution in #548
- @tigh-latte made their first contribution in #550
- @eiel made their first contribution in #539
- @draganm made their first contribution in #514
- @longyue0521 made their first contribution in #564
- @forward32 made their first contribution in #532
Full Changelog: v0.12.6...v0.13.0
v0.12.6
What's Changed
- Replace #StandWithUkraine banner with badge by @mattwynne in #470
- Add a check for missing test files and raise a more helpful error by @ALCooper12 in #468
- Update go version in go.mod (go1.16). Update dependencies by @mdeolmosmeli in #471
- Reformat CHANGELOG.md using standard
changelog
CLI tool by @mattwynne in #474 - Fix version subcommand. Do not print usage if run subcommand fails. by @coopernurse in #475
- Update README to reflect current best practices in creating and running tests by @vearutop in #477
- Pretty Print when using rules (#440) by @dumpsterfireproject in #480
- Update CHANGELOG.md by @dumpsterfireproject in #482
- Fix green copypasta by @pktpls in #484
- Do not discard context from substeps by @wichert in #488
- add new option for created features with parsing from byte slices by @akaswenwilk in #476
- Add deprecation notice to godog CLI by @vearutop in #489
- Add gorelease GitHub Action task by @vearutop in #493
- Skip undefined steps in after scenario hooks by @vearutop in #494
- Remove deprecation from flags, update example to use CLI flags by @vearutop in #498
- Update CHANGELOG.md for release v0.12.6 by @vearutop in #516
New Contributors
- @ALCooper12 made their first contribution in #468
- @mdeolmosmeli made their first contribution in #471
- @coopernurse made their first contribution in #475
- @dumpsterfireproject made their first contribution in #480
- @pktpls made their first contribution in #484
- @wichert made their first contribution in #488
- @akaswenwilk made their first contribution in #476
Full Changelog: v0.12.5...v0.12.6
v0.12.5
v0.12.4
v0.12.3
Added
- Automated binary releases with GitHub Actions (437 - vearutop)
- Automated binary versioning with
go install
(437 - vearutop) - Module with local replace in examples (437 - vearutop)
Changed
- Suggest to use
go install
instead of the deprecatedgo get
to install thegodog
binary (449 - dmitris)
Fixed
v0.12.2
v0.12.1
v0.12.0
We are excited to announce the release of godog v0.12.0.
Here follows a summary of Notable Changes, the Non Backward Compatible Changes and Deprecation Notices. The full change
log is available here.
Notable Changes
Output with multiple formatters
Now godog
is able to use multiple formatters simultaneously with comma-separated formatters.
--format pretty,junit:report.xml,cucumber:report.json
will write pretty
format to stdout, junit
to report.xml
and cucumber
to report.json.
Extensible formatters
Standard formatters are now exported with type aliases so that a custom formatter can be built on top of it.
Please check an example.
Contextualized hooks
Scenario and Step hooks are now passing context to allow custom state communication. Returned context should generally
be based or equal to received context. Context is also passed to steps that have it in declaration and is read from
steps that return it.
Hooks can now return error, if non nil error is returned test is failed. This enables additional flow control, for
example to check expectations after the scenario.
Scenario hooks are now named Before
and After
.
// BeforeScenarioHook defines a hook before scenario.
type BeforeScenarioHook func (ctx context.Context, sc *Scenario) (context.Context, error)
// AfterScenarioHook defines a hook after scenario.
type AfterScenarioHook func (ctx context.Context, sc *Scenario, err error) (context.Context, error)
Step hooks are now also named Before
and After
, but they are available with ScenarioContext.StepContext()
.
// BeforeStepHook defines a hook before step.
type BeforeStepHook func (ctx context.Context, st *Step) (context.Context, error)
// AfterStepHook defines a hook after step.
type AfterStepHook func (ctx context.Context, st *Step, status StepResultStatus, err error) (context.Context, error)
Step definition improvements
Now godog
can use additional ways to declare step definition. These declarations are optional and do not break
backwards compatibility.
Error result may be omitted if the step does not fail.
func iEat(arg1 int) {
// Eat arg1.
}
You can have context.Context
as first argument, test runner will pass current context to the step.
func iEat(ctx context.Context, arg1 int) {
if v, ok := ctx.Value(eatKey{}).int; ok {
// Eat v from context.
}
// Eat arg1.
}
You can have context.Context
in return, test runner will use returned context to pass to next hooks and steps.
func iEat(ctx context.Context, arg1 int) context.Context {
if v, ok := ctx.Value(eatKey{}).int; ok {
// Eat v from context.
}
// Eat arg1.
return context.WithValue(ctx, eatKey{}, 0)
}
If error is also needed in return, context have to be first.
func iEat(ctx context.Context, arg1 int) (context.Context, error) {
if v, ok := ctx.Value(eatKey{}).int; ok {
// Eat v from context.
}
// Eat arg1.
if arg1 == 0 {
return errors.New("can't eat nothing")
}
return context.WithValue(ctx, eatKey{}, 0), nil
}
You can now use string
instead of *godog.DocString
in declaration.
Getting features of test suite
godog.TestSuite
now can RetrieveFeatures() ([]*models.Feature, error)
to expose parsed features to the user.
Added official support for go1.16 and go1.17
With the introduction of go1.17, go1.17 and go1.16 are now officially supported.
Running scenarios as subtests of *testing.T
You can now assign an instance of *testing.T
to godog.Options.TestingT
so that scenarios will be invoked with
t.Run
allowing granular control with standard Go tools.
Non Backward Compatible Changes
Messages library updated
Messages library is changed from github.com/cucumber/messages-go/v10
to github.com/cucumber/messages-go/v16
.
Deprecation Notices
Hooks
Scenario and step hooks were upgraded with new API to support context and errors, previous methods are now deprecated.
ScenarioContext.BeforeScenario
, useScenarioContext.Before
ScenarioContext.AfterScenario
, useScenarioContext.After
ScenarioContext.BeforeStep
, useScenarioContext.StepContext().Before
ScenarioContext.AfterStep
, useScenarioContext.StepContext().After
Full change log
See CHANGELOG.md.