Skip to content

Commit

Permalink
doc: stm test annotations for cli/sync category
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDivic committed Feb 13, 2022
1 parent d50a26f commit 93d9bfb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cli/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func TestSyncStatus(t *testing.T) {

mockApi.EXPECT().SyncState(ctx).Return(state, nil)

//stm: @CLI_SYNC_STATUS_001
err := app.Run([]string{"sync", "status"})
assert.NoError(t, err)

Expand All @@ -68,6 +69,7 @@ func TestSyncMarkBad(t *testing.T) {

mockApi.EXPECT().SyncMarkBad(ctx, blk.Cid()).Return(nil)

//stm: @CLI_SYNC_MARK_BAD_001
err := app.Run([]string{"sync", "mark-bad", blk.Cid().String()})
assert.NoError(t, err)
}
Expand All @@ -84,6 +86,7 @@ func TestSyncUnmarkBad(t *testing.T) {

mockApi.EXPECT().SyncUnmarkBad(ctx, blk.Cid()).Return(nil)

//stm: @CLI_SYNC_UNMARK_BAD_001
err := app.Run([]string{"sync", "unmark-bad", blk.Cid().String()})
assert.NoError(t, err)
})
Expand All @@ -97,6 +100,7 @@ func TestSyncUnmarkBad(t *testing.T) {

mockApi.EXPECT().SyncUnmarkAllBad(ctx).Return(nil)

//stm: @CLI_SYNC_UNMARK_BAD_002
err := app.Run([]string{"sync", "unmark-bad", "-all"})
assert.NoError(t, err)
})
Expand All @@ -114,6 +118,7 @@ func TestSyncCheckBad(t *testing.T) {

mockApi.EXPECT().SyncCheckBad(ctx, blk.Cid()).Return("", nil)

//stm: @CLI_SYNC_CHECK_BAD_002
err := app.Run([]string{"sync", "check-bad", blk.Cid().String()})
assert.NoError(t, err)

Expand All @@ -132,6 +137,7 @@ func TestSyncCheckBad(t *testing.T) {

mockApi.EXPECT().SyncCheckBad(ctx, blk.Cid()).Return(reason, nil)

//stm: @CLI_SYNC_CHECK_BAD_001
err := app.Run([]string{"sync", "check-bad", blk.Cid().String()})
assert.NoError(t, err)

Expand All @@ -155,6 +161,7 @@ func TestSyncCheckpoint(t *testing.T) {
mockApi.EXPECT().SyncCheckpoint(ctx, ts.Key()).Return(nil),
)

//stm: @CLI_SYNC_CHECKPOINT_001
err := app.Run([]string{"sync", "checkpoint", blk.Cid().String()})
assert.NoError(t, err)
})
Expand All @@ -175,6 +182,7 @@ func TestSyncCheckpoint(t *testing.T) {
mockApi.EXPECT().SyncCheckpoint(ctx, ts.Key()).Return(nil),
)

//stm: @CLI_SYNC_CHECKPOINT_002
err := app.Run([]string{"sync", "checkpoint", fmt.Sprintf("-epoch=%d", epoch)})
assert.NoError(t, err)
})
Expand Down

0 comments on commit 93d9bfb

Please sign in to comment.