diff --git a/package.json b/package.json index 5310e7f5c..fb6262141 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/packages/grpc-js-core/gulpfile.ts b/packages/grpc-js-core/gulpfile.ts index d309f6886..fcce74cd5 100644 --- a/packages/grpc-js-core/gulpfile.ts +++ b/packages/grpc-js-core/gulpfile.ts @@ -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}`); + } }); diff --git a/run-tests.bat b/run-tests.bat index 5aeaa700c..5c91eda15 100644 --- a/run-tests.bat +++ b/run-tests.bat @@ -51,7 +51,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 diff --git a/run-tests.sh b/run-tests.sh index bfc0ff71d..300a25274 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -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