stopped using an empty suffix for test/branch stuff, so that things are less confusing down the road when versions change

This commit is contained in:
Spencer Alger
2014-02-05 09:46:53 -07:00
parent 4680930487
commit 70b51dfa6d
13 changed files with 15 additions and 19 deletions

1
.gitignore vendored
View File

@ -8,6 +8,7 @@ test/integration/yaml_suite/log
## generated files
test/integration/yaml_suite/yaml_tests*.json
test/integration/yaml_suite/index*.js
src/elasticsearch*/
junit-*.xml
elasticsearch*.log

View File

@ -1,5 +1,7 @@
var root = require('find-root')(__dirname);
var utils = require(root + '/grunt/utils');
var rootReq = function (p) { return require(require('path').resolve(root, p)); };
var utils = rootReq('grunt/utils');
var _ = rootReq('src/lib/utils');
var config = {
unit: {
@ -29,7 +31,7 @@ var config = {
utils.branches.forEach(function (branch) {
config['integration_' + branch] = {
src: 'test/integration/yaml_suite/index' + utils.branchSuffix(branch) + '.js'
src: 'test/integration/yaml_suite/index' + _.snakeCase(branch) + '.js'
};
});

View File

@ -31,7 +31,7 @@ var config = {
},
clone_bower_repo: {
exec: [
'test -d src/elasticsearch',
'test -d src/bower_es_js',
'git clone git@github.com:elasticsearch/bower-elasticsearch-js.git src/bower_es_js'
].join(' || '),
options: {

View File

@ -57,7 +57,6 @@ function manage_es {
local ES_RELEASE=$3
local ROOT="$PWD"
local ES_SUBMODULE="$ROOT/src/elasticsearch"
local SNAPSHOTS="$ROOT/.snapshots"
local PIDS="$ROOT/.snapshots/pids"

View File

@ -30,6 +30,7 @@ var path = require('path');
var root = require('find-root')(__dirname);
var fromRoot = path.join.bind(path, root);
var utils = require(fromRoot('grunt/utils'));
var _ = require(fromRoot('src/lib/utils'));
var esUrl = 'https://github.com/elasticsearch/elasticsearch.git';
var branches;
@ -55,7 +56,7 @@ function isDirectory(dir) {
}
function storeDir(branch) {
return fromRoot('src/elasticsearch' + utils.branchSuffix(branch));
return fromRoot('src/elasticsearch_' + _.snakeCase(branch));
}
function spawnStep(cmd, args, cwd) {

View File

@ -18,7 +18,7 @@ module.exports = function (branch, done) {
var docVars; // slightly modified clone of apiSpec for the docs
var branchSuffix = utils.branchSuffix(branch);
var esDir = fromRoot('src/elasticsearch' + branchSuffix);
var esDir = fromRoot('src/elasticsearch_' + _.snakeCase(branch));
var aliases;
try {
aliases = require('./aliases_' + _.snakeCase(branch));

View File

@ -8,11 +8,10 @@ module.exports = function (branch, done) {
var chalk = require('chalk');
var path = require('path');
var fromRoot = path.join.bind(path, require('find-root')(__dirname));
var utils = require(fromRoot('grunt/utils'));
var _ = require(fromRoot('src/lib/utils'));
var tests = {}; // populated in readYamlTests
var branchSuffix = utils.branchSuffix(branch);
var esDir = fromRoot('src/elasticsearch' + branchSuffix);
var esDir = fromRoot('src/elasticsearch_' + _.snakeCase(branch));
// generate the yaml tests
async.series([
@ -44,14 +43,14 @@ module.exports = function (branch, done) {
}
function writeYamlTests(done) {
var testFile = fromRoot('test/integration/yaml_suite/yaml_tests' + branchSuffix + '.json');
fs.writeFileSync(testFile, JSON.stringify(tests, null, ' '), 'utf8');
var testFile = fromRoot('test/integration/yaml_suite/yaml_tests_' + _.snakeCase(branch) + '.json');
fs.writeFileSync(testFile, JSON.stringify(tests, null, ' '), 'utf8');
console.log(chalk.white.bold('wrote') + ' YAML tests as JSON to', testFile);
done();
}
function writeTestIndex(done) {
var file = fromRoot('test/integration/yaml_suite/index' + branchSuffix + '.js');
var file = fromRoot('test/integration/yaml_suite/index_' + _.snakeCase(branch) + '.js');
fs.writeFileSync(file, 'require(\'./run\')(\'' + branch + '\');', 'utf8');
console.log(chalk.white.bold('wrote') + ' YAML index to', file);
done();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -10,7 +10,6 @@ module.exports = function (branch) {
var es = rootReq('src/elasticsearch');
var clientManager = require('./client_manager');
var argv = require('./argv');
var branchSuffix = utils.branchSuffix(branch);
describe('integration', function () {
this.timeout(30000);
@ -30,7 +29,7 @@ module.exports = function (branch) {
}, done);
});
var files = _.map(require('./yaml_tests' + branchSuffix + '.json'), function (docs, filename) {
var files = _.map(require('./yaml_tests_' + _.snakeCase(branch) + '.json'), function (docs, filename) {
return new YamlFile(filename, docs);
});