Merge pull request #220 from kjin/test-grpc-js

test: test grpc-js in ci
This commit is contained in:
Michael Lumish 2018-05-09 10:36:09 -07:00 committed by GitHub
commit 0cf24ad004
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 4 deletions

View File

@ -16,6 +16,7 @@
"@types/ncp": "^2.0.1",
"@types/node": "^8.0.32",
"@types/pify": "^3.0.0",
"@types/semver": "^5.5.0",
"del": "^3.0.0",
"execa": "^0.8.0",
"gulp": "^3.9.1",
@ -35,6 +36,7 @@
"mocha-jenkins-reporter": "^0.3.9",
"ncp": "^2.0.0",
"pify": "^3.0.0",
"semver": "^5.5.0",
"through2": "^2.0.3",
"ts-node": "^3.3.0",
"tslint": "^5.5.0",

View File

@ -23,6 +23,7 @@ import * as mocha from 'gulp-mocha';
import * as path from 'path';
import * as execa from 'execa';
import * as pify from 'pify';
import * as semver from 'semver';
import { ncp } from 'ncp';
// gulp-help monkeypatches tasks to have an additional description parameter
@ -71,6 +72,10 @@ gulp.task('copy-test-fixtures', 'Copy test fixtures.', () => {
* Transpiles src/ and test/, and then runs all tests.
*/
gulp.task('test', 'Runs all tests.', ['copy-test-fixtures'], () => {
return gulp.src(`${outDir}/test/**/*.js`)
.pipe(mocha({reporter: 'mocha-jenkins-reporter'}));
if (semver.satisfies(process.version, '>=9.4')) {
return gulp.src(`${outDir}/test/**/*.js`)
.pipe(mocha({reporter: 'mocha-jenkins-reporter'}));
} else {
console.log(`Skipping grpc-js tests for Node ${process.version}`);
}
});

View File

@ -53,7 +53,7 @@ for %%v in (4 6 7 8 9) do (
call .\node_modules\.bin\gulp clean.all || SET FAILED=1
call .\node_modules\.bin\gulp setup.windows || SET FAILED=1
call .\node_modules\.bin\gulp native.test || SET FAILED=1
call .\node_modules\.bin\gulp test || SET FAILED=1
)
node merge_kokoro_logs.js

View File

@ -63,7 +63,7 @@ do
./node_modules/.bin/gulp setup
# Rebuild libraries and run tests.
JUNIT_REPORT_PATH="reports/node$version/" JUNIT_REPORT_STACK=1 ./node_modules/.bin/gulp native.test || FAILED="true"
JUNIT_REPORT_PATH="reports/node$version/" JUNIT_REPORT_STACK=1 ./node_modules/.bin/gulp test || FAILED="true"
done
set +ex