Skip to content

Commit

Permalink
add makefile to support testing
Browse files Browse the repository at this point in the history
  • Loading branch information
pubalokta committed Jul 25, 2024
1 parent 01044b6 commit 2327b57
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ jobs:
- name: install redis-ci
run: sudo apt-get install redis-tools

# - name: Install dependencies
# run: npm install
- name: Install dependencies
run: npm install

# - name: Setup Standalone Tests
# run: make test-standalone-setup
Expand All @@ -45,10 +45,10 @@ jobs:
run: make test-cluster-setup

- name: Check Redis Cluster
run: redis-cli -c -p 16371 cluster info
run: timeout 60 bash <<< "until redis-cli -c -p 16371 cluster info | grep 'cluster_state:ok'; do sleep 1; done"

# - name: Run Clustered tests
# run: make test-cluster
- name: Run Clustered tests
run: make test-cluster

- name: Teardown Clustered Tests
run: make test-cluster-teardown
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ test-standalone-teardown:

test-cluster-setup:
docker-compose -f docker-compose-cluster.yml up -d
timeout 60s sh -c 'until ! docker ps | grep limitd-redis-redis-cluster-create; do echo "Waiting for cluster create container to finish..."; sleep 2; done'

test-cluster-teardown:
docker-compose -f docker-compose-cluster.yml down
Expand Down
2 changes: 0 additions & 2 deletions test-resources/redis-cluster/redis-cluster-create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@ node_2_ip="0.0.0.0"
node_3_ip="0.0.0.0"

redis-cli --cluster create $node_1_ip:16371 $node_2_ip:16372 $node_3_ip:16373 --cluster-replicas 0 --cluster-yes
echo "Waiting for cluster status to be ok..."
timeout 60s sh -c 'until redis-cli -p 16371 -c cluster info | grep cluster_state:ok ; do echo "Waiting for cluster create container to finish..."; sleep 1; done'
2 changes: 1 addition & 1 deletion test/client.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const _ = require('lodash');
const assert = require('chai').assert;
const LimitRedis = require('../lib/client');
const ValidationError = LimitRedis.ValidationError;
const clusterNodes = [{ host: 'localhost', port: 16371 }, { host: 'localhost', port: 16372 }, { host: 'localhost', port: 16373 }];
const clusterNodes = [{ host: '127.0.0.1', port: 16371 }, { host: '127.0.0.1', port: 16372 }, { host: '127.0.0.1', port: 16373 }];

const standaloneClientFn = (params) => {
return new LimitRedis({ uri: 'localhost', buckets: {}, prefix: 'tests:', ..._.omit(params, ['nodes']) });
Expand Down
2 changes: 1 addition & 1 deletion test/db.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const { Toxiproxy, Toxic } = require('toxiproxy-node-client');
const crypto = require('crypto');
const { endOfMonthTimestamp, replicateHashtag } = require('../lib/utils');

const clusterNodes = [{ host: 'localhost', port: 16371 }, { host: 'localhost', port: 16372 }, { host: 'localhost', port: 16373 }];
const clusterNodes = [{ host: '127.0.0.1', port: 16371 }, { host: '127.0.0.1', port: 16372 }, { host: '127.0.0.1', port: 16373 }];

const standaloneClientFn = (params) => {
return new LimitDB({ uri: 'localhost', buckets: {}, prefix: 'tests:', ..._.omit(params, ['nodes']) });
Expand Down

0 comments on commit 2327b57

Please sign in to comment.