fix(test): start memcached as part of 'npm test' r=@vladikoff

Fixes #228
This commit is contained in:
Deepti 2018-03-20 00:44:31 +05:30 коммит произвёл Vlad Filippov
Родитель be3b5794da
Коммит 475bf23bf8
3 изменённых файлов: 19 добавлений и 15 удалений

Просмотреть файл

@ -14,13 +14,15 @@ Clone the git repository and install dependencies:
cd fxa-customs-server
npm install
You'll also need to [install memcached](http://www.memcached.org/downloads),
otherwise all requests will be blocked.
By default, the customs server tries to connect to memcached
using port `11211` on `127.0.0.1`.
You can specify a different port and IP address
using the `memcache.address` configuration setting
or the `MEMCACHE_ADDRESS` environment variable.
Install memcached
You'll need to [install memcached](http://www.memcached.org/downloads),
otherwise all requests will be blocked.
By default, the customs server tries to connect to memcached
using port `11211` on `127.0.0.1`.
You can specify a different port and IP address
using the `memcache.address` configuration setting
or the `MEMCACHE_ADDRESS` environment variable.
To start the server, run:
@ -40,12 +42,6 @@ Run tests with:
npm test
On Mac OS X, memcached must be manually started for the tests to run.
memcached &
npm test
To run tests via Docker:
```

Просмотреть файл

@ -11,4 +11,13 @@ if test "$NO_COVERAGE" = ""; then
cov="--coverage --cov"
fi
if ! echo stats | nc localhost 11211 | grep -q 'STAT'; then
memcached &
MC=$!
fi
tap test/local test/remote $cov
if [[ $MC ]]; then
kill $MC
fi

Просмотреть файл

@ -10,8 +10,7 @@ P.promisifyAll(Memcached.prototype)
var config = {
memcache: {
host: '127.0.0.1',
port: '11211'
address: '127.0.0.1:11211',
},
limits: {
blockIntervalSeconds: 1,