You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-09 00:22:08 +03:00
chore(tests): bump test container version 8.2 (#3046)
This commit is contained in:
committed by
GitHub
parent
12f7d8a7fe
commit
6406172ea8
2
.github/workflows/tests.yml
vendored
2
.github/workflows/tests.yml
vendored
@@ -22,7 +22,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
node-version: ["18", "20", "22"]
|
node-version: ["18", "20", "22"]
|
||||||
redis-version: ["rs-7.4.0-v1", "8.0.2", "8.2-rc2-pre"]
|
redis-version: ["rs-7.4.0-v1", "8.0.2", "8.2"]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
|
@@ -241,7 +241,7 @@ Node Redis v5 adds support for [Client Side Caching](https://redis.io/docs/manua
|
|||||||
```typescript
|
```typescript
|
||||||
// Enable client side caching with RESP3
|
// Enable client side caching with RESP3
|
||||||
const client = createClient({
|
const client = createClient({
|
||||||
RESP: 3,
|
RESP: 3,
|
||||||
clientSideCache: {
|
clientSideCache: {
|
||||||
ttl: 0, // Time-to-live (0 = no expiration)
|
ttl: 0, // Time-to-live (0 = no expiration)
|
||||||
maxEntries: 0, // Maximum entries (0 = unlimited)
|
maxEntries: 0, // Maximum entries (0 = unlimited)
|
||||||
@@ -304,6 +304,7 @@ Node Redis is supported with the following versions of Redis:
|
|||||||
|
|
||||||
| Version | Supported |
|
| Version | Supported |
|
||||||
| ------- | ------------------ |
|
| ------- | ------------------ |
|
||||||
|
| 8.2.z | :heavy_check_mark: |
|
||||||
| 8.0.z | :heavy_check_mark: |
|
| 8.0.z | :heavy_check_mark: |
|
||||||
| 7.4.z | :heavy_check_mark: |
|
| 7.4.z | :heavy_check_mark: |
|
||||||
| 7.2.z | :heavy_check_mark: |
|
| 7.2.z | :heavy_check_mark: |
|
||||||
|
@@ -4,7 +4,7 @@ import RedisBloomModules from '.';
|
|||||||
export default TestUtils.createFromConfig({
|
export default TestUtils.createFromConfig({
|
||||||
dockerImageName: 'redislabs/client-libs-test',
|
dockerImageName: 'redislabs/client-libs-test',
|
||||||
dockerImageVersionArgument: 'redis-version',
|
dockerImageVersionArgument: 'redis-version',
|
||||||
defaultDockerVersion: '8.2-rc2-pre'
|
defaultDockerVersion: '8.2'
|
||||||
});
|
});
|
||||||
|
|
||||||
export const GLOBAL = {
|
export const GLOBAL = {
|
||||||
|
@@ -174,16 +174,16 @@ export class SentinelFramework extends DockerBase {
|
|||||||
this.#testUtils = TestUtils.createFromConfig({
|
this.#testUtils = TestUtils.createFromConfig({
|
||||||
dockerImageName: 'redislabs/client-libs-test',
|
dockerImageName: 'redislabs/client-libs-test',
|
||||||
dockerImageVersionArgument: 'redis-version',
|
dockerImageVersionArgument: 'redis-version',
|
||||||
defaultDockerVersion: '8.2-rc2-pre'
|
defaultDockerVersion: '8.2'
|
||||||
});
|
});
|
||||||
this.#nodeMap = new Map<string, ArrayElement<Awaited<ReturnType<SentinelFramework['spawnRedisSentinelNodes']>>>>();
|
this.#nodeMap = new Map<string, ArrayElement<Awaited<ReturnType<SentinelFramework['spawnRedisSentinelNodes']>>>>();
|
||||||
this.#sentinelMap = new Map<string, ArrayElement<Awaited<ReturnType<SentinelFramework['spawnRedisSentinelSentinels']>>>>();
|
this.#sentinelMap = new Map<string, ArrayElement<Awaited<ReturnType<SentinelFramework['spawnRedisSentinelSentinels']>>>>();
|
||||||
}
|
}
|
||||||
|
|
||||||
getSentinelClient(opts?: Partial<RedisSentinelOptions<RedisModules,
|
getSentinelClient(opts?: Partial<RedisSentinelOptions<RedisModules,
|
||||||
RedisFunctions,
|
RedisFunctions,
|
||||||
RedisScripts,
|
RedisScripts,
|
||||||
RespVersions,
|
RespVersions,
|
||||||
TypeMapping>>, errors = true) {
|
TypeMapping>>, errors = true) {
|
||||||
if (opts?.sentinelRootNodes !== undefined) {
|
if (opts?.sentinelRootNodes !== undefined) {
|
||||||
throw new Error("cannot specify sentinelRootNodes here");
|
throw new Error("cannot specify sentinelRootNodes here");
|
||||||
@@ -252,7 +252,7 @@ export class SentinelFramework extends DockerBase {
|
|||||||
|
|
||||||
protected async spawnRedisSentinelNodes(replicasCount: number) {
|
protected async spawnRedisSentinelNodes(replicasCount: number) {
|
||||||
const master = await this.#testUtils.spawnRedisServer({serverArguments: DEBUG_MODE_ARGS})
|
const master = await this.#testUtils.spawnRedisServer({serverArguments: DEBUG_MODE_ARGS})
|
||||||
|
|
||||||
const replicas: Array<RedisServerDocker> = []
|
const replicas: Array<RedisServerDocker> = []
|
||||||
for (let i = 0; i < replicasCount; i++) {
|
for (let i = 0; i < replicasCount; i++) {
|
||||||
const replica = await this.#testUtils.spawnRedisServer({serverArguments: DEBUG_MODE_ARGS})
|
const replica = await this.#testUtils.spawnRedisServer({serverArguments: DEBUG_MODE_ARGS})
|
||||||
@@ -282,7 +282,7 @@ export class SentinelFramework extends DockerBase {
|
|||||||
async getAllRunning() {
|
async getAllRunning() {
|
||||||
for (const port of this.getAllNodesPort()) {
|
for (const port of this.getAllNodesPort()) {
|
||||||
let first = true;
|
let first = true;
|
||||||
while (await isPortAvailable(port)) {
|
while (await isPortAvailable(port)) {
|
||||||
if (!first) {
|
if (!first) {
|
||||||
console.log(`problematic restart ${port}`);
|
console.log(`problematic restart ${port}`);
|
||||||
await setTimeout(500);
|
await setTimeout(500);
|
||||||
@@ -295,7 +295,7 @@ export class SentinelFramework extends DockerBase {
|
|||||||
|
|
||||||
for (const port of this.getAllSentinelsPort()) {
|
for (const port of this.getAllSentinelsPort()) {
|
||||||
let first = true;
|
let first = true;
|
||||||
while (await isPortAvailable(port)) {
|
while (await isPortAvailable(port)) {
|
||||||
if (!first) {
|
if (!first) {
|
||||||
await setTimeout(500);
|
await setTimeout(500);
|
||||||
} else {
|
} else {
|
||||||
@@ -325,7 +325,7 @@ export class SentinelFramework extends DockerBase {
|
|||||||
await client.connect();
|
await client.connect();
|
||||||
await client.replicaOf("127.0.0.1", masterPort);
|
await client.replicaOf("127.0.0.1", masterPort);
|
||||||
await client.close();
|
await client.close();
|
||||||
|
|
||||||
|
|
||||||
this.#nodeList.push(replica);
|
this.#nodeList.push(replica);
|
||||||
this.#nodeMap.set(replica.port.toString(), replica);
|
this.#nodeMap.set(replica.port.toString(), replica);
|
||||||
@@ -333,9 +333,9 @@ export class SentinelFramework extends DockerBase {
|
|||||||
|
|
||||||
async getMaster(tracer?: Array<string>): Promise<string | undefined> {
|
async getMaster(tracer?: Array<string>): Promise<string | undefined> {
|
||||||
const client = RedisClient.create({
|
const client = RedisClient.create({
|
||||||
name: this.config.sentinelName,
|
name: this.config.sentinelName,
|
||||||
socket: {
|
socket: {
|
||||||
host: "127.0.0.1",
|
host: "127.0.0.1",
|
||||||
port: this.#sentinelList[0].port,
|
port: this.#sentinelList[0].port,
|
||||||
},
|
},
|
||||||
modules: RedisSentinelModule,
|
modules: RedisSentinelModule,
|
||||||
@@ -464,9 +464,9 @@ export class SentinelFramework extends DockerBase {
|
|||||||
|
|
||||||
async sentinelSentinels() {
|
async sentinelSentinels() {
|
||||||
const client = RedisClient.create({
|
const client = RedisClient.create({
|
||||||
name: this.config.sentinelName,
|
name: this.config.sentinelName,
|
||||||
socket: {
|
socket: {
|
||||||
host: "127.0.0.1",
|
host: "127.0.0.1",
|
||||||
port: this.#sentinelList[0].port,
|
port: this.#sentinelList[0].port,
|
||||||
},
|
},
|
||||||
modules: RedisSentinelModule,
|
modules: RedisSentinelModule,
|
||||||
@@ -480,9 +480,9 @@ export class SentinelFramework extends DockerBase {
|
|||||||
|
|
||||||
async sentinelMaster() {
|
async sentinelMaster() {
|
||||||
const client = RedisClient.create({
|
const client = RedisClient.create({
|
||||||
name: this.config.sentinelName,
|
name: this.config.sentinelName,
|
||||||
socket: {
|
socket: {
|
||||||
host: "127.0.0.1",
|
host: "127.0.0.1",
|
||||||
port: this.#sentinelList[0].port,
|
port: this.#sentinelList[0].port,
|
||||||
},
|
},
|
||||||
modules: RedisSentinelModule,
|
modules: RedisSentinelModule,
|
||||||
@@ -496,9 +496,9 @@ export class SentinelFramework extends DockerBase {
|
|||||||
|
|
||||||
async sentinelReplicas() {
|
async sentinelReplicas() {
|
||||||
const client = RedisClient.create({
|
const client = RedisClient.create({
|
||||||
name: this.config.sentinelName,
|
name: this.config.sentinelName,
|
||||||
socket: {
|
socket: {
|
||||||
host: "127.0.0.1",
|
host: "127.0.0.1",
|
||||||
port: this.#sentinelList[0].port,
|
port: this.#sentinelList[0].port,
|
||||||
},
|
},
|
||||||
modules: RedisSentinelModule,
|
modules: RedisSentinelModule,
|
||||||
@@ -509,4 +509,4 @@ export class SentinelFramework extends DockerBase {
|
|||||||
|
|
||||||
return replicas
|
return replicas
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -9,7 +9,7 @@ import RedisBloomModules from '@redis/bloom';
|
|||||||
const utils = TestUtils.createFromConfig({
|
const utils = TestUtils.createFromConfig({
|
||||||
dockerImageName: 'redislabs/client-libs-test',
|
dockerImageName: 'redislabs/client-libs-test',
|
||||||
dockerImageVersionArgument: 'redis-version',
|
dockerImageVersionArgument: 'redis-version',
|
||||||
defaultDockerVersion: '8.2-rc2-pre'
|
defaultDockerVersion: '8.2'
|
||||||
});
|
});
|
||||||
|
|
||||||
export default utils;
|
export default utils;
|
||||||
|
@@ -6,7 +6,7 @@ import { EntraidCredentialsProvider } from './entraid-credentials-provider';
|
|||||||
export const testUtils = TestUtils.createFromConfig({
|
export const testUtils = TestUtils.createFromConfig({
|
||||||
dockerImageName: 'redislabs/client-libs-test',
|
dockerImageName: 'redislabs/client-libs-test',
|
||||||
dockerImageVersionArgument: 'redis-version',
|
dockerImageVersionArgument: 'redis-version',
|
||||||
defaultDockerVersion: '8.2-rc2-pre'
|
defaultDockerVersion: '8.2'
|
||||||
});
|
});
|
||||||
|
|
||||||
const DEBUG_MODE_ARGS = testUtils.isVersionGreaterThan([7]) ?
|
const DEBUG_MODE_ARGS = testUtils.isVersionGreaterThan([7]) ?
|
||||||
|
@@ -4,7 +4,7 @@ import RedisJSON from '.';
|
|||||||
export default TestUtils.createFromConfig({
|
export default TestUtils.createFromConfig({
|
||||||
dockerImageName: 'redislabs/client-libs-test',
|
dockerImageName: 'redislabs/client-libs-test',
|
||||||
dockerImageVersionArgument: 'redis-version',
|
dockerImageVersionArgument: 'redis-version',
|
||||||
defaultDockerVersion: '8.2-rc2-pre'
|
defaultDockerVersion: '8.2'
|
||||||
});
|
});
|
||||||
|
|
||||||
export const GLOBAL = {
|
export const GLOBAL = {
|
||||||
|
@@ -5,7 +5,7 @@ import { RespVersions } from '@redis/client';
|
|||||||
export default TestUtils.createFromConfig({
|
export default TestUtils.createFromConfig({
|
||||||
dockerImageName: 'redislabs/client-libs-test',
|
dockerImageName: 'redislabs/client-libs-test',
|
||||||
dockerImageVersionArgument: 'redis-version',
|
dockerImageVersionArgument: 'redis-version',
|
||||||
defaultDockerVersion: '8.2-rc2-pre'
|
defaultDockerVersion: '8.2'
|
||||||
});
|
});
|
||||||
|
|
||||||
export const GLOBAL = {
|
export const GLOBAL = {
|
||||||
|
@@ -4,7 +4,7 @@ import TimeSeries from '.';
|
|||||||
export default TestUtils.createFromConfig({
|
export default TestUtils.createFromConfig({
|
||||||
dockerImageName: 'redislabs/client-libs-test',
|
dockerImageName: 'redislabs/client-libs-test',
|
||||||
dockerImageVersionArgument: 'redis-version',
|
dockerImageVersionArgument: 'redis-version',
|
||||||
defaultDockerVersion: '8.2-rc2-pre'
|
defaultDockerVersion: '8.2'
|
||||||
});
|
});
|
||||||
|
|
||||||
export const GLOBAL = {
|
export const GLOBAL = {
|
||||||
|
Reference in New Issue
Block a user