Skip to content

Commit

Permalink
Switch to gotest.tools/v3 instead of testify 🐺
Browse files Browse the repository at this point in the history
gotest.tools has a nice set of package to handle command execution,
environment switch, wait, …

This remove our dependency on `testify` and use `gotest.tools` instead.

Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
  • Loading branch information
vdemeester authored and tekton-robot committed Dec 20, 2019
1 parent b04e006 commit 093a346
Show file tree
Hide file tree
Showing 24 changed files with 1,783 additions and 2,654 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ require (
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7 // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gotest.tools/v3 v3.0.0
k8s.io/api v0.0.0-20191004102255-dacd7df5a50b
k8s.io/apimachinery v0.0.0-20191004074956-01f8b7d1121a
k8s.io/cli-runtime v0.0.0-20191004110054-fe9b9282443f
Expand Down
3 changes: 3 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBn
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7 h1:9zdDQZ7Thm29KFXgAX/+yaf3eVbP7djjWp/dXAppNCc=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down Expand Up @@ -350,6 +351,8 @@ gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bl
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gotest.tools/v3 v3.0.0 h1:d+tVGRu6X0ZBQ+kyAR8JKi6AXhTP2gmQaoIYaGFz634=
gotest.tools/v3 v3.0.0/go.mod h1:TUP+/YtXl/dp++T+SZ5v2zUmLVBHmptSb/ajDLCJ+3c=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
Expand Down
8 changes: 3 additions & 5 deletions pkg/cmd/pipeline/logs_testutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import (
"github.com/AlecAivazis/survey/v2/terminal"
goexpect "github.com/Netflix/go-expect"
"github.com/hinshun/vt10x"
"github.com/stretchr/testify/require"
"github.com/tektoncd/cli/pkg/cli"
"github.com/tektoncd/cli/pkg/helper/options"
"gotest.tools/v3/assert"
)

type promptTest struct {
Expand Down Expand Up @@ -75,7 +75,7 @@ func (pt *promptTest) runTest(t *testing.T, procedure func(*goexpect.Console) er
// Multiplex output to a buffer as well for the raw bytes.
buf := new(bytes.Buffer)
c, state, err := vt10x.NewVT10XConsole(goexpect.WithStdout(buf))
require.Nil(t, err)
assert.NilError(t, err)
defer c.Close()

donec := make(chan struct{})
Expand All @@ -86,9 +86,7 @@ func (pt *promptTest) runTest(t *testing.T, procedure func(*goexpect.Console) er
}
}()

err = test(stdio(c))

require.Nil(t, err)
assert.NilError(t, test(stdio(c)))

// Close the slave end of the pty, and read the remaining bytes from the master end.
c.Tty().Close()
Expand Down
8 changes: 3 additions & 5 deletions pkg/cmd/pipelineresource/resource_testUtil.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/AlecAivazis/survey/v2/terminal"
goexpect "github.com/Netflix/go-expect"
"github.com/hinshun/vt10x"
"github.com/stretchr/testify/require"
"gotest.tools/v3/assert"
)

type promptTest struct {
Expand Down Expand Up @@ -55,7 +55,7 @@ func (pt *promptTest) runTest(t *testing.T, procedure func(*goexpect.Console) er
// Multiplex output to a buffer as well for the raw bytes.
buf := new(bytes.Buffer)
c, state, err := vt10x.NewVT10XConsole(goexpect.WithStdout(buf))
require.Nil(t, err)
assert.NilError(t, err)
defer c.Close()

donec := make(chan struct{})
Expand All @@ -66,9 +66,7 @@ func (pt *promptTest) runTest(t *testing.T, procedure func(*goexpect.Console) er
}
}()

err = test(stdio(c))

require.Nil(t, err)
assert.NilError(t, test(stdio(c)))

// Close the slave end of the pty, and read the remaining bytes from the master end.
c.Tty().Close()
Expand Down
8 changes: 3 additions & 5 deletions pkg/helper/test/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/AlecAivazis/survey/v2/terminal"
goexpect "github.com/Netflix/go-expect"
"github.com/hinshun/vt10x"
"github.com/stretchr/testify/require"
"gotest.tools/v3/assert"
)

type PromptTest struct {
Expand All @@ -34,7 +34,7 @@ func (pt *PromptTest) RunTest(t *testing.T, procedure func(*goexpect.Console) er
// Multiplex output to a buffer as well for the raw bytes.
buf := new(bytes.Buffer)
c, state, err := vt10x.NewVT10XConsole(goexpect.WithStdout(buf))
require.Nil(t, err)
assert.NilError(t, err)
defer c.Close()

donec := make(chan struct{})
Expand All @@ -45,9 +45,7 @@ func (pt *PromptTest) RunTest(t *testing.T, procedure func(*goexpect.Console) er
}
}()

err = test(stdio(c))

require.Nil(t, err)
assert.NilError(t, test(stdio(c)))

// Close the slave end of the pty, and read the remaining bytes from the master end.
c.Tty().Close()
Expand Down
28 changes: 0 additions & 28 deletions vendor/github.com/stretchr/testify/require/doc.go

This file was deleted.

16 changes: 0 additions & 16 deletions vendor/github.com/stretchr/testify/require/forward_requirements.go

This file was deleted.

Loading

0 comments on commit 093a346

Please sign in to comment.