From 33363e6a07472704207baba41175e9f8ca68c247 Mon Sep 17 00:00:00 2001 From: Salakar Date: Sun, 9 Feb 2020 13:11:47 +0000 Subject: [PATCH 01/10] chore: configure travis for windows builds --- .travis.yml | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7ff40c58a51..473d6218276 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,10 @@ language: node_js sudo: required +os: + - windows + - linux + env: - CXX=g++-4.8 TRAVIS=true @@ -11,6 +15,7 @@ addons: packages: - g++-4.8 + node_js: - "6" - "8" @@ -18,13 +23,30 @@ node_js: - "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 + C:\ProgramData\chocolatey\lib\redis-64\tools\redis-server.exe --service-install + C:\ProgramData\chocolatey\lib\redis-64\tools\redis-server.exe --service-start + '@ECHO Redis Started' + node --version + npm --version + ;; + esac cache: directories: + - $HOME/AppData/Local/Temp/chocolatey - "$TRAVIS_BUILD_DIR/stunnel-5.54" after_success: npm run coveralls From 853a837df8bcf221b0d867995379ebc8ba7aefa1 Mon Sep 17 00:00:00 2001 From: Salakar Date: Sun, 9 Feb 2020 13:18:22 +0000 Subject: [PATCH 02/10] chore: add node 10 to builds and wrap windows paths in quotes --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 473d6218276..a2b2941edb3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,6 +19,7 @@ addons: node_js: - "6" - "8" + - "10" - "12" - "13" @@ -36,9 +37,8 @@ before_install: case $TRAVIS_OS_NAME in windows) choco install redis-64 - C:\ProgramData\chocolatey\lib\redis-64\tools\redis-server.exe --service-install - C:\ProgramData\chocolatey\lib\redis-64\tools\redis-server.exe --service-start - '@ECHO Redis Started' + "C:\ProgramData\chocolatey\lib\redis-64\tools\redis-server.exe" --service-install + "C:\ProgramData\chocolatey\lib\redis-64\tools\redis-server.exe" --service-start node --version npm --version ;; From cb5d163ccfa2602d87a81ac14743af87f57b4b13 Mon Sep 17 00:00:00 2001 From: Salakar Date: Sun, 9 Feb 2020 13:26:26 +0000 Subject: [PATCH 03/10] chore: remove g++ - no longer required --- .travis.yml | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index a2b2941edb3..ffe8c897f38 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,17 +5,6 @@ os: - windows - linux -env: - - CXX=g++-4.8 TRAVIS=true - -addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-4.8 - - node_js: - "6" - "8" @@ -37,16 +26,14 @@ before_install: case $TRAVIS_OS_NAME in windows) choco install redis-64 - "C:\ProgramData\chocolatey\lib\redis-64\tools\redis-server.exe" --service-install - "C:\ProgramData\chocolatey\lib\redis-64\tools\redis-server.exe" --service-start - node --version - npm --version + redis-server --service-install + redis-server --service-start ;; esac cache: directories: - - $HOME/AppData/Local/Temp/chocolatey + - "$HOME/AppData/Local/Temp/chocolatey" - "$TRAVIS_BUILD_DIR/stunnel-5.54" after_success: npm run coveralls From 377db618d2fc88d917ed8f470cfefeea3f0c2eae Mon Sep 17 00:00:00 2001 From: Salakar Date: Sun, 9 Feb 2020 13:33:12 +0000 Subject: [PATCH 04/10] chore: remove appveyor --- appveyor.yml | 45 --------------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 appveyor.yml 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}" From 46246bea06f620f71e6680ec0b80293c0a702589 Mon Sep 17 00:00:00 2001 From: Salakar Date: Sun, 9 Feb 2020 13:33:47 +0000 Subject: [PATCH 05/10] chore: disable `stop-writes-on-bgsave-error` on windows (otherwise MISCONF error) --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index ffe8c897f38..0f30c603431 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,6 +28,7 @@ before_install: choco install redis-64 redis-server --service-install redis-server --service-start + redis-cli config set stop-writes-on-bgsave-error no ;; esac From a6af0c28893f3ed154537a1ff37fdf64db104e92 Mon Sep 17 00:00:00 2001 From: Salakar Date: Sun, 9 Feb 2020 13:48:58 +0000 Subject: [PATCH 06/10] chore: update travis config --- .travis.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0f30c603431..80bd615b415 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,12 @@ language: node_js sudo: required os: - - windows - linux + - windows + +# fix travis windows hanging issue +# https://travis-ci.community/t/build-doesnt-finish-after-completing-tests/288/25 +env: YARN_GPG=no node_js: - "6" @@ -34,7 +38,6 @@ before_install: cache: directories: - - "$HOME/AppData/Local/Temp/chocolatey" - "$TRAVIS_BUILD_DIR/stunnel-5.54" after_success: npm run coveralls From a7149e39f18e5d7346d442541dcc497402d96705 Mon Sep 17 00:00:00 2001 From: Salakar Date: Sun, 9 Feb 2020 13:58:19 +0000 Subject: [PATCH 07/10] chore: update travis config --- .travis.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 80bd615b415..1263695a867 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,12 +2,8 @@ language: node_js sudo: required os: - - linux - windows - -# fix travis windows hanging issue -# https://travis-ci.community/t/build-doesnt-finish-after-completing-tests/288/25 -env: YARN_GPG=no + - linux node_js: - "6" @@ -40,10 +36,18 @@ cache: directories: - "$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_script: + - |- + case $TRAVIS_OS_NAME in + windows) + redis-server --service-stop + ;; + esac + +after_success: npm run coveralls From 9f01198c0491e419ed50902fd196df324d8abcee Mon Sep 17 00:00:00 2001 From: Salakar Date: Sun, 9 Feb 2020 14:13:05 +0000 Subject: [PATCH 08/10] chore: try workaround travis windows hanging issue --- .travis.yml | 8 +------- test/node_redis.spec.js | 8 ++++++++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1263695a867..18e3dbdeac3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,6 +34,7 @@ before_install: cache: directories: + - "$HOME/AppData/Local/Temp/chocolatey" - "$TRAVIS_BUILD_DIR/stunnel-5.54" before_script: @@ -42,12 +43,5 @@ before_script: - if [ "${TRAVIS_OS_NAME}" == "linux" ]; then sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6'; fi -after_script: - - |- - case $TRAVIS_OS_NAME in - windows) - redis-server --service-stop - ;; - esac after_success: npm run coveralls diff --git a/test/node_redis.spec.js b/test/node_redis.spec.js index 79f58dd5187..83a44f074dc 100644 --- a/test/node_redis.spec.js +++ b/test/node_redis.spec.js @@ -11,6 +11,14 @@ var fork = require('child_process').fork; var redis = config.redis; var client; +after(function (done) { + if (process.platform !== 'win32' || !process.env.CI) { + return done(); + } + require('cross-spawn').sync('redis-server', ['--service-stop'], {}); + done(); +}); + describe('The node_redis client', function () { describe("The 'add_command' method", function () { From 176bfc210122d0e9d3165e82239f938827f6ea15 Mon Sep 17 00:00:00 2001 From: Salakar Date: Sun, 9 Feb 2020 14:23:47 +0000 Subject: [PATCH 09/10] tests: add comments about travis windows issue workaround --- test/node_redis.spec.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/test/node_redis.spec.js b/test/node_redis.spec.js index 83a44f074dc..8937a270c96 100644 --- a/test/node_redis.spec.js +++ b/test/node_redis.spec.js @@ -11,12 +11,20 @@ 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(); } - require('cross-spawn').sync('redis-server', ['--service-stop'], {}); - done(); + process.nextTick(function () { + require('cross-spawn').sync('redis-server', ['--service-stop'], {}); + done(); + }); }); describe('The node_redis client', function () { From 4623cec3c406f6caa0e7aaa6229e46d5d5138281 Mon Sep 17 00:00:00 2001 From: Salakar Date: Sun, 9 Feb 2020 14:35:37 +0000 Subject: [PATCH 10/10] docs: update readme to remove unused badge --- README.md | 1 - 1 file changed, 1 deletion(-) 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