Этот коммит содержится в:
Fredrik Lönnblad 2020-02-29 17:50:44 -03:00
родитель 0d205bc43e
коммит 310ce24fb0
2 изменённых файлов: 14 добавлений и 30 удалений

Просмотреть файл

@ -15,15 +15,10 @@ executors:
- image: circleci/golang:1.14.0
commands:
install:
description: "Install dependencies"
steps:
- run: GO111MODULE=on go mod vendor -v
vet:
description: "Run go vet"
steps:
- run: go vet github.com/cucumber/godog
- run: go vet github.com/cucumber/godog/colors
- run: go vet ./...
fmt:
description: "Run go fmt"
steps:
@ -32,13 +27,7 @@ commands:
description: "Run golint"
steps:
- run: go get -u golang.org/x/lint/golint
- run: golint ./godog
- run: golint ./cmd/godog/main.go
godog:
description: "Run godog"
steps:
- run: go install ./cmd/godog
- run: godog -f progress
- run: golint ./...
go_test:
description: "Run go test"
steps:
@ -48,31 +37,35 @@ commands:
steps:
- codecov/upload:
file: "coverage.txt"
godog:
description: "Run godog"
steps:
- run: go install ./cmd/godog
- run: godog -f progress
all:
description: "Run all commands against godog code"
steps:
- checkout
- install
- vet
- fmt
- lint
- godog
- go_test
- coverage
- godog
jobs:
go1_12:
working_directory: /go/src/github.com/cucumber/godog
working_directory: godog
executor: exec_go_1_12
steps:
- all
go1_13:
working_directory: /go/src/github.com/cucumber/godog
working_directory: godog
executor: exec_go_1_13
steps:
- all
go1_14:
working_directory: /go/src/github.com/cucumber/godog
working_directory: godog
executor: exec_go_1_14
steps:
- all

Просмотреть файл

@ -28,7 +28,6 @@ import (
"fmt"
"github.com/cucumber/godog"
"github.com/cucumber/messages-go/v9"
)
func thereAreGodogs(available int) error {
@ -56,7 +55,7 @@ func FeatureContext(s *godog.Suite) {
s.Step("^I eat (\\d+)$", iEat)
s.Step("^there should be (\\d+) remaining$", thereShouldBeRemaining)
s.BeforeScenario(func(*messages.Pickle) {
s.BeforeScenario(func(interface{}) {
Godogs = 0 // clean the state before every scenario
})
}
@ -68,8 +67,6 @@ import (
"fmt"
"github.com/cucumber/godog"
"github.com/cucumber/messages-go/v9"
"godogs"
)
@ -98,7 +95,7 @@ func FeatureContext(s *godog.Suite) {
s.Step("^I eat (\\d+)$", iEat)
s.Step("^there should be (\\d+) remaining$", thereShouldBeRemaining)
s.BeforeScenario(func(*messages.Pickle) {
s.BeforeScenario(func(interface{}) {
godogs.Godogs = 0 // clean the state before every scenario
})
}
@ -328,18 +325,12 @@ func TestGodogBuildWithVendoredGodogAndMod(t *testing.T) {
}
defer os.RemoveAll(gopath)
pkg := filepath.Join(dir, "vendor", "github.com", "cucumber")
if err := os.MkdirAll(pkg, 0755); err != nil {
t.Fatal(err)
}
prevDir, err := os.Getwd()
if err != nil {
t.Fatal(err)
}
// symlink godog package
if err := os.Symlink(prevDir, filepath.Join(pkg, "godog")); err != nil {
if err = exec.Command("go", "mod", "vendor").Run(); err != nil {
t.Fatal(err)
}