Skip to content

Commit 0cf24ad

Browse files
authored
Merge pull request #220 from kjin/test-grpc-js
test: test grpc-js in ci
2 parents f4b03ba + a07b03a commit 0cf24ad

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"@types/ncp": "^2.0.1",
1717
"@types/node": "^8.0.32",
1818
"@types/pify": "^3.0.0",
19+
"@types/semver": "^5.5.0",
1920
"del": "^3.0.0",
2021
"execa": "^0.8.0",
2122
"gulp": "^3.9.1",
@@ -35,6 +36,7 @@
3536
"mocha-jenkins-reporter": "^0.3.9",
3637
"ncp": "^2.0.0",
3738
"pify": "^3.0.0",
39+
"semver": "^5.5.0",
3840
"through2": "^2.0.3",
3941
"ts-node": "^3.3.0",
4042
"tslint": "^5.5.0",

packages/grpc-js-core/gulpfile.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import * as mocha from 'gulp-mocha';
2323
import * as path from 'path';
2424
import * as execa from 'execa';
2525
import * as pify from 'pify';
26+
import * as semver from 'semver';
2627
import { ncp } from 'ncp';
2728

2829
// gulp-help monkeypatches tasks to have an additional description parameter
@@ -71,6 +72,10 @@ gulp.task('copy-test-fixtures', 'Copy test fixtures.', () => {
7172
* Transpiles src/ and test/, and then runs all tests.
7273
*/
7374
gulp.task('test', 'Runs all tests.', ['copy-test-fixtures'], () => {
74-
return gulp.src(`${outDir}/test/**/*.js`)
75-
.pipe(mocha({reporter: 'mocha-jenkins-reporter'}));
75+
if (semver.satisfies(process.version, '>=9.4')) {
76+
return gulp.src(`${outDir}/test/**/*.js`)
77+
.pipe(mocha({reporter: 'mocha-jenkins-reporter'}));
78+
} else {
79+
console.log(`Skipping grpc-js tests for Node ${process.version}`);
80+
}
7681
});

run-tests.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ for %%v in (4 6 7 8 9) do (
5353

5454
call .\node_modules\.bin\gulp clean.all || SET FAILED=1
5555
call .\node_modules\.bin\gulp setup.windows || SET FAILED=1
56-
call .\node_modules\.bin\gulp native.test || SET FAILED=1
56+
call .\node_modules\.bin\gulp test || SET FAILED=1
5757
)
5858

5959
node merge_kokoro_logs.js

run-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ do
6363
./node_modules/.bin/gulp setup
6464

6565
# Rebuild libraries and run tests.
66-
JUNIT_REPORT_PATH="reports/node$version/" JUNIT_REPORT_STACK=1 ./node_modules/.bin/gulp native.test || FAILED="true"
66+
JUNIT_REPORT_PATH="reports/node$version/" JUNIT_REPORT_STACK=1 ./node_modules/.bin/gulp test || FAILED="true"
6767
done
6868

6969
set +ex

0 commit comments

Comments
 (0)