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

tweaks based on running test-suite on Windows on an older Redis

This commit is contained in:
Benjamin Coe
2015-09-12 17:53:49 -07:00
parent b4da975785
commit a0bf9e2314
11 changed files with 82 additions and 80 deletions

View File

@@ -24,7 +24,7 @@ describe("client authentication", function () {
});
it("allows auth to be provided with 'auth' method", function (done) {
abortOnSpawnFailure(done);
if (helper.redisProcess().spawnFailed()) this.skip();
client = redis.createClient.apply(redis.createClient, args);
client.auth(auth, function (err, res) {
@@ -35,7 +35,7 @@ describe("client authentication", function () {
});
it("raises error when auth is bad", function (done) {
abortOnSpawnFailure(done);
if (helper.redisProcess().spawnFailed()) this.skip();
client = redis.createClient.apply(redis.createClient, args);
@@ -49,7 +49,7 @@ describe("client authentication", function () {
if (ip === 'IPv4') {
it('allows auth to be provided as part of redis url', function (done) {
abortOnSpawnFailure(done);
if (helper.redisProcess().spawnFailed()) this.skip();
client = redis.createClient('redis://foo:' + auth + '@' + config.HOST[ip] + ':' + config.PORT);
client.on("ready", function () {
@@ -59,7 +59,7 @@ describe("client authentication", function () {
}
it('allows auth to be provided as config option for client', function (done) {
abortOnSpawnFailure(done);
if (helper.redisProcess().spawnFailed()) this.skip();
var args = config.configureClient(parser, ip, {
auth_pass: auth
@@ -71,7 +71,7 @@ describe("client authentication", function () {
});
it('reconnects with appropriate authentication', function (done) {
abortOnSpawnFailure(done);
if (helper.redisProcess().spawnFailed()) this.skip();
var readyCount = 0;
client = redis.createClient.apply(redis.createClient, args);
@@ -93,13 +93,4 @@ describe("client authentication", function () {
helper.startRedis('./conf/redis.conf', done);
});
});
// if we fail to spawn Redis (spawning Redis directly is
// not possible in some CI environments) skip the auth tests.
function abortOnSpawnFailure (done) {
if (helper.redisProcess().spawnFailed()) {
console.warn('skipped authentication test')
return done();
}
}
});