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:
Spencer
2019-07-10 07:22:27 -07:00
committed by GitHub
parent 7c1573fb07
commit 58a29395e2
36 changed files with 151 additions and 2509 deletions

View File

@ -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
);
};

View File

@ -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();
}
};