diff --git a/test/conf/password.win32.conf b/test/conf/password.win32.conf new file mode 100644 index 0000000000..a8a9e83469 --- /dev/null +++ b/test/conf/password.win32.conf @@ -0,0 +1,3 @@ +requirepass porkchopsandwiches +port 6379 +bind ::1 127.0.0.1 diff --git a/test/conf/redis.win32.conf b/test/conf/redis.win32.conf new file mode 100644 index 0000000000..4806418b7d --- /dev/null +++ b/test/conf/redis.win32.conf @@ -0,0 +1,2 @@ +port 6379 +bind ::1 127.0.0.1 diff --git a/test/conf/rename.win32.conf b/test/conf/rename.win32.conf new file mode 100644 index 0000000000..ae7275a230 --- /dev/null +++ b/test/conf/rename.win32.conf @@ -0,0 +1,5 @@ +port 6379 +bind ::1 127.0.0.1 +rename-command SET 807081f5afa96845a02816a28b7258c3 +rename-command GET f397808a43ceca3963e22b4e13deb672 +rename-command GETRANGE 9e3102b15cf231c4e9e940f284744fe0 diff --git a/test/conf/slave.win32.conf b/test/conf/slave.win32.conf new file mode 100644 index 0000000000..6ed5fd8285 --- /dev/null +++ b/test/conf/slave.win32.conf @@ -0,0 +1,4 @@ +port 6381 +bind ::1 127.0.0.1 +slaveof localhost 6379 +masterauth porkchopsandwiches diff --git a/test/lib/redis-process.js b/test/lib/redis-process.js index bad6a749a0..b4787d628e 100644 --- a/test/lib/redis-process.js +++ b/test/lib/redis-process.js @@ -49,31 +49,29 @@ module.exports = { start: function (done, conf, port) { // spawn redis with our testing configuration. var confFile = conf || path.resolve(__dirname, '../conf/redis.conf'); - var redis = process.platform === 'win32' ? 'redis-64\\tools\\redis-server.exe' : 'redis-server'; + var redis = 'redis-server'; + if (process.platform === 'win32') { + confFile = confFile.replace('.conf', '.win32.conf'); + redis = 'redis-64\\tools\\redis-server.exe'; + } var rp = spawn.sync(redis, [confFile], { stdio: 'inherit' }); - // wait for redis to become available, by - // checking the port we bind on. - waitForRedis(true, function () { - // return an object that can be used in - // an after() block to shutdown redis. - return done(null, { - spawnFailed: function () { - return false; - }, - stop: function (done) { - rp.once('exit', function (code) { - var error = null; - if (code !== null && code !== 0) { - error = new Error('Redis shutdown failed with code ' + code); - } - waitForRedis(false, function () { - return done(error); - }, port); - }); - rp.kill('SIGTERM'); - } - }); - }, port); + done(null, { + spawnFailed: function () { + return false; // Remove if as soon as it's not necessary anymore + }, + stop: function (done) { + rp.once('exit', function (code) { + var error = null; + if (code !== null && code !== 0) { + error = new Error('Redis shutdown failed with code ' + code); + } + waitForRedis(false, function () { + return done(error); + }, port); + }); + rp.kill('SIGTERM'); + } + }); } };