Remove It() in e2e tests, simplified step declaration. Nicer test output for all tests

This commit is contained in:
Guillaume Tardif 2020-07-07 16:25:30 +02:00
parent f62ab26714
commit a2ea2347ba
5 changed files with 40 additions and 39 deletions

View file

@ -21,7 +21,6 @@ import (
"strings"
"github.com/robpike/filter"
"github.com/sirupsen/logrus"
)
func nonEmptyString(s string) bool {
@ -50,9 +49,3 @@ func GoldenFile(name string) string {
func IsWindows() bool {
return runtime.GOOS == "windows"
}
// It runs func
func It(description string, test func()) {
test()
logrus.Print("Passed: ", description)
}

View file

@ -22,6 +22,7 @@ import (
"os"
"os/exec"
"path/filepath"
"testing"
"time"
"github.com/onsi/gomega"
@ -133,6 +134,13 @@ func (s *Suite) NewCommand(command string, args ...string) *CmdContext {
}
}
// Step runs a step in a test, with an identified name and output in test results
func (s *Suite) Step(name string, test func()) {
s.T().Run(name, func(t *testing.T) {
test()
})
}
func dockerExecutable() string {
if IsWindows() {
return "docker.exe"