Added an extra fixture for cucumber output when go1.11
Этот коммит содержится в:
родитель
824c4310b7
коммит
321e28ab50
4 изменённых файлов: 4610 добавлений и 8 удалений
4592
fixtures/cucumber_output_go111.json
Обычный файл
4592
fixtures/cucumber_output_go111.json
Обычный файл
Различия файлов не показаны, т.к. их слишком много
Показать различия
7
fixtures/fixtures.go
Обычный файл
7
fixtures/fixtures.go
Обычный файл
|
@ -0,0 +1,7 @@
|
||||||
|
// +build go1.12
|
||||||
|
|
||||||
|
package fixtures
|
||||||
|
|
||||||
|
const OutputFilenameProgress = "fixtures/progress_output.txt"
|
||||||
|
const OutputFilenameJUnit = "fixtures/junit_output.xml"
|
||||||
|
const OutputFilenameCucumber = "fixtures/cucumber_output.json"
|
7
fixtures/fixtures_go111.go
Обычный файл
7
fixtures/fixtures_go111.go
Обычный файл
|
@ -0,0 +1,7 @@
|
||||||
|
// +build !go1.12
|
||||||
|
|
||||||
|
package fixtures
|
||||||
|
|
||||||
|
const OutputFilenameProgress = "fixtures/progress_output.txt"
|
||||||
|
const OutputFilenameJUnit = "fixtures/junit_output.xml"
|
||||||
|
const OutputFilenameCucumber = "fixtures/cucumber_output_go111.json"
|
12
run_test.go
12
run_test.go
|
@ -6,11 +6,11 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"runtime"
|
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/cucumber/godog/colors"
|
"github.com/cucumber/godog/colors"
|
||||||
|
"github.com/cucumber/godog/fixtures"
|
||||||
"github.com/cucumber/godog/gherkin"
|
"github.com/cucumber/godog/gherkin"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -285,9 +285,9 @@ type succeedRunTestCase struct {
|
||||||
|
|
||||||
func TestSucceedRun(t *testing.T) {
|
func TestSucceedRun(t *testing.T) {
|
||||||
testCases := []succeedRunTestCase{
|
testCases := []succeedRunTestCase{
|
||||||
{format: "progress", concurrency: 4, filename: "fixtures/progress_output.txt"},
|
{format: "progress", concurrency: 4, filename: fixtures.OutputFilenameProgress},
|
||||||
{format: "junit", concurrency: 4, filename: "fixtures/junit_output.xml"},
|
{format: "junit", concurrency: 4, filename: fixtures.OutputFilenameJUnit},
|
||||||
{format: "cucumber", concurrency: 2, filename: "fixtures/cucumber_output.json"},
|
{format: "cucumber", concurrency: 2, filename: fixtures.OutputFilenameCucumber},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
|
@ -300,10 +300,6 @@ func TestSucceedRun(t *testing.T) {
|
||||||
t.Run(
|
t.Run(
|
||||||
fmt.Sprintf("%s/concurrency/%d", tc.format, concurrency),
|
fmt.Sprintf("%s/concurrency/%d", tc.format, concurrency),
|
||||||
func(t *testing.T) {
|
func(t *testing.T) {
|
||||||
if tc.format == "cucumber" && strings.HasPrefix(runtime.Version(), "go1.11") {
|
|
||||||
t.Skipf("skipping due to format %q and go version: %q", tc.format, runtime.Version())
|
|
||||||
}
|
|
||||||
|
|
||||||
testSucceedRun(t, tc.format, concurrency, string(expectedOutput))
|
testSucceedRun(t, tc.format, concurrency, string(expectedOutput))
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче