From 35ca4e84d3a5beeb01ff5e3d3a09deb951f7737d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20L=C3=B6nnblad?= Date: Fri, 6 Mar 2020 10:33:47 -0300 Subject: [PATCH 1/4] Updated README.md and added release-notes/v0.9.0.md --- README.md | 9 +++++- godog.go | 2 +- release-notes/v0.9.0.md | 65 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 release-notes/v0.9.0.md diff --git a/README.md b/README.md index 0c8c78a..e2e1c48 100644 --- a/README.md +++ b/README.md @@ -61,8 +61,15 @@ When automated testing is this much fun, teams can easily protect themselves from costly regressions. ## Install +``` +go get github.com/cucumber/godog/cmd/godog@v0.9.0 +``` +Adding `@v0.9.0` will install v0.9.0 specifically instead of master. - go get github.com/cucumber/godog/cmd/godog +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.9.0 +``` ## Example diff --git a/godog.go b/godog.go index b2f3abe..fb8ec92 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" diff --git a/release-notes/v0.9.0.md b/release-notes/v0.9.0.md new file mode 100644 index 0000000..59eab4b --- /dev/null +++ b/release-notes/v0.9.0.md @@ -0,0 +1,65 @@ +I am excited to announce the release of godog v0.9.0. + +Here follows a summary of notable changes, and the non backward compatible changes. +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` +- Adding `GO111MODULE=on` will allow go get and go mod to work together as intended. +- Adding `@v0.9.0` will install v0.9.0 specifically instead of master. + +If you are running `outside of the $GOPATH`, you should still specify a version. + + +### 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` + + +Full change log +--------------- + +See [CHANGELOG.md](https://github.com/cucumber/godog/blob/master/CHANGELOG.md). \ No newline at end of file From 7caae4e11ad1ad39d4af9ab7d002eb2ddf375b21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20L=C3=B6nnblad?= Date: Fri, 6 Mar 2020 14:03:16 -0300 Subject: [PATCH 2/4] Added the encountered error to the release-notes as well --- release-notes/v0.9.0.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/release-notes/v0.9.0.md b/release-notes/v0.9.0.md index 59eab4b..703e9d4 100644 --- a/release-notes/v0.9.0.md +++ b/release-notes/v0.9.0.md @@ -24,6 +24,17 @@ If you are running `within the $GOPATH`, you would need to install godog like th 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). From bc57207416f7780fd852bf7bd08ed6dd8191ddd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20L=C3=B6nnblad?= Date: Mon, 9 Mar 2020 13:53:16 -0300 Subject: [PATCH 3/4] Added deprecation notice for the feature hooks --- go.mod | 6 ++++-- go.sum | 15 +++++++++++---- release-notes/v0.9.0.md | 14 +++++++++++--- suite.go | 7 +++++++ 4 files changed, 33 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 2924270..6e6c6b8 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,9 @@ module github.com/cucumber/godog go 1.13 require ( - github.com/DATA-DOG/go-txdb v0.1.3 - github.com/go-sql-driver/mysql v1.5.0 + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/kr/pretty v0.2.0 // indirect github.com/stretchr/testify v1.4.0 + gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect + gopkg.in/yaml.v2 v2.2.7 // indirect ) diff --git a/go.sum b/go.sum index 77d1d3f..d1a97ff 100644 --- a/go.sum +++ b/go.sum @@ -1,9 +1,12 @@ -github.com/DATA-DOG/go-txdb v0.1.3 h1:R4v6OuOcy2O147e2zHxU0B4NDtF+INb5R9q/CV7AEMg= -github.com/DATA-DOG/go-txdb v0.1.3/go.mod h1:DhAhxMXZpUJVGnT+p9IbzJoRKvlArO2pkHjnGX7o0n0= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= -github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -11,5 +14,9 @@ github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJy github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo= +gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/release-notes/v0.9.0.md b/release-notes/v0.9.0.md index 703e9d4..8ee78c3 100644 --- a/release-notes/v0.9.0.md +++ b/release-notes/v0.9.0.md @@ -1,17 +1,17 @@ I am excited to announce the release of godog v0.9.0. -Here follows a summary of notable changes, and the non backward compatible changes. +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 +Non Backward Compatible Changes ------------------------------- ### Install godog @@ -70,6 +70,14 @@ The formatter interface have recieved some updates, the updated version can be f - `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 --------------- diff --git a/suite.go b/suite.go index 5b9a2c9..5f9674e 100644 --- a/suite.go +++ b/suite.go @@ -200,6 +200,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(*gherkin.Feature)) { s.beforeFeatureHandlers = append(s.beforeFeatureHandlers, fn) } @@ -247,6 +250,10 @@ func (s *Suite) AfterScenario(fn func(interface{}, 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(*gherkin.Feature)) { s.afterFeatureHandlers = append(s.afterFeatureHandlers, fn) } From e0ed649cd9bdae17a0233ed9ce8ee320d9a5f87a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20L=C3=B6nnblad?= Date: Mon, 9 Mar 2020 14:43:31 -0300 Subject: [PATCH 4/4] Updated version from v0.9.0 to v0.9.0-rc1 --- README.md | 6 +++--- godog.go | 2 +- release-notes/v0.9.0.md | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 1baf8b1..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.9.0 +go get github.com/cucumber/godog/cmd/godog@v0.9.0-rc1 ``` -Adding `@v0.9.0` will install v0.9.0 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.9.0 +GO111MODULE=on go get github.com/cucumber/godog/cmd/godog@v0.9.0-rc1 ``` ## Example diff --git a/godog.go b/godog.go index fb8ec92..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.9.0" +const Version = "v0.9.0-rc1" diff --git a/release-notes/v0.9.0.md b/release-notes/v0.9.0.md index 8ee78c3..12cf71e 100644 --- a/release-notes/v0.9.0.md +++ b/release-notes/v0.9.0.md @@ -1,4 +1,4 @@ -I am excited to announce the release of godog v0.9.0. +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). @@ -18,9 +18,9 @@ Non Backward Compatible Changes 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` +`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` will install v0.9.0 specifically instead of master. +- 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.