Properly signal task completion in gulpfiles

This commit is contained in:
murgatroid99 2019-04-24 16:54:03 -07:00
parent df57548805
commit 2ef046e96f
5 changed files with 18 additions and 48 deletions

View File

@ -26,25 +26,17 @@ const healthCheckDir = __dirname;
const baseDir = path.resolve(healthCheckDir, '..', '..');
const testDir = path.resolve(healthCheckDir, 'test');
const cleanLinks = () => {
return del(path.resolve(healthCheckDir, 'node_modules/grpc'));
}
const cleanLinks = () => del(path.resolve(healthCheckDir, 'node_modules/grpc'));
const cleanAll = gulp.parallel(cleanLinks);
const runInstall = () => {
return execa('npm', ['install', '--unsafe-perm'], {cwd: healthCheckDir, stdio: 'inherit'});
};
const runInstall = () => execa('npm', ['install', '--unsafe-perm'], {cwd: healthCheckDir, stdio: 'inherit'});
const install = gulp.series(cleanLinks, runInstall);
const linkAdd = () => {
linkSync(healthCheckDir, './node_modules/grpc', '../grpc-native-core');
};
const linkAdd = () => linkSync(healthCheckDir, './node_modules/grpc', '../grpc-native-core');
const test = () => {
return gulp.src(`${testDir}/*.js`).pipe(mocha({reporter: 'mocha-jenkins-reporter'}));
};
const test = () => gulp.src(`${testDir}/*.js`).pipe(mocha({reporter: 'mocha-jenkins-reporter'}));
export {
cleanLinks,

View File

@ -40,20 +40,14 @@ const execNpmVerb = (verb: string, ...args: string[]) =>
execa('npm', [verb, ...args], {cwd: jsCoreDir, stdio: 'inherit'});
const execNpmCommand = execNpmVerb.bind(null, 'run');
const install = () => {
execNpmVerb('install', '--unsafe-perm');
};
const install = () => execNpmVerb('install', '--unsafe-perm');
/**
* Runs tslint on files in src/, with linting rules defined in tslint.json.
*/
const lint = () => {
execNpmCommand('check');
};
const lint = () => execNpmCommand('check');
const clean = () => {
execNpmCommand('clean');
};
const clean = () => execNpmCommand('clean');
const cleanAll = gulp.parallel(clean);
@ -61,13 +55,9 @@ const cleanAll = gulp.parallel(clean);
* Transpiles TypeScript files in src/ to JavaScript according to the settings
* found in tsconfig.json.
*/
const compile = () => {
execNpmCommand('compile');
}
const compile = () => execNpmCommand('compile');
const copyTestFixtures = () => {
return ncpP(`${jsCoreDir}/test/fixtures`, `${outDir}/test/fixtures`);
}
const copyTestFixtures = () => ncpP(`${jsCoreDir}/test/fixtures`, `${outDir}/test/fixtures`);
const runTests = () => {
if (semver.satisfies(process.version, '^8.11.2 || >=9.4')) {

View File

@ -30,10 +30,8 @@ const testDir = path.resolve(nativeCoreDir, 'test');
const pkg = require('./package');
const jshintConfig = pkg.jshintConfig;
const clean = () => {
return del([path.resolve(nativeCoreDir, 'build'),
path.resolve(nativeCoreDir, 'ext/node')]);
};
const clean = () => del([path.resolve(nativeCoreDir, 'build'),
path.resolve(nativeCoreDir, 'ext/node')]);
const cleanAll = gulp.parallel(clean);
@ -69,8 +67,8 @@ const test = gulp.series(build, runTests);
const docGen = (cb) => {
var config = require('./jsdoc_conf.json');
gulp.src([`${nativeCoreDir}/README.md`, `${nativeCoreDir}/index.js`, `${srcDir}/*.js`], {read: false})
.pipe(jsdoc(config, cb));
return gulp.src([`${nativeCoreDir}/README.md`, `${nativeCoreDir}/index.js`, `${srcDir}/*.js`], {read: false})
.pipe(jsdoc(config, cb));
};
export {

View File

@ -36,22 +36,14 @@ const execNpmVerb = (verb: string, ...args: string[]) =>
execa('npm', [verb, ...args], {cwd: protojsDir, stdio: 'inherit'});
const execNpmCommand = execNpmVerb.bind(null, 'run');
const install = () => {
execNpmVerb('install', '--unsafe-perm');
};
const install = () => execNpmVerb('install', '--unsafe-perm');
/**
* Runs tslint on files in src/, with linting rules defined in tslint.json.
*/
const lint = () => {
execNpmCommand('check');
};
const lint = () => execNpmCommand('check');
const cleanFiles = () => {
execNpmCommand('clean');
};
const clean = gulp.series(install, cleanFiles);
const clean = () => execNpmCommand('clean');
const cleanAll = gulp.parallel(clean);
@ -59,9 +51,7 @@ const cleanAll = gulp.parallel(clean);
* Transpiles TypeScript files in src/ and test/ to JavaScript according to the settings
* found in tsconfig.json.
*/
const compile = () => {
execNpmCommand('compile');
};
const compile = () => execNpmCommand('compile');
/**
* Transpiles src/ and test/, and then runs all tests.

View File

@ -30,7 +30,7 @@ const install = () => {
return execa('npm', ['install'], {cwd: testDir, stdio: 'inherit'});
};
const cleanAll = () => {};
const cleanAll = () => Promise.resolve();
const test = () => {
// run mocha tests matching a glob with a pre-required fixture,