Skip to content

Commit 97c299b

Browse files
committed
test: complete case name
1 parent 74131b4 commit 97c299b

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

pkg/entity/run/run.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ func NewDefExecuteContext(
2525
}
2626

2727
// ExecuteContext is a context using by action
28+
//go:generate mockery --name=ExecuteContext --output=. --inpackage --filename=run_mock.go
2829
type ExecuteContext interface {
2930
Context() context.Context
3031
// WithValue can attach value to context,so can share data between action

pkg/entity/run/run_mock.go

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/entity/run/run_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func TestDefExecuteContext_Tracef(t *testing.T) {
1414
wantLogs []interface{}
1515
}{
1616
{
17-
name: "",
17+
name: "simple",
1818
operation: func(e *DefExecuteContext) {
1919
e.Tracef("aaa")
2020
e.Tracef("bbb")
@@ -23,7 +23,7 @@ func TestDefExecuteContext_Tracef(t *testing.T) {
2323
wantLogs: []interface{}{"aaa", "bbb", "ccc"},
2424
},
2525
{
26-
name: "",
26+
name: "format",
2727
operation: func(e *DefExecuteContext) {
2828
e.Tracef("int:%d", 1)
2929
e.Tracef("str:%s", "aa")
@@ -32,14 +32,14 @@ func TestDefExecuteContext_Tracef(t *testing.T) {
3232
wantLogs: []interface{}{"int:1", "str:aa", "+v:{A:1}"},
3333
},
3434
{
35-
name: "",
35+
name: "format with opt",
3636
operation: func(e *DefExecuteContext) {
3737
e.Tracef("str:%s", "aa", "ss", TraceOpPersistAfterAction)
3838
},
3939
wantLogs: []interface{}{"str:aa%!(EXTRA string=ss)", TraceOpPersistAfterAction},
4040
},
4141
{
42-
name: "",
42+
name: "multi opt",
4343
operation: func(e *DefExecuteContext) {
4444
e.Tracef("str:%s", TraceOpPersistAfterAction, TraceOpPersistAfterAction, TraceOpPersistAfterAction)
4545
},
@@ -48,7 +48,7 @@ func TestDefExecuteContext_Tracef(t *testing.T) {
4848
},
4949
},
5050
{
51-
name: "",
51+
name: "not match format",
5252
operation: func(e *DefExecuteContext) {
5353
e.Tracef("int:%d", 1, TraceOpPersistAfterAction)
5454
e.Trace("cc", TraceOpPersistAfterAction)

0 commit comments

Comments
 (0)