diff --git a/.travis.yml b/.travis.yml index 7ff40c58a51..18e3dbdeac3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,36 +1,47 @@ language: node_js sudo: required -env: - - CXX=g++-4.8 TRAVIS=true - -addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-4.8 +os: + - windows + - linux node_js: - "6" - "8" + - "10" - "12" - "13" before_install: - - if [[ ! -f stunnel.tar.gz ]]; then wget -O stunnel.tar.gz ftp://ftp.stunnel.org/stunnel/archive/5.x/stunnel-5.54.tar.gz; fi - - if [[ ! -f ./stunnel-5.54/configure ]]; then tar -xzf stunnel.tar.gz; fi - - if [[ ! -f ./stunnel-5.54/src/stunnel ]]; then cd ./stunnel-5.54; ./configure; make; cd ..; fi - - export PATH="$PATH:$(pwd)/stunnel-5.54/src" + - |- + case $TRAVIS_OS_NAME in + linux) + if [[ ! -f stunnel.tar.gz ]]; then wget -O stunnel.tar.gz ftp://ftp.stunnel.org/stunnel/archive/5.x/stunnel-5.54.tar.gz; fi + if [[ ! -f ./stunnel-5.54/configure ]]; then tar -xzf stunnel.tar.gz; fi + if [[ ! -f ./stunnel-5.54/src/stunnel ]]; then cd ./stunnel-5.54; ./configure; make; cd ..; fi + export PATH="$PATH:$(pwd)/stunnel-5.54/src" + ;; + esac + - |- + case $TRAVIS_OS_NAME in + windows) + choco install redis-64 + redis-server --service-install + redis-server --service-start + redis-cli config set stop-writes-on-bgsave-error no + ;; + esac cache: directories: + - "$HOME/AppData/Local/Temp/chocolatey" - "$TRAVIS_BUILD_DIR/stunnel-5.54" -after_success: npm run coveralls before_script: # Add an IPv6 config - see the corresponding Travis issue # https://github.com/travis-ci/travis-ci/issues/8361 - if [ "${TRAVIS_OS_NAME}" == "linux" ]; then sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6'; fi + +after_success: npm run coveralls diff --git a/README.md b/README.md index 0167d5dbd0e..7ee8b29eb88 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,6 @@ NPM downloads NPM version Build Status - Windows Tests Coverage Status Follow on Twitter

diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index a67e581b333..00000000000 --- a/appveyor.yml +++ /dev/null @@ -1,45 +0,0 @@ -# http://www.appveyor.com/docs/appveyor-yml - -# Test against these versions of Node.js. -environment: - matrix: - - nodejs_version: "6" - - nodejs_version: "8" - - nodejs_version: "10" -# - nodejs_version: "12" -# - nodejs_version: "13" - -pull_requests: - do_not_increment_build_number: true - -platform: Any CPU -shallow_clone: true - -# Install scripts. (runs after repo cloning) -install: - # Install 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' - # Get the required Node version - - ps: Install-Product node $env:nodejs_version - # Typical npm stuff - - npm install - -# Post-install test scripts. -test_script: - # Output useful info for debugging. - - node --version - - npm --version - - cmd: npm t - -os: - - Default Azure - - Windows Server 2012 R2 - -# Don't actually build using MSBuild -build: off - -# Set build version format here instead of in the admin panel. -version: "{build}" diff --git a/test/node_redis.spec.js b/test/node_redis.spec.js index 79f58dd5187..8937a270c96 100644 --- a/test/node_redis.spec.js +++ b/test/node_redis.spec.js @@ -11,6 +11,22 @@ var fork = require('child_process').fork; var redis = config.redis; var client; +// Currently Travis Windows builds hang after completing if any processes are still running, +// we shutdown redis-server after all tests complete (can't do this in a +// `after_script` Travis hook as it hangs before the `after` life cycles) +// to workaround the issue. +// +// See: https://github.com/travis-ci/travis-ci/issues/8082 +after(function (done) { + if (process.platform !== 'win32' || !process.env.CI) { + return done(); + } + process.nextTick(function () { + require('cross-spawn').sync('redis-server', ['--service-stop'], {}); + done(); + }); +}); + describe('The node_redis client', function () { describe("The 'add_command' method", function () {