Skip to content

Commit

Permalink
Make sure we initialize the fake kube client (#397)
Browse files Browse the repository at this point in the history
  • Loading branch information
chmouel authored Jan 7, 2022
1 parent b9af169 commit c7c3fdf
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions pkg/cmd/tknpac/resolve/resolve_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 = `
Expand Down Expand Up @@ -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 := &params.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("")
Expand Down

0 comments on commit c7c3fdf

Please sign in to comment.