Skip to content

Commit 34212aa

Browse files
committed
churn(test): use redislabs/client-libs-test for testing
- `FT.SUGGET` [`WITHSCORES`] [`WITHPAYLOAD`] are now returning empty array `[]` instead of `null` in `8.0-M04-pre` - Update `FT.PROFILE` reply to include shards & coordinator profiles - Update default redis server version to `8.0-M04-pre`
1 parent 558ebb4 commit 34212aa

22 files changed

+258
-114
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ jobs:
2121
strategy:
2222
fail-fast: false
2323
matrix:
24-
node-version: ['18', '20', '22']
25-
redis-version: ['6.2.6-v17', '7.2.0-v13', '7.4.0-v1']
24+
node-version: [ '18', '20', '22' ]
25+
redis-version: [ 'rs-7.2.0-v13', 'rs-7.4.0-v1', '8.0-M04-pre' ]
2626
steps:
2727
- uses: actions/checkout@v4
2828
with:

packages/bloom/lib/test-utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import TestUtils from '@redis/test-utils';
22
import RedisBloomModules from '.';
33

44
export default new TestUtils({
5-
dockerImageName: 'redis/redis-stack',
5+
dockerImageName: 'redislabs/client-libs-test',
66
dockerImageVersionArgument: 'redisbloom-version',
7-
defaultDockerVersion: '7.4.0-v1'
7+
defaultDockerVersion: 'rs-7.4.0-v1'
88
});
99

1010
export const GLOBAL = {

packages/client/lib/test-utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import { Command } from './RESP/types';
66
import { BasicCommandParser } from './client/parser';
77

88
const utils = new TestUtils({
9-
dockerImageName: 'redis/redis-stack',
9+
dockerImageName: 'redislabs/client-libs-test',
1010
dockerImageVersionArgument: 'redis-version',
11-
defaultDockerVersion: '7.4.0-v1'
11+
defaultDockerVersion: 'rs-7.4.0-v1'
1212
});
1313

1414
export default utils;

packages/entraid/lib/test-utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import TestUtils from '@redis/test-utils';
44
import { EntraidCredentialsProvider } from './entraid-credentials-provider';
55

66
export const testUtils = new TestUtils({
7-
dockerImageName: 'redis/redis-stack',
7+
dockerImageName: 'redislabs/client-libs-test',
88
dockerImageVersionArgument: 'redis-version',
9-
defaultDockerVersion: '7.4.0-v1'
9+
defaultDockerVersion: 'rs-7.4.0-v1'
1010
});
1111

1212
const DEBUG_MODE_ARGS = testUtils.isVersionGreaterThan([7]) ?

packages/graph/lib/test-utils.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import TestUtils from '@redis/test-utils';
22
import RedisGraph from '.';
33

4+
45
export default new TestUtils({
5-
dockerImageName: 'redis/redis-stack',
6+
dockerImageName: 'redislabs/client-libs-test',
67
dockerImageVersionArgument: 'redisgraph-version',
7-
defaultDockerVersion: '7.4.0-v1'
8+
defaultDockerVersion: 'rs-7.4.0-v1'
89
});
910

1011
export const GLOBAL = {

packages/json/lib/test-utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import TestUtils from '@redis/test-utils';
22
import RedisJSON from '.';
33

44
export default new TestUtils({
5-
dockerImageName: 'redis/redis-stack',
5+
dockerImageName: 'redislabs/client-libs-test',
66
dockerImageVersionArgument: 'redisgraph-version',
7-
defaultDockerVersion: '7.4.0-v1'
7+
defaultDockerVersion: 'rs-7.4.0-v1'
88
});
99

1010
export const GLOBAL = {

packages/search/lib/commands/INFO.spec.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,14 @@ describe('INFO', () => {
2424
index_name: 'index',
2525
index_options: [],
2626
index_definition: Object.create(null, {
27-
default_score: {
27+
28+
indexes_all: {
29+
value: 'false',
30+
configurable: true,
31+
enumerable: true
32+
},
33+
34+
default_score: {
2835
value: '1',
2936
configurable: true,
3037
enumerable: true

packages/search/lib/commands/PROFILE_AGGREGATE.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ describe('PROFILE AGGREGATE', () => {
4040
]);
4141

4242
const res = await client.ft.profileAggregate('index', '*');
43-
assert.deepEqual('None', res.profile.warning);
44-
assert.ok(typeof res.profile.iteratorsProfile.counter === 'number');
45-
assert.ok(typeof res.profile.parsingTime === 'string');
43+
assert.deepEqual('None', res.shards[0].warning);
44+
assert.ok(typeof res.shards[0].iteratorsProfile.counter === 'number');
45+
assert.ok(typeof res.shards[0].parsingTime === 'string');
4646
assert.ok(res.results.total == 1);
4747
}, GLOBAL.SERVERS.OPEN);
4848
});
Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,38 @@
11
import { CommandParser } from '@redis/client/dist/lib/client/parser';
2-
import { Command, ReplyUnion } from "@redis/client/dist/lib/RESP/types";
3-
import AGGREGATE, { AggregateRawReply, FtAggregateOptions, parseAggregateOptions } from "./AGGREGATE";
4-
import { ProfileOptions, ProfileRawReply, ProfileReply, transformProfile } from "./PROFILE_SEARCH";
2+
import { Command, ReplyUnion } from '@redis/client/dist/lib/RESP/types';
3+
import AGGREGATE, { AggregateRawReply, FtAggregateOptions, parseAggregateOptions } from './AGGREGATE';
4+
import { ProfileOptions, ProfileRawReply, ProfileReply, transformCoordinatorProfile, transformShardProfile } from './PROFILE_SEARCH';
55

66
export default {
77
NOT_KEYED_COMMAND: true,
8-
IS_READ_ONLY: true,
9-
parseCommand(
10-
parser: CommandParser,
11-
index: string,
12-
query: string,
13-
options?: ProfileOptions & FtAggregateOptions
14-
) {
15-
parser.push('FT.PROFILE', index, 'AGGREGATE');
16-
17-
if (options?.LIMITED) {
18-
parser.push('LIMITED');
19-
}
20-
21-
parser.push('QUERY', query);
8+
IS_READ_ONLY: true,
9+
parseCommand(
10+
parser: CommandParser,
11+
index: string,
12+
query: string,
13+
options?: ProfileOptions & FtAggregateOptions
14+
) {
15+
parser.push('FT.PROFILE', index, 'AGGREGATE');
2216

23-
parseAggregateOptions(parser, options)
24-
},
25-
transformReply: {
26-
2: (reply: ProfileAggeregateRawReply): ProfileReply => {
27-
return {
28-
results: AGGREGATE.transformReply[2](reply[0]),
29-
profile: transformProfile(reply[1])
30-
}
31-
},
32-
3: undefined as unknown as () => ReplyUnion
17+
if (options?.LIMITED) {
18+
parser.push('LIMITED');
19+
}
20+
21+
parser.push('QUERY', query);
22+
23+
parseAggregateOptions(parser, options)
24+
},
25+
transformReply: {
26+
2: (reply: ProfileAggeregateRawReply): ProfileReply => {
27+
return {
28+
results: AGGREGATE.transformReply[2](reply[0]),
29+
shards: transformShardProfile(reply[1]),
30+
coordinator: transformCoordinatorProfile(reply[1])
31+
}
3332
},
34-
unstableResp3: true
35-
} as const satisfies Command;
33+
3: undefined as unknown as () => ReplyUnion
34+
},
35+
unstableResp3: true
36+
} as const satisfies Command;
3637

37-
type ProfileAggeregateRawReply = ProfileRawReply<AggregateRawReply>;
38+
type ProfileAggeregateRawReply = ProfileRawReply<AggregateRawReply>;

packages/search/lib/commands/PROFILE_SEARCH.spec.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ describe('PROFILE SEARCH', () => {
3636
]);
3737

3838
const res = await client.ft.profileSearch('index', '*');
39-
assert.strictEqual('None', res.profile.warning);
40-
assert.ok(typeof res.profile.iteratorsProfile.counter === 'number');
41-
assert.ok(typeof res.profile.parsingTime === 'string');
39+
40+
assert.strictEqual('None', res.shards[0].warning);
41+
assert.ok(typeof res.shards[0].iteratorsProfile.counter === 'number');
42+
assert.ok(typeof res.shards[0].parsingTime === 'string');
4243
assert.ok(res.results.total == 1);
4344
}, GLOBAL.SERVERS.OPEN);
4445
});

0 commit comments

Comments
 (0)