Skip to content

Commit d976bbc

Browse files
author
Benjamin Coe
committed
some small tweaks to #815, so that we don't use two differnt approaches for spawning redis
1 parent eb61ce3 commit d976bbc

File tree

6 files changed

+16
-7
lines changed

6 files changed

+16
-7
lines changed

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ addons:
88
- ubuntu-toolchain-r-test
99
packages:
1010
- g++-4.8
11-
services:
12-
- redis-server
1311
node_js:
1412
- "0.10"
1513
- "0.12"

test/conf/password.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
requirepass porkchopsandwiches
2-
port 6378
2+
port 6379
33
bind ::1 127.0.0.1
44
unixsocket /tmp/redis.sock
55
unixsocketperm 755

test/conf/redis.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
port 6378
1+
port 6379
22
bind ::1 127.0.0.1
33
unixsocket /tmp/redis.sock
44
unixsocketperm 755

test/lib/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var redis = require('../../index');
44

55
var config = {
66
redis: redis,
7-
PORT: 6378,
7+
PORT: 6379,
88
HOST: {
99
IPv4: "127.0.0.1",
1010
IPv6: "::1"

test/lib/redis-process.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ module.exports = {
1111
var confFile = conf || path.resolve(__dirname, '../conf/redis.conf');
1212
var rp = cp.spawn("redis-server", [confFile], {});
1313

14+
// capture a failure booting redis, and give
15+
// the user running the test some directions.
16+
rp.once("exit", function (code) {
17+
if (code !== 0) {
18+
console.error('failed to starting redis with exit code "' + code + '" ' +
19+
'stop any other redis processes currently running (' +
20+
'hint: lsof -i :6379)');
21+
process.exit(code)
22+
}
23+
})
24+
1425
// wait for redis to become available, by
1526
// checking the port we bind on.
1627
waitForRedis(true, function () {

test/node_redis.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ describe("The node_redis client", function () {
5050
});
5151
});
5252

53-
it("connects correctly with defaults values", function (done) {
53+
it("connects correctly with default values", function (done) {
5454
client = redis.createClient();
5555
client.on("error", done);
5656

@@ -74,7 +74,7 @@ describe("The node_redis client", function () {
7474
});
7575
});
7676

77-
it("throws on strange connection infos", function () {
77+
it("throws on strange connection info", function () {
7878
try {
7979
redis.createClient(true);
8080
throw new Error('failed');

0 commit comments

Comments
 (0)