Added API generation and Yaml testing for 1.x and 1.0 branches of elasticsearch.

This commit is contained in:
Spencer Alger
2014-02-05 08:18:19 -07:00
parent 5ff4b6f855
commit 6c5838fbfa
31 changed files with 20144 additions and 2035 deletions

View File

@ -1 +1 @@
require('./run')('master');
require('./run')('0.90');

View File

@ -0,0 +1 @@
require('./run')('1.0');

View File

@ -0,0 +1 @@
require('./run')('1.x');

View File

@ -0,0 +1 @@
require('./run')('master');

View File

@ -3,11 +3,14 @@ module.exports = function (branch) {
var async = require('async');
var jsYaml = require('js-yaml');
var YamlFile = require('./yaml_file');
var _ = require('../../../src/lib/utils');
var es = require('../../../src/elasticsearch');
var root = require('find-root')(__dirname);
var rootReq = function (loc) { return require(path.join(root, loc)); };
var _ = rootReq('src/lib/utils');
var utils = rootReq('grunt/utils');
var es = rootReq('src/elasticsearch');
var clientManager = require('./client_manager');
var argv = require('./argv');
var branchSuffix = branch === 'master' ? '' : '_' + _.snakeCase(branch);
var branchSuffix = utils.branchSuffix(branch);
describe('integration', function () {
this.timeout(30000);

View File

@ -1,7 +1,11 @@
describe('Client instances creation', function () {
var es = require('../../../src/elasticsearch');
var api = require('../../../src/lib/api');
var api090 = require('../../../src/lib/api_0_90');
var path = require('path');
var fromRoot = path.join.bind(path, require('find-root')(__dirname));
var rootRequire = function (path) {
return require(fromRoot(path));
};
var es = rootRequire('src/elasticsearch');
var apis = rootRequire('src/lib/apis');
var expect = require('expect.js');
var client;
@ -21,8 +25,8 @@ describe('Client instances creation', function () {
});
it('inherits the 0.90 API by default', function () {
expect(client.bulk).to.eql(api090.bulk);
expect(client.cluster.nodeStats).to.eql(api090.cluster.prototype.nodeStats);
expect(client.bulk).to.eql(apis['0.90'].bulk);
expect(client.cluster.nodeStats).to.eql(apis['0.90'].cluster.prototype.nodeStats);
});
it('inherits the master API when specified', function () {
@ -30,8 +34,8 @@ describe('Client instances creation', function () {
client = es.Client({
apiVersion: 'master'
});
expect(client.bulk).to.eql(api.bulk);
expect(client.nodes.stats).to.eql(api.nodes.prototype.stats);
expect(client.bulk).to.eql(apis.master.bulk);
expect(client.nodes.stats).to.eql(apis.master.nodes.prototype.stats);
});
it('closing the client causes it\'s transport to be closed', function () {