Test ok but the output of cucumber.json is broken. Pushed so someone else can also take a look.

Этот коммит содержится в:
tfreville 2020-03-09 11:51:41 +01:00
родитель eb75d692bd
коммит d76374bf14
2 изменённых файлов: 6 добавлений и 3 удалений

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

@ -5709,4 +5709,4 @@
} }
] ]
} }
] ]]

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

@ -5,6 +5,7 @@ import (
"fmt" "fmt"
"io" "io"
"io/ioutil" "io/ioutil"
"log"
"os" "os"
"regexp" "regexp"
"strings" "strings"
@ -251,14 +252,14 @@ func TestSucceedRun(t *testing.T) {
} }
for _, tc := range testCases { for _, tc := range testCases {
expectedOutputNoConcurrency, err := ioutil.ReadFile(tc.filename) expectedOutput, err := ioutil.ReadFile(tc.filename)
require.NoError(t, err) require.NoError(t, err)
for concurrency := range make([]int, tc.concurrency) { for concurrency := range make([]int, tc.concurrency) {
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) {
testSucceedRun(t, tc.format, concurrency, string(expectedOutputNoConcurrency)) testSucceedRun(t, tc.format, concurrency, string(expectedOutput))
}, },
) )
} }
@ -286,7 +287,9 @@ func testSucceedRun(t *testing.T, format string, concurrency int, expectedOutput
suiteCtxReg := regexp.MustCompile(`suite_context.go:\d+`) suiteCtxReg := regexp.MustCompile(`suite_context.go:\d+`)
expectedOutput = suiteCtxReg.ReplaceAllString(expectedOutput, `suite_context.go:0`) expectedOutput = suiteCtxReg.ReplaceAllString(expectedOutput, `suite_context.go:0`)
log.Println("expected clean: " + expectedOutput)
actual = suiteCtxReg.ReplaceAllString(actual, `suite_context.go:0`) actual = suiteCtxReg.ReplaceAllString(actual, `suite_context.go:0`)
log.Println("actual clean: " + actual)
assert.Equalf(t, expectedOutput, actual, "[%s]", actual) assert.Equalf(t, expectedOutput, actual, "[%s]", actual)
} }