You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
Windows fixes
Skip redis process spawn on windows for now
This commit is contained in:
@@ -5,6 +5,11 @@ var config = require("./lib/config");
|
||||
var helper = require('./helper');
|
||||
var redis = config.redis;
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
// TODO: Fix redis process spawn on windows
|
||||
return;
|
||||
}
|
||||
|
||||
describe("client authentication", function () {
|
||||
before(function (done) {
|
||||
helper.stopRedis(function () {
|
||||
@@ -237,6 +242,7 @@ describe("client authentication", function () {
|
||||
});
|
||||
|
||||
after(function (done) {
|
||||
if (helper.redisProcess().spawnFailed()) return done();
|
||||
helper.stopRedis(function () {
|
||||
helper.startRedis('./conf/redis.conf', done);
|
||||
});
|
||||
|
@@ -8,6 +8,11 @@ var rp;
|
||||
var path = require('path');
|
||||
var redis = config.redis;
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
// TODO: Fix redis process spawn on windows
|
||||
return;
|
||||
}
|
||||
|
||||
describe('master slave sync', function () {
|
||||
var master = null;
|
||||
var slave = null;
|
||||
@@ -19,6 +24,7 @@ describe('master slave sync', function () {
|
||||
});
|
||||
|
||||
before(function (done) {
|
||||
if (helper.redisProcess().spawnFailed()) return done();
|
||||
master = redis.createClient({
|
||||
password: 'porkchopsandwiches'
|
||||
});
|
||||
@@ -78,6 +84,7 @@ describe('master slave sync', function () {
|
||||
});
|
||||
|
||||
after(function (done) {
|
||||
if (helper.redisProcess().spawnFailed()) return done();
|
||||
var end = helper.callFuncAfter(done, 3);
|
||||
rp.stop(end);
|
||||
slave.end(true);
|
||||
|
@@ -257,8 +257,10 @@ describe("connection tests", function () {
|
||||
client.once('ready', done);
|
||||
});
|
||||
|
||||
if (process.platform !== 'win32') {
|
||||
it("connect with path provided in the options object", function (done) {
|
||||
if (process.platform === 'win32') {
|
||||
this.skip();
|
||||
}
|
||||
client = redis.createClient({
|
||||
path: '/tmp/redis.sock',
|
||||
parser: parser,
|
||||
@@ -270,7 +272,6 @@ describe("connection tests", function () {
|
||||
client.once('ready', end);
|
||||
client.set('foo', 'bar', end);
|
||||
});
|
||||
}
|
||||
|
||||
it("connects correctly with args", function (done) {
|
||||
client = redis.createClient.apply(redis.createClient, args);
|
||||
|
@@ -15,21 +15,6 @@ function startRedis (conf, done, port) {
|
||||
}, path.resolve(__dirname, conf), port);
|
||||
}
|
||||
|
||||
function startStunnel(done) {
|
||||
StunnelProcess.start(function (err, _stunnel_process) {
|
||||
stunnel_process = _stunnel_process;
|
||||
return done(err);
|
||||
}, path.resolve(__dirname, './conf'));
|
||||
}
|
||||
|
||||
function stopStunnel(done) {
|
||||
if (stunnel_process) {
|
||||
StunnelProcess.stop(stunnel_process, done);
|
||||
} else {
|
||||
done();
|
||||
}
|
||||
}
|
||||
|
||||
// don't start redis every time we
|
||||
// include this helper file!
|
||||
if (!process.env.REDIS_TESTS_STARTED) {
|
||||
@@ -52,8 +37,19 @@ module.exports = {
|
||||
rp.stop(done);
|
||||
},
|
||||
startRedis: startRedis,
|
||||
stopStunnel: stopStunnel,
|
||||
startStunnel: startStunnel,
|
||||
stopStunnel: function (done) {
|
||||
if (stunnel_process) {
|
||||
StunnelProcess.stop(stunnel_process, done);
|
||||
} else {
|
||||
done();
|
||||
}
|
||||
},
|
||||
startStunnel: function (done) {
|
||||
StunnelProcess.start(function (err, _stunnel_process) {
|
||||
stunnel_process = _stunnel_process;
|
||||
return done(err);
|
||||
}, path.resolve(__dirname, './conf'));
|
||||
},
|
||||
isNumber: function (expected, done) {
|
||||
return function (err, results) {
|
||||
assert.strictEqual(null, err, "expected " + expected + ", got error: " + err);
|
||||
|
@@ -73,7 +73,7 @@ describe("The 'multi' method", function () {
|
||||
describe('pipeline limit', function () {
|
||||
|
||||
it('do not exceed maximum string size', function (done) {
|
||||
this.timeout(12000); // Windows tests on 0.10 are slow
|
||||
this.timeout(25000); // Windows tests are horribly slow
|
||||
// Triggers a RangeError: Invalid string length if not handled properly
|
||||
client = redis.createClient();
|
||||
var multi = client.multi();
|
||||
|
@@ -5,6 +5,11 @@ var config = require("./lib/config");
|
||||
var helper = require('./helper');
|
||||
var redis = config.redis;
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
// TODO: Fix redis process spawn on windows
|
||||
return;
|
||||
}
|
||||
|
||||
describe("rename commands", function () {
|
||||
before(function (done) {
|
||||
helper.stopRedis(function () {
|
||||
@@ -18,6 +23,7 @@ describe("rename commands", function () {
|
||||
var client = null;
|
||||
|
||||
beforeEach(function(done) {
|
||||
if (helper.redisProcess().spawnFailed()) return done();
|
||||
client = redis.createClient({
|
||||
rename_commands: {
|
||||
set: '807081f5afa96845a02816a28b7258c3',
|
||||
@@ -32,6 +38,7 @@ describe("rename commands", function () {
|
||||
});
|
||||
|
||||
afterEach(function () {
|
||||
if (helper.redisProcess().spawnFailed()) return;
|
||||
client.end(true);
|
||||
});
|
||||
|
||||
@@ -132,6 +139,7 @@ describe("rename commands", function () {
|
||||
});
|
||||
|
||||
after(function (done) {
|
||||
if (helper.redisProcess().spawnFailed()) return done();
|
||||
helper.stopRedis(function () {
|
||||
helper.startRedis('./conf/redis.conf', done);
|
||||
});
|
||||
|
@@ -32,26 +32,21 @@ describe("TLS connection tests", function () {
|
||||
skip = true;
|
||||
console.warn('\nTravis does not support stunnel right now. Skipping tests.\nCheck: https://github.com/travis-ci/apt-package-whitelist/issues/403\n');
|
||||
}
|
||||
if (skip) {
|
||||
done();
|
||||
return;
|
||||
}
|
||||
if (skip) return done();
|
||||
helper.stopStunnel(function () {
|
||||
helper.startStunnel(done);
|
||||
});
|
||||
});
|
||||
|
||||
after(function (done) {
|
||||
if (skip) {
|
||||
done();
|
||||
return;
|
||||
}
|
||||
if (skip) return done();
|
||||
helper.stopStunnel(done);
|
||||
});
|
||||
|
||||
var client;
|
||||
|
||||
afterEach(function () {
|
||||
if (skip) return;
|
||||
client.end(true);
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user