diff --git a/README.md b/README.md index ca5ea1d..969bf02 100644 --- a/README.md +++ b/README.md @@ -62,13 +62,13 @@ themselves from costly regressions. ## Install ``` -go get github.com/cucumber/godog/cmd/godog@v0.8.1 +go get github.com/cucumber/godog/cmd/godog@v0.9.0-rc1 ``` -Adding `@v0.8.1` will install v0.8.1 specifically instead of master. +Adding `@v0.9.0-rc1` will install v0.9.0-rc1 specifically instead of master. Running `within the $GOPATH`, you would also need to set `GO111MODULE=on`, like this: ``` -GO111MODULE=on go get github.com/cucumber/godog/cmd/godog@v0.8.1 +GO111MODULE=on go get github.com/cucumber/godog/cmd/godog@v0.9.0-rc1 ``` ## Example diff --git a/godog.go b/godog.go index b2f3abe..523cc33 100644 --- a/godog.go +++ b/godog.go @@ -39,4 +39,4 @@ Godog was inspired by Behat and Cucumber the above description is taken from it' package godog // Version of package - based on Semantic Versioning 2.0.0 http://semver.org/ -const Version = "v0.8.1" +const Version = "v0.9.0-rc1" diff --git a/release-notes/v0.9.0.md b/release-notes/v0.9.0.md new file mode 100644 index 0000000..12cf71e --- /dev/null +++ b/release-notes/v0.9.0.md @@ -0,0 +1,84 @@ +I am excited to announce the release of godog v0.9.0-rc1. + +Here follows a summary of Notable Changes, the Non Backward Compatible Changes and Deprecation Notices. +The full change log is available [here](https://github.com/cucumber/godog/blob/master/CHANGELOG.md). + + +Notable Changes +--------------- + +Most importantly, note that the gherkin core is changed to [gherkin-go](https://github.com/cucumber/gherkin-go/releases/tag/v9.2.0). + + + +Non Backward Compatible Changes +------------------------------- + +### Install godog +With the change of dependencies for godog, which relies on `go modules`, installing godog now requires go modules to be active. + +If you are running `within the $GOPATH`, you would need to install godog like this: +`GO111MODULE=on go get github.com/cucumber/godog/cmd/godog@v0.9.0-rc1` +- Adding `GO111MODULE=on` will allow go get and go mod to work together as intended. +- Adding `@v0.9.0-rc1` will install v0.9.0-rc1 specifically instead of master. + +If you are running `outside of the $GOPATH`, you should still specify a version. + +I you encounter this error, please try adding `GO111MODULE=on`: +``` +/go# go get github.com/cucumber/godog/cmd/godog +package github.com/cucumber/gherkin-go/v9: cannot find package "github.com/cucumber/gherkin-go/v9" in any of: + /usr/local/go/src/github.com/cucumber/gherkin-go/v9 (from $GOROOT) + /go/src/github.com/cucumber/gherkin-go/v9 (from $GOPATH) +package github.com/cucumber/messages-go/v9: cannot find package "github.com/cucumber/messages-go/v9" in any of: + /usr/local/go/src/github.com/cucumber/messages-go/v9 (from $GOROOT) + /go/src/github.com/cucumber/messages-go/v9 (from $GOPATH) +``` + + +### Gherkin Core +The following types have been switched for [messages-go](https://github.com/cucumber/messages-go). + +| old | new | +| ----------------------- | ------------------------------------------- | +| gherkin.Feature | messages.GherkinDocument | +| gherkin.Scenario | messages.Pickle | +| gherkin.ScenarioOutline | messages.Pickle | +| gherkin.Step | messages.Pickle_PickleStep | +| gherkin.DocString | messages.PickleStepArgument_PickleDocString | +| gherkin.DataTable | messages.PickleStepArgument_PickleTable | + + +### Step Defintions +- `StepDef` has been renamed to `StepDefinition` +- Steps that earlier accepted `*gherkin.DocString` or `*gherkin.DataTable` needs to be updated to use `*messages.PickleStepArgument_PickleDocString` resp. `*messages.PickleStepArgument_PickleTable`. +[Example](https://github.com/cucumber/godog/pull/240/files#diff-a5f59d298843b731ff8d2f9c670303ff). + + +### Hooks +The updated hooks can be found [here](https://github.com/cucumber/godog/blob/b62eb13ee70c9f0f732b694b39bde9670051bac7/suite.go#L251). +- `BeforeFeature` and `AfterFeature` hooks now accept `*messages.GherkinDocument` instead of `*gherkin.Feature` +- `BeforeScenario` and `AfterScenario` hooks now accept `*messages.Pickle` instead of `interface{}` +- `BeforeStep` and `AfterStep` hooks now accept `*messages.Pickle_PickleStep` instead `*gherkin.Step` + + +### Formatter +The formatter interface have recieved some updates, the updated version can be found [here](https://github.com/cucumber/godog/blob/b62eb13ee70c9f0f732b694b39bde9670051bac7/fmt.go#L100). + +- `Feature` now accepts `*messages.GherkinDocument` instead of `*gherkin.Feature` +- `Node` has been renamed to `Pickle` and now accepts `*messages.Pickle` instead of `interface{}` +- `Defined`, `Failed`, `Passed`, `Skipped`, `Undefined`, `Pending` now takes `*messages.Pickle` as the first argument and `*gherkin.Step, *StepDef` have been updated to `*messages.Pickle_PickleStep, *StepDefinition` + + + +Deprecation Notices +------------------- + +### Hooks +- `BeforeFeature` and `AfterFeature` hooks are now considered deprecated and will be removed in `v0.10.0`. + + +Full change log +--------------- + +See [CHANGELOG.md](https://github.com/cucumber/godog/blob/master/CHANGELOG.md). \ No newline at end of file diff --git a/suite.go b/suite.go index 07848bb..571a687 100644 --- a/suite.go +++ b/suite.go @@ -271,6 +271,9 @@ func (s *Suite) BeforeSuite(fn func()) { // scenario to restart it. // // Use it wisely and avoid sharing state between scenarios. +// +// Deprecated: BeforeFeature will be removed. Depending on +// your usecase, do setup in BeforeSuite or BeforeScenario. func (s *Suite) BeforeFeature(fn func(*messages.GherkinDocument)) { s.beforeFeatureHandlers = append(s.beforeFeatureHandlers, fn) } @@ -312,6 +315,10 @@ func (s *Suite) AfterScenario(fn func(*messages.Pickle, error)) { // AfterFeature registers a function or method // to be run once after feature executed all scenarios. +// +// Deprecated: AfterFeature will be removed. Depending on +// your usecase, do cleanup and teardowns in AfterScenario +// or AfterSuite. func (s *Suite) AfterFeature(fn func(*messages.GherkinDocument)) { s.afterFeatureHandlers = append(s.afterFeatureHandlers, fn) }