Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: test grpc-js in ci #220

Merged
merged 1 commit into from
May 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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