Skip to content

Commit db8be02

Browse files
fix tests
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
1 parent b6921bc commit db8be02

File tree

2 files changed

+18
-28
lines changed

2 files changed

+18
-28
lines changed

go/api/base_client.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1892,7 +1892,7 @@ func (client *baseClient) XLen(key string) (int64, error) {
18921892
//
18931893
// Return value:
18941894
//
1895-
// An object containing the following elements:
1895+
// An object containing the following elements:
18961896
// - A stream ID to be used as the start argument for the next call to `XAUTOCLAIM`. This ID is
18971897
// equivalent to the next ID in the stream after the entries that were scanned, or "0-0" if
18981898
// the entire stream was scanned.
@@ -1949,7 +1949,7 @@ func (client *baseClient) XAutoClaim(
19491949
//
19501950
// Return value:
19511951
//
1952-
// An object containing the following elements:
1952+
// An object containing the following elements:
19531953
// - A stream ID to be used as the start argument for the next call to `XAUTOCLAIM`. This ID is
19541954
// equivalent to the next ID in the stream after the entries that were scanned, or "0-0" if
19551955
// the entire stream was scanned.
@@ -2019,7 +2019,7 @@ func (client *baseClient) XAutoClaimWithOptions(
20192019
//
20202020
// Return value:
20212021
//
2022-
// An object containing the following elements:
2022+
// An object containing the following elements:
20232023
// - A stream ID to be used as the start argument for the next call to `XAUTOCLAIM`. This ID is
20242024
// equivalent to the next ID in the stream after the entries that were scanned, or "0-0" if
20252025
// the entire stream was scanned.
@@ -2074,7 +2074,7 @@ func (client *baseClient) XAutoClaimJustId(
20742074
//
20752075
// Return value:
20762076
//
2077-
// An object containing the following elements:
2077+
// An object containing the following elements:
20782078
// - A stream ID to be used as the start argument for the next call to `XAUTOCLAIM`. This ID is
20792079
// equivalent to the next ID in the stream after the entries that were scanned, or "0-0" if
20802080
// the entire stream was scanned.

go/integTest/shared_commands_test.go

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4156,18 +4156,14 @@ func (suite *GlideTestSuite) TestXAutoClaim() {
41564156
assert.NoError(suite.T(), err)
41574157
assert.Equal(suite.T(), "0-2", xadd.Value())
41584158

4159-
sendWithCustomCommand(
4160-
suite,
4161-
client,
4162-
[]string{"XREADGROUP", "GROUP", group, consumer, "STREAMS", key, ">"},
4163-
"Can't send XREADGROUP as a custom command",
4164-
)
4165-
// assert.Equal(suite.T(), map[string]map[string][][]string{
4166-
// key: {
4167-
// "0-1": {{"entry1_field1", "entry1_value1"}, {"entry1_field2", "entry1_value2"}},
4168-
// "0-2": {{"entry2_field1", "entry2_value1"}},
4169-
// },
4170-
// }, xreadgroup)
4159+
xreadgroup, err := client.XReadGroup(group, consumer, map[string]string{key: ">"})
4160+
assert.NoError(suite.T(), err)
4161+
assert.Equal(suite.T(), map[string]map[string][][]string{
4162+
key: {
4163+
"0-1": {{"entry1_field1", "entry1_value1"}, {"entry1_field2", "entry1_value2"}},
4164+
"0-2": {{"entry2_field1", "entry2_value1"}},
4165+
},
4166+
}, xreadgroup)
41714167

41724168
opts := options.NewXAutoClaimOptionsWithCount(1)
41734169
xautoclaim, err := client.XAutoClaimWithOptions(key, group, consumer, 0, "0-0", opts)
@@ -5509,8 +5505,7 @@ func (suite *GlideTestSuite) TestXPending() {
55095505
streamid_2, err := client.XAdd(key, [][]string{{"field2", "value2"}})
55105506
assert.NoError(suite.T(), err)
55115507

5512-
command = []string{"XReadGroup", "GROUP", groupName, consumer1, "STREAMS", key, ">"}
5513-
_, err = client.CustomCommand(command)
5508+
_, err = client.XReadGroup(groupName, consumer1, map[string]string{key: ">"})
55145509
assert.NoError(suite.T(), err)
55155510

55165511
_, err = client.XAdd(key, [][]string{{"field3", "value3"}})
@@ -5520,8 +5515,7 @@ func (suite *GlideTestSuite) TestXPending() {
55205515
streamid_5, err := client.XAdd(key, [][]string{{"field5", "value5"}})
55215516
assert.NoError(suite.T(), err)
55225517

5523-
command = []string{"XReadGroup", "GROUP", groupName, consumer2, "STREAMS", key, ">"}
5524-
_, err = client.CustomCommand(command)
5518+
_, err = client.XReadGroup(groupName, consumer2, map[string]string{key: ">"})
55255519
assert.NoError(suite.T(), err)
55265520

55275521
expectedSummary := api.XPendingSummary{
@@ -5585,8 +5579,7 @@ func (suite *GlideTestSuite) TestXPending() {
55855579
streamid_2, err := client.XAdd(key, [][]string{{"field2", "value2"}})
55865580
assert.NoError(suite.T(), err)
55875581

5588-
command = []string{"XReadGroup", "GROUP", groupName, consumer1, "STREAMS", key, ">"}
5589-
_, err = client.CustomCommand(command)
5582+
_, err = client.XReadGroup(groupName, consumer1, map[string]string{key: ">"})
55905583
assert.NoError(suite.T(), err)
55915584

55925585
_, err = client.XAdd(key, [][]string{{"field3", "value3"}})
@@ -5596,8 +5589,7 @@ func (suite *GlideTestSuite) TestXPending() {
55965589
streamid_5, err := client.XAdd(key, [][]string{{"field5", "value5"}})
55975590
assert.NoError(suite.T(), err)
55985591

5599-
command = []string{"XReadGroup", "GROUP", groupName, consumer2, "STREAMS", key, ">"}
5600-
_, err = client.CustomCommand(command)
5592+
_, err = client.XReadGroup(groupName, consumer2, map[string]string{key: ">"})
56015593
assert.NoError(suite.T(), err)
56025594

56035595
expectedSummary := api.XPendingSummary{
@@ -5694,8 +5686,7 @@ func (suite *GlideTestSuite) TestXPendingFailures() {
56945686
assert.Equal(suite.T(), 0, len(detailResult))
56955687

56965688
// read the entire stream for the consumer and mark messages as pending
5697-
command = []string{"XReadGroup", "GROUP", groupName, consumer1, "STREAMS", key, ">"}
5698-
_, err = client.CustomCommand(command)
5689+
_, err = client.XReadGroup(groupName, consumer1, map[string]string{key: ">"})
56995690
assert.NoError(suite.T(), err)
57005691

57015692
// sanity check - expect some results:
@@ -5847,8 +5838,7 @@ func (suite *GlideTestSuite) TestXPendingFailures() {
58475838
assert.Equal(suite.T(), 0, len(detailResult))
58485839

58495840
// read the entire stream for the consumer and mark messages as pending
5850-
command = []string{"XReadGroup", "GROUP", groupName, consumer1, "STREAMS", key, ">"}
5851-
_, err = client.CustomCommand(command)
5841+
_, err = client.XReadGroup(groupName, consumer1, map[string]string{key: ">"})
58525842
assert.NoError(suite.T(), err)
58535843

58545844
// sanity check - expect some results:

0 commit comments

Comments
 (0)