fix(test): start memcached as part of 'npm test' r=@vladikoff
Fixes #228
This commit is contained in:
Родитель
be3b5794da
Коммит
475bf23bf8
22
README.md
22
README.md
|
@ -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,
|
||||
|
|
Загрузка…
Ссылка в новой задаче