Browse Source

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

greenkeeper-update-all
Benjamin Coe 9 years ago
parent
commit
d976bbcb2d
  1. 2
      .travis.yml
  2. 2
      test/conf/password.conf
  3. 2
      test/conf/redis.conf
  4. 2
      test/lib/config.js
  5. 11
      test/lib/redis-process.js
  6. 4
      test/node_redis.spec.js

2
.travis.yml

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

2
test/conf/password.conf

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

2
test/conf/redis.conf

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

2
test/lib/config.js

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

11
test/lib/redis-process.js

@ -11,6 +11,17 @@ module.exports = {
var confFile = conf || path.resolve(__dirname, '../conf/redis.conf');
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
// checking the port we bind on.
waitForRedis(true, function () {

4
test/node_redis.spec.js

@ -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.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 {
redis.createClient(true);
throw new Error('failed');

Loading…
Cancel
Save