Skip to content

Commit

Permalink
add UT
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyang0 committed Mar 8, 2024
1 parent d955791 commit 41258e2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions cluster/calcium/raw_engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,19 @@ func TestRawEngine(t *testing.T) {
_, err := c.RawEngine(ctx, &types.RawEngineOptions{ID: "id1", Op: "xxxx"})
assert.NoError(t, err)
}

func TestRawEngineIgnoreLock(t *testing.T) {
c := NewTestCluster()
ctx := context.Background()
store := c.store.(*storemocks.Store)
workload := &types.Workload{
ID: "id1",
Privileged: true,
}
engine := &enginemocks.API{}
workload.Engine = engine
store.On("GetWorkload", mock.Anything, mock.Anything).Return(workload, nil)
engine.On("RawEngine", mock.Anything, mock.Anything).Return(&enginetypes.RawEngineResult{}, nil).Once()
_, err := c.RawEngine(ctx, &types.RawEngineOptions{ID: "id1", Op: "xxxx", IgnoreLock: true})
assert.NoError(t, err)
}

0 comments on commit 41258e2

Please sign in to comment.