Updated travis configuration (#894)
* Updated travis configuration * Run license checker only in Linux * Fixed script * Fix windows test
This commit is contained in:
committed by
delvedor
parent
4466461828
commit
5a304ce5db
11
.travis.yml
11
.travis.yml
@ -1,7 +1,3 @@
|
|||||||
dist: trusty
|
|
||||||
|
|
||||||
sudo: required
|
|
||||||
|
|
||||||
language: node_js
|
language: node_js
|
||||||
|
|
||||||
node_js:
|
node_js:
|
||||||
@ -9,11 +5,16 @@ node_js:
|
|||||||
- "10"
|
- "10"
|
||||||
- "8"
|
- "8"
|
||||||
|
|
||||||
|
os:
|
||||||
|
- windows
|
||||||
|
- linux
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- npm install
|
- npm install
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- npm run license-checker && npm run test
|
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then npm run license-checker; fi
|
||||||
|
- npm run test
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email:
|
email:
|
||||||
|
|||||||
@ -98,10 +98,9 @@ test('Resurrect a node and handle 502/3/4 status code', t => {
|
|||||||
|
|
||||||
var count = 0
|
var count = 0
|
||||||
function handler (req, res) {
|
function handler (req, res) {
|
||||||
res.statusCode = count < 2 ? 502 : 200
|
res.statusCode = count++ < 2 ? 502 : 200
|
||||||
res.setHeader('content-type', 'application/json')
|
res.setHeader('content-type', 'application/json')
|
||||||
res.end(JSON.stringify({ hello: 'world' }))
|
res.end(JSON.stringify({ hello: 'world' }))
|
||||||
count++
|
|
||||||
}
|
}
|
||||||
|
|
||||||
buildCluster({ handler, numberOfNodes: 2 }, ({ nodes, shutdown }) => {
|
buildCluster({ handler, numberOfNodes: 2 }, ({ nodes, shutdown }) => {
|
||||||
@ -123,7 +122,7 @@ test('Resurrect a node and handle 502/3/4 status code', t => {
|
|||||||
t.strictEqual(meta.connection.id, 'node0')
|
t.strictEqual(meta.connection.id, 'node0')
|
||||||
t.strictEqual(meta.name, 'elasticsearch-js')
|
t.strictEqual(meta.name, 'elasticsearch-js')
|
||||||
t.deepEqual(meta.request, { id: idCount++ })
|
t.deepEqual(meta.request, { id: idCount++ })
|
||||||
if (count < 3) {
|
if (count < 4) {
|
||||||
t.false(meta.isAlive)
|
t.false(meta.isAlive)
|
||||||
} else {
|
} else {
|
||||||
t.true(meta.isAlive)
|
t.true(meta.isAlive)
|
||||||
|
|||||||
Reference in New Issue
Block a user