1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-04 15:02:09 +03:00

some small tweaks to #815, so that we don't use two differnt approaches for spawning redis

This commit is contained in:
Benjamin Coe
2015-09-03 22:51:25 -07:00
parent eb61ce32aa
commit d976bbcb2d
6 changed files with 16 additions and 7 deletions

View File

@@ -8,8 +8,6 @@ addons:
- ubuntu-toolchain-r-test - ubuntu-toolchain-r-test
packages: packages:
- g++-4.8 - g++-4.8
services:
- redis-server
node_js: node_js:
- "0.10" - "0.10"
- "0.12" - "0.12"

View File

@@ -1,5 +1,5 @@
requirepass porkchopsandwiches requirepass porkchopsandwiches
port 6378 port 6379
bind ::1 127.0.0.1 bind ::1 127.0.0.1
unixsocket /tmp/redis.sock unixsocket /tmp/redis.sock
unixsocketperm 755 unixsocketperm 755

View File

@@ -1,4 +1,4 @@
port 6378 port 6379
bind ::1 127.0.0.1 bind ::1 127.0.0.1
unixsocket /tmp/redis.sock unixsocket /tmp/redis.sock
unixsocketperm 755 unixsocketperm 755

View File

@@ -4,7 +4,7 @@ var redis = require('../../index');
var config = { var config = {
redis: redis, redis: redis,
PORT: 6378, PORT: 6379,
HOST: { HOST: {
IPv4: "127.0.0.1", IPv4: "127.0.0.1",
IPv6: "::1" IPv6: "::1"

View File

@@ -11,6 +11,17 @@ module.exports = {
var confFile = conf || path.resolve(__dirname, '../conf/redis.conf'); var confFile = conf || path.resolve(__dirname, '../conf/redis.conf');
var rp = cp.spawn("redis-server", [confFile], {}); var rp = cp.spawn("redis-server", [confFile], {});
// capture a failure booting redis, and give
// the user running the test some directions.
rp.once("exit", function (code) {
if (code !== 0) {
console.error('failed to starting redis with exit code "' + code + '" ' +
'stop any other redis processes currently running (' +
'hint: lsof -i :6379)');
process.exit(code)
}
})
// wait for redis to become available, by // wait for redis to become available, by
// checking the port we bind on. // checking the port we bind on.
waitForRedis(true, function () { waitForRedis(true, function () {

View File

@@ -50,7 +50,7 @@ describe("The node_redis client", function () {
}); });
}); });
it("connects correctly with defaults values", function (done) { it("connects correctly with default values", function (done) {
client = redis.createClient(); client = redis.createClient();
client.on("error", done); client.on("error", done);
@@ -74,7 +74,7 @@ describe("The node_redis client", function () {
}); });
}); });
it("throws on strange connection infos", function () { it("throws on strange connection info", function () {
try { try {
redis.createClient(true); redis.createClient(true);
throw new Error('failed'); throw new Error('failed');