Skip to content

Commit

Permalink
update cmd to use client.Init
Browse files Browse the repository at this point in the history
  • Loading branch information
lkingland committed Feb 5, 2023
1 parent dcd5381 commit bb88a95
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions cmd/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func testConfigApplied(cmdFn commandConstructor, t *testing.T) {
)
t.Setenv("XDG_CONFIG_HOME", home)

if err = fn.New().Create(f); err != nil {
if err = fn.New().Init(f); err != nil {
t.Fatal(err)
}

Expand Down Expand Up @@ -109,7 +109,7 @@ func testConfigPrecedence(cmdFn commandConstructor, t *testing.T) {
root := fromTempDirectory(t)
t.Setenv("XDG_CONFIG_HOME", home) // sets registry.example.com/global
f := fn.Function{Runtime: "go", Root: root, Name: "f"}
if err = fn.New().Create(f); err != nil {
if err = fn.New().Init(f); err != nil {
t.Fatal(err)
}
if err := cmdFn(clientFn).Execute(); err != nil {
Expand All @@ -126,7 +126,7 @@ func testConfigPrecedence(cmdFn commandConstructor, t *testing.T) {
root = fromTempDirectory(t)
t.Setenv("XDG_CONFIG_HOME", home) // sets registry.example.com/global
f = fn.Function{Runtime: "go", Root: root, Name: "f"}
if err := fn.New().Create(f); err != nil {
if err := fn.New().Init(f); err != nil {
t.Fatal(err)
}
if err = cmdFn(clientFn).Execute(); err != nil {
Expand All @@ -146,7 +146,7 @@ func testConfigPrecedence(cmdFn commandConstructor, t *testing.T) {
t.Setenv("XDG_CONFIG_HOME", home) // sets registry=example.com/global
f = fn.Function{Runtime: "go", Root: root, Name: "f",
Registry: "example.com/function"}
if err := fn.New().Create(f); err != nil {
if err := fn.New().Init(f); err != nil {
t.Fatal(err)
}
if err = cmdFn(clientFn).Execute(); err != nil {
Expand All @@ -165,7 +165,7 @@ func testConfigPrecedence(cmdFn commandConstructor, t *testing.T) {
t.Setenv("FUNC_REGISTRY", "example.com/env")
f = fn.Function{Runtime: "go", Root: root, Name: "f",
Registry: "example.com/function"}
if err := fn.New().Create(f); err != nil {
if err := fn.New().Init(f); err != nil {
t.Fatal(err)
}
if err := cmdFn(clientFn).Execute(); err != nil {
Expand All @@ -184,7 +184,7 @@ func testConfigPrecedence(cmdFn commandConstructor, t *testing.T) {
t.Setenv("FUNC_REGISTRY", "example.com/env")
f = fn.Function{Runtime: "go", Root: root, Name: "f",
Registry: "example.com/function"}
if err := fn.New().Create(f); err != nil {
if err := fn.New().Init(f); err != nil {
t.Fatal(err)
}
cmd := cmdFn(clientFn)
Expand Down Expand Up @@ -433,7 +433,7 @@ func testFunctionContext(cmdFn commandConstructor, t *testing.T) {
t.Helper()
root := fromTempDirectory(t)

if err := fn.New().Create(fn.Function{Runtime: "go", Root: root, Registry: TestRegistry}); err != nil {
if err := fn.New().Init(fn.Function{Runtime: "go", Root: root, Registry: TestRegistry}); err != nil {
t.Fatal(err)
}

Expand Down
6 changes: 3 additions & 3 deletions cmd/deploy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ func TestDeploy_Namespace(t *testing.T) {

// A function which will be repeatedly, mockingly deployed
f := fn.Function{Root: root, Runtime: "go", Registry: TestRegistry}
if err := fn.New().Create(f); err != nil {
if err := fn.New().Init(f); err != nil {
t.Fatal(err)
}

Expand Down Expand Up @@ -1047,7 +1047,7 @@ func TestDeploy_Envs(t *testing.T) {
expected []fn.Env
)

if err = fn.New().Create(fn.Function{Runtime: "go", Root: root, Registry: TestRegistry}); err != nil {
if err = fn.New().Init(fn.Function{Runtime: "go", Root: root, Registry: TestRegistry}); err != nil {
t.Fatal(err)
}

Expand Down Expand Up @@ -1129,7 +1129,7 @@ func TestDeploy_UnsetFlag(t *testing.T) {

// Create a function
f := fn.Function{Runtime: "go", Root: root, Registry: TestRegistry}
if err := fn.New().Create(f); err != nil {
if err := fn.New().Init(f); err != nil {
t.Fatal(err)
}

Expand Down

0 comments on commit bb88a95

Please sign in to comment.