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 .aws-config.json
.idea .idea
.esvm .esvm
.es-snapshot-repos
## generated files ## generated files
test/integration/yaml_suite/yaml_tests*.json test/integration/yaml_suite/yaml_tests*.json

View File

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

View File

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

View File

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

View File

@ -64,4 +64,4 @@ install_node "$NODE_V"
npm install npm install
release_lock 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