Merge pull request #313 from cucumber/v0.10.0-rc1
Wrote Release Notes and updated CHANGELOG, README, etc. for v0.10.0-rc1
Этот коммит содержится в:
коммит
cff1e2f197
5 изменённых файлов: 144 добавлений и 17 удалений
12
CHANGELOG.md
12
CHANGELOG.md
|
@ -10,6 +10,18 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
|
||||
### Changed
|
||||
|
||||
### Deprecated
|
||||
|
||||
### Removed
|
||||
|
||||
### Fixed
|
||||
|
||||
## [v0.10.0-rc1]
|
||||
|
||||
### Added
|
||||
- Added concurrency support to the pretty formatter ([275](https://github.com/cucumber/godog/pull/275) - [lonnblad])
|
||||
- Added concurrency support to the events formatter ([274](https://github.com/cucumber/godog/pull/274) - [lonnblad])
|
||||
|
|
30
README.md
30
README.md
|
@ -8,7 +8,7 @@
|
|||
|
||||
**The API is likely to change a few times before we reach 1.0.0**
|
||||
|
||||
Please read all the README, you may find it very useful. And do not forget to peek into the [CHANGELOG](https://github.com/cucumber/godog/blob/master/CHANGELOG.md) from time to time.
|
||||
Please read the full README, you may find it very useful. And do not forget to peek into the [Release Notes](https://github.com/cucumber/godog/blob/master/release-notes) and the [CHANGELOG](https://github.com/cucumber/godog/blob/master/CHANGELOG.md) from time to time.
|
||||
|
||||
Package godog is the official Cucumber BDD framework for Golang, it merges specification and test documentation into one cohesive whole, using Gherkin formatted scenarios in the format of Given, When, Then.
|
||||
|
||||
|
@ -43,13 +43,13 @@ When automated testing is this much fun, teams can easily protect themselves fro
|
|||
|
||||
## Install
|
||||
```
|
||||
go get github.com/cucumber/godog/cmd/godog@v0.9.0
|
||||
go get github.com/cucumber/godog/cmd/godog@v0.10.0-rc1
|
||||
```
|
||||
Adding `@v0.9.0` will install v0.9.0 specifically instead of master.
|
||||
Adding `@v0.10.0-rc1` will install v0.10.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.10.0-rc1
|
||||
```
|
||||
|
||||
## Contributions
|
||||
|
@ -140,7 +140,7 @@ package main
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
messages "github.com/cucumber/messages-go/v10" // needed for godog v0.9.0 (latest) and earlier
|
||||
messages "github.com/cucumber/messages-go/v10" // needed for godog v0.9.0 and earlier
|
||||
|
||||
"github.com/cucumber/godog"
|
||||
)
|
||||
|
@ -165,7 +165,7 @@ func thereShouldBeRemaining(remaining int) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// godog v0.9.0 (latest) and earlier
|
||||
// godog v0.9.0 and earlier
|
||||
func FeatureContext(s *godog.Suite) {
|
||||
s.BeforeSuite(func() { Godogs = 0 })
|
||||
|
||||
|
@ -178,7 +178,7 @@ func FeatureContext(s *godog.Suite) {
|
|||
s.Step(`^there should be (\d+) remaining$`, thereShouldBeRemaining)
|
||||
}
|
||||
|
||||
// godog v0.10.0 (coming release)
|
||||
// godog v0.10.0-rc1 (latest)
|
||||
func InitializeTestSuite(ctx *godog.TestSuiteContext) {
|
||||
ctx.BeforeSuite(func() { Godogs = 0 })
|
||||
}
|
||||
|
@ -247,12 +247,12 @@ func TestMain(m *testing.M) {
|
|||
flag.Parse()
|
||||
opts.Paths = flag.Args()
|
||||
|
||||
// godog v0.9.0 (latest) and earlier
|
||||
// godog v0.9.0 and earlier
|
||||
status := godog.RunWithOptions("godogs", func(s *godog.Suite) {
|
||||
FeatureContext(s)
|
||||
}, opts)
|
||||
|
||||
// godog v0.10.0 (coming release)
|
||||
// godog v0.10.0-rc1 (latest)
|
||||
status := godog.TestSuite{
|
||||
Name: "godogs",
|
||||
TestSuiteInitializer: InitializeTestSuite,
|
||||
|
@ -284,12 +284,12 @@ func TestMain(m *testing.M) {
|
|||
Randomize: time.Now().UTC().UnixNano(), // randomize scenario execution order
|
||||
}
|
||||
|
||||
// godog v0.9.0 (latest) and earlier
|
||||
// godog v0.9.0 and earlier
|
||||
status := godog.RunWithOptions("godogs", func(s *godog.Suite) {
|
||||
FeatureContext(s)
|
||||
}, opts)
|
||||
|
||||
// godog v0.10.0 (coming release)
|
||||
// godog v0.10.0-rc1 (latest)
|
||||
status := godog.TestSuite{
|
||||
Name: "godogs",
|
||||
TestSuiteInitializer: InitializeTestSuite,
|
||||
|
@ -321,12 +321,12 @@ func TestMain(m *testing.M) {
|
|||
Paths: []string{"features"},
|
||||
}
|
||||
|
||||
// godog v0.9.0 (latest) and earlier
|
||||
// godog v0.9.0 and earlier
|
||||
status := godog.RunWithOptions("godogs", func(s *godog.Suite) {
|
||||
FeatureContext(s)
|
||||
}, opts)
|
||||
|
||||
// godog v0.10.0 (coming release)
|
||||
// godog v0.10.0-rc1 (latest)
|
||||
status := godog.TestSuite{
|
||||
Name: "godogs",
|
||||
TestSuiteInitializer: InitializeTestSuite,
|
||||
|
@ -398,12 +398,12 @@ There are no global options or configuration files. Alias your common or project
|
|||
|
||||
### Concurrency
|
||||
|
||||
When concurrency is configured in options, godog will execute the scenarios concurrently, which is support by all supplied formatters.
|
||||
|
||||
In order to support concurrency well, you should reset the state and isolate each scenario. They should not share any state. It is suggested to run the suite concurrently in order to make sure there is no state corruption or race conditions in the application.
|
||||
|
||||
It is also useful to randomize the order of scenario execution, which you can now do with **--random** command option.
|
||||
|
||||
**NOTE:** if suite runs with concurrency option, it concurrently runs every feature, not scenario per different features. This will be updated in release v0.10.0 to run every scenario concurrently.
|
||||
|
||||
## License
|
||||
**Godog** and **Gherkin** are licensed under the [MIT][license] and developed as a part of the [cucumber project][cucumber]
|
||||
|
||||
|
|
|
@ -20,6 +20,6 @@ Feature: get version
|
|||
And the response should match json:
|
||||
"""
|
||||
{
|
||||
"version": "v0.9.0"
|
||||
"version": "v0.10.0-rc1"
|
||||
}
|
||||
"""
|
||||
|
|
2
godog.go
2
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.10.0-rc1"
|
||||
|
|
115
release-notes/v0.10.0.md
Обычный файл
115
release-notes/v0.10.0.md
Обычный файл
|
@ -0,0 +1,115 @@
|
|||
I am excited to announce the release of godog v0.10.0.
|
||||
|
||||
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
|
||||
---------------
|
||||
|
||||
### Context Initializers
|
||||
The current Suite initializer will be removed and replaced by two new initializers, one for the Test Suite and one for the Scenarios.
|
||||
|
||||
The **TestSuiteContext** Initializer will be executed once for the execution of the full TestSuite.
|
||||
```go
|
||||
// These are the hooks that can be configured for the TestSuite.
|
||||
func (ctx *TestSuiteContext) BeforeSuite(fn func())
|
||||
func (ctx *TestSuiteContext) AfterSuite(fn func())
|
||||
```
|
||||
|
||||
The **ScenarioContext** Initializer will be executed before every Scenario.
|
||||
```go
|
||||
// These are the hooks that can be configured for a Scenario.
|
||||
func (ctx *ScenarioContext) BeforeScenario(fn func(sc *Scenario))
|
||||
func (ctx *ScenarioContext) AfterScenario(fn func(sc *Scenario, err error))
|
||||
func (ctx *ScenarioContext) BeforeStep(fn func(st *Step))
|
||||
func (ctx *ScenarioContext) AfterStep(fn func(st *Step, err error))
|
||||
|
||||
// Registers a step definition for a Scenario.
|
||||
func (ctx *ScenarioContext) Step(expr, stepFunc interface{})
|
||||
```
|
||||
|
||||
### Formatter Concurrency
|
||||
All builtin formatters now support concurrency.
|
||||
|
||||
### Scenario Concurrency
|
||||
Using the new Initializers, godog will now execute scenarios concurrently instead of features.
|
||||
|
||||
|
||||
Non Backward Compatible Changes
|
||||
-------------------------------
|
||||
|
||||
### Hooks
|
||||
`BeforeFeature` and `AfterFeature` hooks are now removed since the deprecation in `v0.9.0`.
|
||||
|
||||
|
||||
Deprecation Notices
|
||||
-------------------
|
||||
|
||||
### Run and RunWithOptions
|
||||
`Run` and `RunWithOptions` are now considered deprecated and will be removed in `v0.11.0`.
|
||||
|
||||
`godog.Run(suiteName string, initializer func(*Suite))` will be replaced by:
|
||||
```go
|
||||
godog.TestSuite{
|
||||
Name: suiteName,
|
||||
TestSuiteInitializer: testSuiteInitializer,
|
||||
ScenarioInitializer: scenarioInitializer,
|
||||
}.Run()
|
||||
```
|
||||
|
||||
`godog.RunWithOptions(suiteName string, initializer func(*Suite), opts Options)` will be replaced by:
|
||||
```go
|
||||
godog.TestSuite{
|
||||
Name: suiteName,
|
||||
TestSuiteInitializer: testSuiteInitializer,
|
||||
ScenarioInitializer: scenarioInitializer,
|
||||
Options: &opts,
|
||||
}.Run()
|
||||
```
|
||||
|
||||
### Suite Initializers
|
||||
The `Suite` is now considered deprecated and will be removed in `v0.11.0`.
|
||||
|
||||
Initializers that use `*godog.Suite` like this:
|
||||
```go
|
||||
func FeatureContext(s *godog.Suite) {
|
||||
s.BeforeSuite(func() { Godogs = 0 })
|
||||
|
||||
s.BeforeScenario(func(*messages.Pickle) {
|
||||
Godogs = 0 // clean the state before every scenario
|
||||
})
|
||||
|
||||
s.Step(`^there are (\d+) godogs$`, thereAreGodogs)
|
||||
s.Step(`^I eat (\d+)$`, iEat)
|
||||
s.Step(`^there should be (\d+) remaining$`, thereShouldBeRemaining)
|
||||
}
|
||||
```
|
||||
|
||||
will be replaced by:
|
||||
```go
|
||||
func InitializeTestSuite(ctx *godog.TestSuiteContext) {
|
||||
ctx.BeforeSuite(func() { Godogs = 0 })
|
||||
}
|
||||
|
||||
func InitializeScenario(ctx *godog.ScenarioContext) {
|
||||
ctx.BeforeScenario(func(*godog.Scenario) {
|
||||
Godogs = 0 // clean the state before every scenario
|
||||
})
|
||||
|
||||
ctx.Step(`^there are (\d+) godogs$`, thereAreGodogs)
|
||||
ctx.Step(`^I eat (\d+)$`, iEat)
|
||||
ctx.Step(`^there should be (\d+) remaining$`, thereShouldBeRemaining)
|
||||
}
|
||||
```
|
||||
|
||||
### SuiteContext
|
||||
The `SuiteContext` is now considered deprecated and will be removed in `v0.11.0`.
|
||||
|
||||
### Concurrency Formatter
|
||||
The `ConcurrencyFormatter` interface is now considered deprecated and will be removed in `v0.11.0`.
|
||||
|
||||
Full change log
|
||||
---------------
|
||||
|
||||
See [CHANGELOG.md](https://github.com/cucumber/godog/blob/master/CHANGELOG.md).
|
Загрузка…
Создание таблицы
Сослаться в новой задаче