Updated ES, brought a few modification to the API along with it. Yaml test suite is now built against a specific version of elasticsearch when you specify the es_branch arg

to `grunt test`
This commit is contained in:
Spencer Alger
2014-01-07 10:00:07 -07:00
parent 71a0b8f58e
commit bbbfcfa33e
6 changed files with 347 additions and 21 deletions

View File

@ -19,6 +19,11 @@ var argv = require('optimist')
tests: {
default: true,
boolean: true
},
es_version: {
default: 'master',
string: true,
alias: 'b'
}
});
@ -35,23 +40,46 @@ if (!argv.force && process.env.FORCE || process.env.FORCE_GEN) {
}
function updateSubmodules(done) {
cp.exec('git submodule update --init && git submodule foreach git pull origin master',
function (err, stdout, stderr) {
stdout = stdout.trim();
stderr = stderr.trim();
var branch = argv.es_version;
// branch can be prefixed with = or suffixed with _nightly
if (branch.indexOf) {
['='].forEach(function removePrefix(pref) {
if (branch.indexOf(pref) === 0) {
branch = branch.substring(pref.length);
}
});
if (err) {
done(new Error('Unable to update submodules: ' + err.message));
return;
} else if (argv.verbose && stdout) {
console.log(stdout);
}
['_nightly'].forEach(function removeSuffix(suf) {
if (branch.indexOf(suf) === branch.length - suf.length) {
branch = branch.substr(0, branch.length - suf.length);
}
});
}
if (stderr) {
console.error(stderr);
var stdio = [
'ignore',
argv.verbose ? process.stdout : 'ignore',
process.stderr
];
async.series([
function (done) {
// init submodules
cp.spawn('git', ['submodule', 'update', '--init'], {
stdio: stdio
}).on('exit', function (status) {
done(status ? new Error('Unable to init submodules.') : void 0);
});
},
function (done) {
// checkout branch and clean it
cp.spawn('git', ['submodule', 'foreach', 'git checkout --detach origin/' + branch + ' && git clean -f'], {
stdio: stdio
}).on('exit', function (status) {
done(status ? new Error('Unable to init submodules.') : void 0);
});
}
done();
});
], done);
}
updateSubmodules(function (err) {

View File

@ -1,7 +1,8 @@
#!/bin/bash
# generate the latest version of the yaml-tests
node scripts/generate/ --no-api 2>&1 > /dev/null
node scripts/generate/ --no-api --es_version="=$ES_V"
export VERBOSE="true"