Updated test
This commit is contained in:
@ -45,7 +45,8 @@ test('Should update the connection pool', t => {
|
|||||||
roles: {
|
roles: {
|
||||||
master: true,
|
master: true,
|
||||||
data: true,
|
data: true,
|
||||||
ingest: true
|
ingest: true,
|
||||||
|
ml: false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
@ -55,7 +56,8 @@ test('Should update the connection pool', t => {
|
|||||||
roles: {
|
roles: {
|
||||||
master: true,
|
master: true,
|
||||||
data: true,
|
data: true,
|
||||||
ingest: true
|
ingest: true,
|
||||||
|
ml: false
|
||||||
},
|
},
|
||||||
ssl: null,
|
ssl: null,
|
||||||
agent: null
|
agent: null
|
||||||
|
|||||||
@ -21,8 +21,7 @@ test('Configure host', t => {
|
|||||||
master: true,
|
master: true,
|
||||||
data: true,
|
data: true,
|
||||||
ingest: true,
|
ingest: true,
|
||||||
coordinating: true,
|
ml: false
|
||||||
machine_learning: true
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
t.end()
|
t.end()
|
||||||
@ -43,8 +42,7 @@ test('Configure host', t => {
|
|||||||
master: true,
|
master: true,
|
||||||
data: true,
|
data: true,
|
||||||
ingest: true,
|
ingest: true,
|
||||||
coordinating: true,
|
ml: false
|
||||||
machine_learning: true
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
t.match(pool.connections.get('http://localhost:9201/'), {
|
t.match(pool.connections.get('http://localhost:9201/'), {
|
||||||
@ -57,8 +55,7 @@ test('Configure host', t => {
|
|||||||
master: true,
|
master: true,
|
||||||
data: true,
|
data: true,
|
||||||
ingest: true,
|
ingest: true,
|
||||||
coordinating: true,
|
ml: false
|
||||||
machine_learning: true
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -72,7 +69,8 @@ test('Configure host', t => {
|
|||||||
id: 'node',
|
id: 'node',
|
||||||
roles: {
|
roles: {
|
||||||
master: true,
|
master: true,
|
||||||
data: false
|
data: false,
|
||||||
|
ingest: false
|
||||||
},
|
},
|
||||||
ssl: 'ssl'
|
ssl: 'ssl'
|
||||||
}
|
}
|
||||||
@ -83,12 +81,16 @@ test('Configure host', t => {
|
|||||||
id: 'node',
|
id: 'node',
|
||||||
ssl: 'ssl',
|
ssl: 'ssl',
|
||||||
deadCount: 0,
|
deadCount: 0,
|
||||||
resurrectTimeout: 0,
|
resurrectTimeout: 0
|
||||||
roles: {
|
|
||||||
master: true,
|
|
||||||
data: false
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
t.deepEqual(pool.connections.get('node').roles, {
|
||||||
|
master: true,
|
||||||
|
data: false,
|
||||||
|
ingest: false,
|
||||||
|
ml: false
|
||||||
|
})
|
||||||
|
|
||||||
t.end()
|
t.end()
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -99,7 +101,8 @@ test('Configure host', t => {
|
|||||||
id: 'node1',
|
id: 'node1',
|
||||||
roles: {
|
roles: {
|
||||||
master: true,
|
master: true,
|
||||||
data: false
|
data: false,
|
||||||
|
ingest: false
|
||||||
},
|
},
|
||||||
ssl: 'ssl'
|
ssl: 'ssl'
|
||||||
}, {
|
}, {
|
||||||
@ -107,7 +110,8 @@ test('Configure host', t => {
|
|||||||
id: 'node2',
|
id: 'node2',
|
||||||
roles: {
|
roles: {
|
||||||
master: false,
|
master: false,
|
||||||
data: true
|
data: true,
|
||||||
|
ingest: false
|
||||||
},
|
},
|
||||||
ssl: 'ssl'
|
ssl: 'ssl'
|
||||||
}]
|
}]
|
||||||
@ -118,23 +122,31 @@ test('Configure host', t => {
|
|||||||
id: 'node1',
|
id: 'node1',
|
||||||
ssl: 'ssl',
|
ssl: 'ssl',
|
||||||
deadCount: 0,
|
deadCount: 0,
|
||||||
resurrectTimeout: 0,
|
resurrectTimeout: 0
|
||||||
roles: {
|
|
||||||
master: true,
|
|
||||||
data: false
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
t.deepEqual(pool.connections.get('node1').roles, {
|
||||||
|
master: true,
|
||||||
|
data: false,
|
||||||
|
ingest: false,
|
||||||
|
ml: false
|
||||||
|
})
|
||||||
|
|
||||||
t.match(pool.connections.get('node2'), {
|
t.match(pool.connections.get('node2'), {
|
||||||
url: new URL('http://localhost:9200'),
|
url: new URL('http://localhost:9200'),
|
||||||
id: 'node2',
|
id: 'node2',
|
||||||
ssl: 'ssl',
|
ssl: 'ssl',
|
||||||
deadCount: 0,
|
deadCount: 0,
|
||||||
resurrectTimeout: 0,
|
resurrectTimeout: 0
|
||||||
roles: {
|
|
||||||
master: false,
|
|
||||||
data: true
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
t.deepEqual(pool.connections.get('node2').roles, {
|
||||||
|
master: false,
|
||||||
|
data: true,
|
||||||
|
ingest: false,
|
||||||
|
ml: false
|
||||||
|
})
|
||||||
|
|
||||||
t.end()
|
t.end()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -296,7 +296,8 @@ test('API', t => {
|
|||||||
roles: {
|
roles: {
|
||||||
master: true,
|
master: true,
|
||||||
data: true,
|
data: true,
|
||||||
ingest: true
|
ingest: true,
|
||||||
|
ml: false
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
url: new URL('http://127.0.0.1:9201'),
|
url: new URL('http://127.0.0.1:9201'),
|
||||||
@ -304,7 +305,8 @@ test('API', t => {
|
|||||||
roles: {
|
roles: {
|
||||||
master: true,
|
master: true,
|
||||||
data: true,
|
data: true,
|
||||||
ingest: true
|
ingest: true,
|
||||||
|
ml: false
|
||||||
}
|
}
|
||||||
}])
|
}])
|
||||||
t.end()
|
t.end()
|
||||||
@ -426,7 +428,8 @@ test('API', t => {
|
|||||||
t.deepEqual(pool.connections.get('a1').roles, {
|
t.deepEqual(pool.connections.get('a1').roles, {
|
||||||
master: true,
|
master: true,
|
||||||
data: true,
|
data: true,
|
||||||
ingest: true
|
ingest: true,
|
||||||
|
ml: false
|
||||||
})
|
})
|
||||||
t.strictEqual(pool.connections.get('http://127.0.0.1:9200/'), undefined)
|
t.strictEqual(pool.connections.get('http://127.0.0.1:9200/'), undefined)
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user