remove packages to get npm audit to pass (#11)
* remove packages to get `npm audit` to pass * fix grunt.config.init() call lost in split up * remove integration tests, they don't work and nobody is running them * fix upload_to_s3 task after refactor
This commit is contained in:
@ -12,10 +12,6 @@ var argv = require('optimist').options({
|
||||
default: true,
|
||||
boolean: true,
|
||||
},
|
||||
tests: {
|
||||
default: true,
|
||||
boolean: true,
|
||||
},
|
||||
update: {
|
||||
default: true,
|
||||
boolean: true,
|
||||
@ -262,10 +258,7 @@ function createArchive(branch) {
|
||||
function generateStep(branch) {
|
||||
return function(done) {
|
||||
async.parallel(
|
||||
[
|
||||
argv.api && async.apply(require('./js_api'), branch),
|
||||
argv.tests && async.apply(require('./yaml_tests'), branch),
|
||||
].filter(Boolean),
|
||||
[argv.api && async.apply(require('./js_api'), branch)].filter(Boolean),
|
||||
done
|
||||
);
|
||||
};
|
||||
|
||||
@ -1,60 +0,0 @@
|
||||
module.exports = function(branch, done) {
|
||||
/**
|
||||
* Creates a JSON version of the YAML test suite that can be simply bundled for use in the browser.
|
||||
*/
|
||||
var jsYaml = require('js-yaml');
|
||||
var fs = require('fs');
|
||||
var async = require('async');
|
||||
var chalk = require('chalk');
|
||||
var path = require('path');
|
||||
var fromRoot = path.join.bind(path, require('find-root')(__dirname));
|
||||
var utils = require(fromRoot('src/lib/utils'));
|
||||
var tests = {}; // populated in readYamlTests
|
||||
|
||||
var esDir = fromRoot('src/_elasticsearch_' + utils.snakeCase(branch));
|
||||
|
||||
// generate the yaml tests
|
||||
async.series([readYamlTests, writeYamlTests, writeTestIndex], done);
|
||||
|
||||
function readYamlTests(done) {
|
||||
var testDir = path.join(esDir, 'rest-api-spec/test/');
|
||||
|
||||
function readDirectories(dir) {
|
||||
fs.readdirSync(dir).forEach(function(filename) {
|
||||
var filePath = path.join(dir, filename);
|
||||
var stat = fs.statSync(filePath);
|
||||
if (stat.isDirectory()) {
|
||||
readDirectories(filePath);
|
||||
} else if (filename.match(/\.yaml$/)) {
|
||||
var file = (tests[path.relative(testDir, filePath)] = []);
|
||||
jsYaml.loadAll(fs.readFileSync(filePath, 'utf8'), function(doc) {
|
||||
file.push(doc);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
readDirectories(testDir);
|
||||
done();
|
||||
}
|
||||
|
||||
function writeYamlTests(done) {
|
||||
var testFile = fromRoot(
|
||||
'test/integration/yaml_suite/yaml_tests_' +
|
||||
utils.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_' + utils.snakeCase(branch) + '.js'
|
||||
);
|
||||
fs.writeFileSync(file, "require('./run')('" + branch + "');\n", 'utf8');
|
||||
console.log(chalk.white.bold('wrote') + ' YAML index to', file);
|
||||
done();
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user