Skip to content

Commit 0e5af13

Browse files
committed
fix the fake runtime compitable issues
1 parent e449567 commit 0e5af13

File tree

9 files changed

+622
-622
lines changed

9 files changed

+622
-622
lines changed

cmd/convert_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232
)
3333

3434
func TestConvert(t *testing.T) {
35-
c := cmd.NewRootCmd(fakeruntime.FakeExecer{ExpectOS: "linux"},
35+
c := cmd.NewRootCmd(&fakeruntime.FakeExecer{ExpectOS: "linux"},
3636
server.NewFakeHTTPServer())
3737
c.SetOut(io.Discard)
3838

cmd/function_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func TestCreateFunctionCommand(t *testing.T) {
6464
}}
6565
for _, tt := range tests {
6666
t.Run(tt.name, func(t *testing.T) {
67-
c := cmd.NewRootCmd(fakeruntime.FakeExecer{ExpectOS: "linux"},
67+
c := cmd.NewRootCmd(&fakeruntime.FakeExecer{ExpectOS: "linux"},
6868
server.NewFakeHTTPServer())
6969

7070
buf := new(bytes.Buffer)

cmd/jsonschema_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
)
2929

3030
func TestJSONSchemaCmd(t *testing.T) {
31-
c := cmd.NewRootCmd(fakeruntime.FakeExecer{ExpectOS: "linux"},
31+
c := cmd.NewRootCmd(&fakeruntime.FakeExecer{ExpectOS: "linux"},
3232
server.NewFakeHTTPServer())
3333

3434
buf := new(bytes.Buffer)

cmd/mock_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func TestMockCommand(t *testing.T) {
4949
}
5050
for _, tc := range tt {
5151
t.Run(tc.name, func(t *testing.T) {
52-
root := NewRootCmd(fakeruntime.FakeExecer{ExpectOS: "linux"}, server.NewFakeHTTPServer())
52+
root := NewRootCmd(&fakeruntime.FakeExecer{ExpectOS: "linux"}, server.NewFakeHTTPServer())
5353
root.SetOut(io.Discard)
5454
root.SetArgs(tc.args)
5555
ctx, cancel := context.WithCancel(context.TODO())

cmd/root_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
)
2727

2828
func TestCreateRunCommand(t *testing.T) {
29-
execer := fakeruntime.FakeExecer{}
29+
execer := &fakeruntime.FakeExecer{}
3030

3131
cmd := createRunCommand()
3232
assert.Equal(t, "run", cmd.Use)
@@ -45,7 +45,7 @@ func TestCreateRunCommand(t *testing.T) {
4545
}
4646

4747
func TestRootCmd(t *testing.T) {
48-
c := NewRootCmd(fakeruntime.FakeExecer{ExpectOS: "linux"}, server.NewFakeHTTPServer())
48+
c := NewRootCmd(&fakeruntime.FakeExecer{ExpectOS: "linux"}, server.NewFakeHTTPServer())
4949
assert.NotNil(t, c)
5050
assert.Equal(t, "atest", c.Use)
5151
}

cmd/sample_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
)
2929

3030
func TestSampleCmd(t *testing.T) {
31-
c := cmd.NewRootCmd(fakeruntime.FakeExecer{ExpectOS: "linux"},
31+
c := cmd.NewRootCmd(&fakeruntime.FakeExecer{ExpectOS: "linux"},
3232
server.NewFakeHTTPServer())
3333

3434
buf := new(bytes.Buffer)

cmd/server_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func TestPrintProto(t *testing.T) {
8080
for _, tt := range tests {
8181
t.Run(tt.name, func(t *testing.T) {
8282
buf := new(bytes.Buffer)
83-
root := NewRootCmd(fakeruntime.FakeExecer{ExpectOS: "linux"}, server.NewFakeHTTPServer())
83+
root := NewRootCmd(&fakeruntime.FakeExecer{ExpectOS: "linux"}, server.NewFakeHTTPServer())
8484
root.SetOut(buf)
8585
root.SetArgs(append(tt.args, "--dry-run"))
8686
err := root.Execute()
@@ -182,7 +182,7 @@ func TestFrontEndHandlerWithLocation(t *testing.T) {
182182

183183
t.Run("download atest", func(t *testing.T) {
184184
opt := &serverOption{
185-
execer: fakeruntime.FakeExecer{
185+
execer: &fakeruntime.FakeExecer{
186186
ExpectOS: "linux",
187187
ExpectLookPathError: errors.New("fake"),
188188
},
@@ -199,7 +199,7 @@ func TestFrontEndHandlerWithLocation(t *testing.T) {
199199

200200
t.Run("download atest, failed to read", func(t *testing.T) {
201201
opt := &serverOption{
202-
execer: fakeruntime.FakeExecer{
202+
execer: &fakeruntime.FakeExecer{
203203
ExpectOS: "linux",
204204
},
205205
}
@@ -268,7 +268,7 @@ func TestOAuth(t *testing.T) {
268268
}}
269269
for i, tt := range tests {
270270
buf := new(bytes.Buffer)
271-
root := NewRootCmd(fakeruntime.FakeExecer{ExpectOS: "linux"}, server.NewFakeHTTPServer())
271+
root := NewRootCmd(&fakeruntime.FakeExecer{ExpectOS: "linux"}, server.NewFakeHTTPServer())
272272
root.SetOut(buf)
273273
root.SetArgs(append(tt.args, "--dry-run"))
274274
err := root.Execute()
@@ -294,7 +294,7 @@ func TestStartPlugins(t *testing.T) {
294294
}
295295
rootCmd.SetOut(io.Discard)
296296
rootCmd.AddCommand(createServerCmd(
297-
fakeruntime.FakeExecer{ExpectOS: "linux", ExpectLookPathError: errors.New("not-found")},
297+
&fakeruntime.FakeExecer{ExpectOS: "linux", ExpectLookPathError: errors.New("not-found")},
298298
server.NewFakeHTTPServer(),
299299
))
300300

@@ -310,7 +310,7 @@ func TestStartPlugins(t *testing.T) {
310310
}
311311
rootCmd.SetOut(io.Discard)
312312
rootCmd.AddCommand(createServerCmd(
313-
fakeruntime.FakeExecer{ExpectOS: "linux", ExpectLookPathError: errors.New("not-found")},
313+
&fakeruntime.FakeExecer{ExpectOS: "linux", ExpectLookPathError: errors.New("not-found")},
314314
httpServer,
315315
))
316316

0 commit comments

Comments
 (0)