Support setting elasticsearch bind host for tests
This commit is contained in:
@ -23,7 +23,7 @@ var client = null;
|
||||
var externalExists;
|
||||
|
||||
module.exports = {
|
||||
create: function create(apiVersion, port, cb) {
|
||||
create: function create(apiVersion, port, host, cb) {
|
||||
// create a client and ping the server for up to 15 seconds
|
||||
doCreateClient({
|
||||
logConfig: null
|
||||
@ -40,7 +40,7 @@ module.exports = {
|
||||
setTimeout(ping, timeout);
|
||||
} else if (err) {
|
||||
cb(new Error('unable to establish contact with ES at ' + JSON.stringify({
|
||||
host: 'localhost',
|
||||
host: host,
|
||||
port: port,
|
||||
err: err
|
||||
})));
|
||||
@ -92,7 +92,7 @@ module.exports = {
|
||||
apiVersion: apiVersion,
|
||||
hosts: [
|
||||
{
|
||||
host: 'localhost',
|
||||
host: host,
|
||||
port: port
|
||||
}
|
||||
],
|
||||
|
||||
@ -10,6 +10,7 @@ module.exports = function (branch) {
|
||||
var clientManager = require('./client_manager');
|
||||
|
||||
var port = parseInt(process.env.ES_PORT || 9200, 10);
|
||||
var host = process.env.ES_HOST || 'localhost';
|
||||
var _release = branch.match(/^v(\d+\.\d+)\.\d+$/);
|
||||
var apiVersion = _release ? _release[1] : branch;
|
||||
|
||||
@ -23,7 +24,7 @@ module.exports = function (branch) {
|
||||
// before running any tests...
|
||||
before(function (done) {
|
||||
this.timeout(5 * 60 * 1000);
|
||||
clientManager.create(apiVersion, port, done);
|
||||
clientManager.create(apiVersion, port, host, done);
|
||||
});
|
||||
|
||||
before(function () {
|
||||
|
||||
Reference in New Issue
Block a user