1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-09 00:22:08 +03:00

Merge pull request #1496 from NodeRedis/@salakar/travis-windows

fix: windows CI
This commit is contained in:
Mike Diarmid
2020-02-09 14:42:29 +00:00
committed by GitHub
4 changed files with 41 additions and 60 deletions

View File

@@ -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

View File

@@ -12,7 +12,6 @@
<a href="https://www.npmjs.com/package/redis"><img src="https://img.shields.io/npm/dm/redis.svg?style=flat-square" alt="NPM downloads"></a>
<a href="https://www.npmjs.com/package/redis"><img src="https://img.shields.io/npm/v/redis.svg?style=flat-square" alt="NPM version"></a>
<a href="https://travis-ci.org/NodeRedis/node-redis"><img src="https://travis-ci.org/NodeRedis/node-redis.svg?style=flat-square&branch=master" alt="Build Status" /></a>
<a href="https://ci.appveyor.com/project/BridgeAR/node-redis/branch/master"><img src="https://img.shields.io/appveyor/ci/BridgeAR/node-redis/master.svg?style=flat-square&label=Windows%20Tests" alt="Windows Tests" /></a>
<a href="https://coveralls.io/r/NodeRedis/node-redis?branch="><img src="https://coveralls.io/repos/NodeRedis/node-redis/badge.svg?style=flat-square&branch=" alt="Coverage Status" /></a>
<a href="https://twitter.com/NodeRedis"><img src="https://img.shields.io/twitter/follow/NodeRedis.svg?style=flat-square&colorA=1da1f2&colorB=&label=Follow%20on%20Twitter" alt="Follow on Twitter"></a>
</p>

View File

@@ -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}"

View File

@@ -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 () {