From c7c3fdf039ae986b649bc95a9571f644870d40de Mon Sep 17 00:00:00 2001 From: Chmouel Boudjnah Date: Fri, 7 Jan 2022 13:04:00 +0100 Subject: [PATCH] Make sure we initialize the fake kube client (#397) --- pkg/cmd/tknpac/resolve/resolve_test.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/tknpac/resolve/resolve_test.go b/pkg/cmd/tknpac/resolve/resolve_test.go index cb988f4ef..965620b1d 100644 --- a/pkg/cmd/tknpac/resolve/resolve_test.go +++ b/pkg/cmd/tknpac/resolve/resolve_test.go @@ -9,10 +9,12 @@ import ( "github.com/openshift-pipelines/pipelines-as-code/pkg/params" "github.com/openshift-pipelines/pipelines-as-code/pkg/params/clients" "github.com/openshift-pipelines/pipelines-as-code/pkg/params/info" + testclient "github.com/openshift-pipelines/pipelines-as-code/pkg/test/clients" "go.uber.org/zap" zapobserver "go.uber.org/zap/zaptest/observer" "gotest.tools/v3/assert" assertfs "gotest.tools/v3/fs" + rtesting "knative.dev/pkg/reconciler/testing" ) var tmplSimpleNoPrefix = ` @@ -41,9 +43,16 @@ func TestSplitArgsInMap(t *testing.T) { } func TestCommandFilenameSetProperly(t *testing.T) { + tdata := testclient.Data{} + ctx, _ := rtesting.SetupFakeContext(t) + + stdata, _ := testclient.SeedTestData(t, ctx, tdata) cs := ¶ms.Run{ - Clients: clients.Clients{ClientInitialized: false}, - Info: info.Info{Pac: &info.PacOpts{}}, + Clients: clients.Clients{ + Kube: stdata.Kube, + ClientInitialized: false, + }, + Info: info.Info{Pac: &info.PacOpts{}}, } cmd := Command(cs) e := bytes.NewBufferString("")