Skip to content

Commit

Permalink
enable debug mode in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
leibale committed May 29, 2023
1 parent c68307c commit 18cff90
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
22 changes: 14 additions & 8 deletions packages/client/lib/test-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,43 @@ import TestUtils from '@redis/test-utils';
import { SinonSpy } from 'sinon';
import { promiseTimeout } from './utils';

export default new TestUtils({
dockerImageName: 'redis',
dockerImageVersionArgument: 'redis-version'
const utils = new TestUtils({
dockerImageName: 'redis',
dockerImageVersionArgument: 'redis-version'
});

export default utils;

const DEBUG_MODE_ARGS = utils.isVersionGreaterThan([7]) ?
['--enable-debug-command', 'yes'] :
[];

export const GLOBAL = {
SERVERS: {
OPEN: {
serverArguments: []
serverArguments: [...DEBUG_MODE_ARGS]
},
PASSWORD: {
serverArguments: ['--requirepass', 'password'],
serverArguments: ['--requirepass', 'password', ...DEBUG_MODE_ARGS],
clientOptions: {
password: 'password'
}
}
},
CLUSTERS: {
OPEN: {
serverArguments: []
serverArguments: [...DEBUG_MODE_ARGS]
},
PASSWORD: {
serverArguments: ['--requirepass', 'password'],
serverArguments: ['--requirepass', 'password', ...DEBUG_MODE_ARGS],
clusterConfiguration: {
defaults: {
password: 'password'
}
}
},
WITH_REPLICAS: {
serverArguments: [],
serverArguments: [...DEBUG_MODE_ARGS],
numberOfMasters: 2,
numberOfReplicas: 1,
clusterConfiguration: {
Expand Down
2 changes: 1 addition & 1 deletion packages/test-utils/lib/dockers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ async function spawnRedisServerDocker({ image, version }: RedisServerDockerConfi
'docker run -d --network host $(' +
`docker build ${DOCKER_FODLER_PATH} -q ` +
`--build-arg IMAGE=${image}:${version} ` +
`--build-arg REDIS_ARGUMENTS="--save '' --port ${port.toString()} --enable-debug-command yes ${serverArguments.join(' ')}"` +
`--build-arg REDIS_ARGUMENTS="--save '' --port ${port.toString()} ${serverArguments.join(' ')}"` +
')'
);

Expand Down

0 comments on commit 18cff90

Please sign in to comment.