Skip to content

Commit

Permalink
test: enable ci for node 9
Browse files Browse the repository at this point in the history
  • Loading branch information
kjin committed Apr 10, 2018
1 parent 5b0f7b1 commit d13f4f2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
9 changes: 7 additions & 2 deletions packages/grpc-js-core/gulpfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}`);
}
});
2 changes: 1 addition & 1 deletion run-tests.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d13f4f2

Please sign in to comment.