- Notifications
You must be signed in to change notification settings - Fork 1.9k
Support CLUSTER commands #2015
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Support CLUSTER commands #2015
Changes from 1 commit
Commits
Show all changes
14 commits Select commit Hold shift + click to select a range
6c2f69f Support CLUSTER commands
7403892 add some client tests
df76319 remove only
b0f47d4 delete cluster slaves
e88cfda delete reset clietn test
8600d97 SET SLOT
3e5212a test with client
de14ee2 fix fail
a0c5f63 Update CLUSTER_COUNTKEYSINSLOT.spec.ts
Avital-Fine 818609e move commands to client/commands.ts
1e2efb9 clusterNode
990afef remove CLUSTER-SET-CONFIG-EPOCH test with client
e57785d Merge branch 'master' of github.com:redis/node-redis into CLUSTER-Com…
leibale 4350c57 clean code
leibale File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
add some client tests
- Loading branch information
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,19 @@ | ||
| import { strict as assert } from 'assert'; | ||
| import testUtils, { GLOBAL } from '../test-utils'; | ||
| import { transformArguments } from './CLUSTER_BUMPEPOCH'; | ||
| | ||
| describe('CLUSTER BUMPEPOCH', () => { | ||
| describe.only('CLUSTER BUMPEPOCH', () => { | ||
| it('transformArguments', () => { | ||
| assert.deepEqual( | ||
| transformArguments(), | ||
| ['CLUSTER', 'BUMPEPOCH'] | ||
| ); | ||
| }); | ||
| | ||
| testUtils.testWithCluster('cluster.clusterBumpEpoch', async cluster => { | ||
| assert.equal( | ||
| typeof await cluster.clusterBumpEpoch(), | ||
| 'string' | ||
| ); | ||
| }, GLOBAL.CLUSTERS.OPEN); | ||
| }); |
11 changes: 10 additions & 1 deletion 11 packages/client/lib/commands/CLUSTER_COUNT-FAILURE-REPORTS.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,20 @@ | ||
| import { strict as assert } from 'assert'; | ||
| import testUtils, { GLOBAL } from '../test-utils'; | ||
| import { transformArguments } from './CLUSTER_COUNT-FAILURE-REPORTS'; | ||
| | ||
| describe('CLUSTER COUNT-FAILURE-REPORTS', () => { | ||
| describe.only('CLUSTER COUNT-FAILURE-REPORTS', () => { | ||
| it('transformArguments', () => { | ||
| assert.deepEqual( | ||
| transformArguments('1'), | ||
| ['CLUSTER', 'COUNT-FAILURE-REPORTS', '1'] | ||
| ); | ||
| }); | ||
| | ||
| testUtils.testWithCluster('cluster.clusterCountFailureReports', async cluster => { | ||
| const id: string = await cluster.clusterMyId(); | ||
| assert.equal( | ||
| await cluster.clusterCountFailureReports(id), | ||
| 0 | ||
| ); | ||
| }, GLOBAL.CLUSTERS.OPEN); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,19 @@ | ||
| import { strict as assert } from 'assert'; | ||
| import testUtils, { GLOBAL } from '../test-utils'; | ||
| import { transformArguments } from './CLUSTER_MYID'; | ||
| | ||
| describe('CLUSTER MYID', () => { | ||
| describe.only('CLUSTER MYID', () => { | ||
| it('transformArguments', () => { | ||
| assert.deepEqual( | ||
| transformArguments(), | ||
| ['CLUSTER', 'MYID'] | ||
| ); | ||
| }); | ||
| | ||
| testUtils.testWithCluster('cluster.clusterMyId', async cluster => { | ||
| assert.notEqual( | ||
| await cluster.clusterMyId(), | ||
| null | ||
| ); | ||
| }, GLOBAL.CLUSTERS.OPEN); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,19 @@ | ||
| import { strict as assert } from 'assert'; | ||
| import testUtils, { GLOBAL } from '../test-utils'; | ||
| import { transformArguments } from './CLUSTER_SAVECONFIG'; | ||
| | ||
| describe('CLUSTER SAVECONFIG', () => { | ||
| describe.only('CLUSTER SAVECONFIG', () => { | ||
| it('transformArguments', () => { | ||
| assert.deepEqual( | ||
| transformArguments(), | ||
| ['CLUSTER', 'SAVECONFIG'] | ||
| ); | ||
| }); | ||
| | ||
| testUtils.testWithCluster('cluster.clusterSaveConfig', async cluster => { | ||
| assert.equal( | ||
| await cluster.clusterSaveConfig(), | ||
| 'OK' | ||
| ); | ||
| }, GLOBAL.CLUSTERS.OPEN); | ||
| }); |
14 changes: 13 additions & 1 deletion 14 packages/client/lib/commands/CLUSTER_SET-CONFIG-EPOCH.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,23 @@ | ||
| import { strict as assert } from 'assert'; | ||
| import testUtils, { GLOBAL } from '../test-utils'; | ||
| import { transformArguments } from './CLUSTER_SET-CONFIG-EPOCH'; | ||
| | ||
| describe('CLUSTER SET-CONFIG-EPOCH', () => { | ||
| describe.only('CLUSTER SET-CONFIG-EPOCH', () => { | ||
| it('transformArguments', () => { | ||
| assert.deepEqual( | ||
| transformArguments(0), | ||
| ['CLUSTER', 'SET-CONFIG-EPOCH', '0'] | ||
| ); | ||
| }); | ||
| | ||
| testUtils.testWithCluster('cluster.clusterSetConfigEpoch', async cluster => { | ||
| try { | ||
| assert.equal( | ||
| await cluster.clusterSetConfigEpoch(1), | ||
| 'OK' | ||
| ); | ||
| } catch (ReplyError) { | ||
Avital-Fine marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| //? | ||
| } | ||
| }, GLOBAL.CLUSTERS.OPEN); | ||
| }); | ||
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.