Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: TJ Zhang <[email protected]>
  • Loading branch information
TJ Zhang committed Aug 19, 2024
1 parent 453d546 commit a10ca4c
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
* Node: Added BZPOPMAX & BZPOPMIN command ([#2077]((https://github.com/valkey-io/valkey-glide/pull/2077))
* Node: Added XGROUP CREATECONSUMER & XGROUP DELCONSUMER commands ([#2088](https://github.com/valkey-io/valkey-glide/pull/2088))
* Node: Added GETEX command ([#2107]((https://github.com/valkey-io/valkey-glide/pull/2107))
* Node: Added XGROUP SETID command ([#TBD]((https://github.com/valkey-io/valkey-glide/pull/TBD))
* Node: Added XGROUP SETID command ([#2135]((https://github.com/valkey-io/valkey-glide/pull/2135))

#### Breaking Changes
* Node: (Refactor) Convert classes to types ([#2005](https://github.com/valkey-io/valkey-glide/pull/2005))
Expand Down
34 changes: 34 additions & 0 deletions node/tests/SharedTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8996,6 +8996,40 @@ export function runBaseTests(config: {
config.timeout,
);

it.each([ProtocolVersion.RESP2, ProtocolVersion.RESP3])(
`xgroupSetId test %p`,
async (protocol) => {
await runTest(async (client: BaseClient, cluster) => {
const key = "testKey" + uuidv4();
const nonExistingKey = "group" + uuidv4();
const stringKey = "testKey" + uuidv4();
const groupName = uuidv4();
const consumerName = uuidv4();
const streamId0 = "0";
const streamId1_0 = "1-0";
const streamId1_1 = "1-1";
const streamId1_2 = "1-2";

// Setup: Create stream with 3 entries, create consumer group, read entries to add them to the Pending Entries List
expect(
await client.xadd(key, [["f0", "v0"]], { id: streamId1_0 }),
).toBe(streamId1_0);
expect(
await client.xadd(key, [["f1", "v1"]], { id: streamId1_1 }),
).toBe(streamId1_1);
expect(
await client.xadd(key, [["f2", "v2"]], { id: streamId1_2 }),
).toBe(streamId1_2);

expect(
await client.xgroupCreate(key, groupName, streamId0),
).toBe("OK");
// TODO: finish implementing tests once XREADGROUP is done
}, protocol);
},
config.timeout,
);

it.each([ProtocolVersion.RESP2, ProtocolVersion.RESP3])(
`xpending test_%p`,
async (protocol) => {
Expand Down

0 comments on commit a10ca4c

Please sign in to comment.