support running integration tests against a specific version

This commit is contained in:
Spencer Alger
2015-01-10 13:50:59 -07:00
parent f76246aad0
commit b182141d07
2 changed files with 11 additions and 3 deletions

View File

@ -23,7 +23,7 @@ var client = null;
var externalExists; var externalExists;
module.exports = { module.exports = {
create: function create(branch, cb) { create: function create(apiVersion, cb) {
// create a client and ping the server for up to 15 seconds // create a client and ping the server for up to 15 seconds
doCreateClient({ doCreateClient({
logConfig: null logConfig: null
@ -89,7 +89,7 @@ module.exports = {
} }
client = new es.Client({ client = new es.Client({
apiVersion: branch, apiVersion: apiVersion,
hosts: [ hosts: [
{ {
host: argv.host, host: argv.host,

View File

@ -17,7 +17,15 @@ module.exports = function (branch) {
before(function (done) { before(function (done) {
// start our personal ES Server // start our personal ES Server
this.timeout(5 * 60 * 1000); this.timeout(5 * 60 * 1000);
clientManager.create(branch, done);
var apiVersion = branch;
var match;
if (match = apiVersion.match(/^v(\d+\.\d+)\.\d+$/)) {
apiVersion = match[1];
}
console.log('testing branch', branch, 'against api version', apiVersion);
clientManager.create(apiVersion, done);
}); });
before(function (done) { before(function (done) {