added snapshot paths to the esvm config

This commit is contained in:
Spencer Alger
2015-07-02 13:03:53 -07:00
parent f52a59acc6
commit c1f584cd3e
5 changed files with 56 additions and 60 deletions

1
.gitignore vendored
View File

@ -7,6 +7,7 @@ test/integration/yaml_suite/log
.aws-config.json
.idea
.esvm
.es-snapshot-repos
## generated files
test/integration/yaml_suite/yaml_tests*.json

View File

@ -1,67 +1,58 @@
var utils = require('../utils');
var _ = require('lodash');
var join = require('path').join;
var fromRoot = require('path').join.bind(null, __dirname, '..', '..');
var Version = require('../../scripts/Version');
var defaultOpts = {
directory: join(__dirname, '..', '..', '.esvm'),
nodes: 1,
quiet: false,
config: {
'node.name': 'elasticsearch_js_test_runner',
'cluster.name': 'elasticsearch_js_test_runners',
'http.port': 9400,
'network.host': 'localhost',
'discovery.zen.ping_timeout': 1,
'discovery.zen.ping.multicast.enabled': false
}
};
/**
* set config vars based on the ref.
*
* @param {string} ref - either a tag or branch name
* @param {[type]} target - the grunt target to configure
*/
function setConfig(ref, target) {
var v = Version.fromBranch(String(ref).replace(/^v/, '').replace(/(\d+\.\d+)\..+/, '$1'));
var config = target.options.config = (target.options.config || {});
if (v.satisfies('^1.2')) {
_.merge(config, {
var opts = [
{
version: '*',
directory: fromRoot('.esvm'),
nodes: 1,
quiet: false,
config: {
'node.name': 'elasticsearch_js_test_runner',
'cluster.name': 'elasticsearch_js_test_runners',
'http.port': 9400,
'network.host': 'localhost',
'discovery.zen.ping.multicast.enabled': false
}
},
{
version: '<1.6',
config: {
'discovery.zen.ping_timeout': 1
}
},
{
version: '^1.2 <1.6',
config: {
'node.bench': true,
'script.disable_dynamic': false
});
}
if (v.satisfies('>=1.6')) {
_.merge(config, {
}
},
{
version: '>=1.6',
config: {
'node.bench': true,
'script.inline': true,
'script.indexed': true
});
}
},
{
version: '>=2.0',
config: {
'path.repo': process.env.ES_PATH_REPO || fromRoot('.es-snapshot-repos')
}
}
_.defaultsDeep(target.options, defaultOpts);
if (v.satisfies('>=1.6')) {
delete config['discovery.zen.ping_timeout'];
}
if (target.options.branch && !target.options.version) {
target.options.fresh = true;
}
}
];
// targets for each branch
utils.branches.forEach(function (branch) {
exports[branch] = {
options: {
branch: branch
}
options: Version.fromBranch(branch).mergeOpts(opts, {
branch: branch,
fresh: true
})
};
setConfig(branch, exports[branch]);
});
@ -71,23 +62,27 @@ utils.branches.forEach(function (branch) {
var ref = process.env.ES_REF;
var port = process.env.ES_PORT;
var options = {
var v;
var defaults = {
config: {
'http.port': port || 9200
}
};
if (release) {
options.version = release;
v = new Version(String(release).replace(/^v/, ''));
defaults.version = v.version;
}
else if (ref) {
// assume it is a ref to a branch
options.branch = ref;
v = new Version.fromBranch(String(ref).replace(/v?(\d+\.\d+)\..+/, '$1'));
defaults.branch = ref;
defaults.fresh = true;
}
else {
return;
}
exports.ci_env = { options: options };
setConfig(ref, exports.ci_env);
exports.ci_env = {
options: v.mergeOpts(opts, defaults)
};
}());

View File

@ -9,7 +9,7 @@ var utils = {
branchSuffix: function (branch) {
return branch === utils.branches._default ? '' : '_' + _.snakeCase(branch);
},
branches: [].concat(stable, unstable),
branches: [].concat(unstable, stable),
stableBranches: stable,
unstableBranches: unstable
};

View File

@ -55,7 +55,7 @@
"grunt-contrib-uglify": "~0.2.7",
"grunt-contrib-watch": "~0.5.3",
"grunt-esvm": "^1.1.0",
"grunt-mocha-cov": "~0.2.0",
"grunt-mocha-cov": "^0.4.0",
"grunt-open": "~0.2.2",
"grunt-prompt": "~0.1.2",
"grunt-run": "~0.2.2",
@ -79,7 +79,7 @@
"through2-map": "~1.4.0",
"xmlbuilder": "~0.4.3"
},
"license": "Apache 2.0",
"license": "Apache-2.0",
"dependencies": {
"bluebird": "^2.9.14",
"chalk": "^1.0.0",

View File

@ -64,4 +64,4 @@ install_node "$NODE_V"
npm install
release_lock
ES_PORT=$((9400 + EXECUTOR_NUMBER)) RUN=NODE_UNIT,NODE_INTEGRATION VERBOSE=true node ./scripts/ci.js
ES_PATH_REPO="./.es-snapshot-repos/$EXECUTOR_NUMBER/" ES_PORT=$((9400 + EXECUTOR_NUMBER)) RUN=NODE_UNIT,NODE_INTEGRATION VERBOSE=true node ./scripts/ci.js