From 500c5acb3aaa59fc7b83c631b9e818ad0dea3325 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Fri, 1 Apr 2016 15:40:11 +0200 Subject: [PATCH] Test starting redis without services --- appveyor.yml | 6 +++--- test/helper.js | 2 ++ test/lib/redis-process.js | 13 +++---------- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 1d5c6cdbfd..af918cf2e9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -18,9 +18,9 @@ shallow_clone: true install: # Install the Redis - nuget install redis-64 -excludeversion - - redis-64\tools\redis-server.exe --service-install - - redis-64\tools\redis-server.exe --service-start - - '@ECHO Redis Started' + # - redis-64\tools\redis-server.exe --service-install + # - redis-64\tools\redis-server.exe --service-start + - '@ECHO Redis installed' # Get the latest stable version of Node 0.STABLE.latest - ps: Install-Product node $env:nodejs_version # Typical npm stuff. Use msvs 2013 for the hiredis parser diff --git a/test/helper.js b/test/helper.js index 545724de29..47a3758a25 100644 --- a/test/helper.js +++ b/test/helper.js @@ -16,10 +16,12 @@ function startRedis (conf, done, port) { } before(function (done) { + this.timeout(25000); startRedis('./conf/redis.conf', done); }); after(function (done) { + this.timeout(25000); if (rp) rp.stop(done); }); diff --git a/test/lib/redis-process.js b/test/lib/redis-process.js index cc5b53b01f..bad6a749a0 100644 --- a/test/lib/redis-process.js +++ b/test/lib/redis-process.js @@ -47,16 +47,10 @@ function waitForRedis (available, cb, port) { module.exports = { start: function (done, conf, port) { - var spawnFailed = false; // spawn redis with our testing configuration. var confFile = conf || path.resolve(__dirname, '../conf/redis.conf'); - var rp = 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) spawnFailed = true; - }); + var redis = process.platform === 'win32' ? 'redis-64\\tools\\redis-server.exe' : 'redis-server'; + var rp = spawn.sync(redis, [confFile], { stdio: 'inherit' }); // wait for redis to become available, by // checking the port we bind on. @@ -65,10 +59,9 @@ module.exports = { // an after() block to shutdown redis. return done(null, { spawnFailed: function () { - return spawnFailed; + return false; }, stop: function (done) { - if (spawnFailed) return done(); rp.once('exit', function (code) { var error = null; if (code !== null && code !== 0) {