Add Jenkins XML reporting to tests

This commit is contained in:
murgatroid99 2017-09-18 13:19:00 -07:00
parent 818fb3423f
commit 18b756f342
7 changed files with 7 additions and 6 deletions

View File

@ -15,6 +15,7 @@
"express": "^4.15.4", "express": "^4.15.4",
"google-auth-library": "^0.11.0", "google-auth-library": "^0.11.0",
"lodash": "^4.17.4", "lodash": "^4.17.4",
"mocha-jenkins-reporter": "^0.3.9",
"poisson-process": "^0.2.2" "poisson-process": "^0.2.2"
}, },
"devDependencies": { "devDependencies": {

View File

@ -20,5 +20,5 @@ gulp.task('health-check.link.add', 'Link local copy of grpc', ['health-check.ins
gulp.task('health-check.test', 'Run health check tests', gulp.task('health-check.test', 'Run health check tests',
() => { () => {
return gulp.src(`${testDir}/*.js`).pipe(mocha()); return gulp.src(`${testDir}/*.js`).pipe(mocha({reporter: 'mocha-jenkins-reporter'}));
}); });

View File

@ -120,7 +120,7 @@ gulp.task('js.core.test.compile', 'After dep tasks, transpiles test/.', ['js.cor
gulp.task('js.core.test', 'After dep tasks, runs all tests.', gulp.task('js.core.test', 'After dep tasks, runs all tests.',
['js.core.test.compile'], () => { ['js.core.test.compile'], () => {
return gulp.src(`${outDir}/test/**/*.js`) return gulp.src(`${outDir}/test/**/*.js`)
.pipe(mocha()); .pipe(mocha({reporter: 'mocha-jenkins-reporter'}));
} }
); );

View File

@ -36,5 +36,5 @@ gulp.task('native.core.build', 'Build native package', () => {
}); });
gulp.task('native.core.test', 'Run all tests', ['native.core.build'], () => { gulp.task('native.core.test', 'Run all tests', ['native.core.build'], () => {
return gulp.src(`${testDir}/*.js`).pipe(mocha()); return gulp.src(`${testDir}/*.js`).pipe(mocha({reporter: 'mocha-jenkins-reporter'}));
}); });

View File

@ -46,7 +46,6 @@
"istanbul": "^0.4.4", "istanbul": "^0.4.4",
"jsdoc": "^3.3.2", "jsdoc": "^3.3.2",
"minimist": "^1.1.0", "minimist": "^1.1.0",
"mocha-jenkins-reporter": "^0.2.3",
"poisson-process": "^0.2.1" "poisson-process": "^0.2.1"
}, },
"engines": { "engines": {

View File

@ -41,7 +41,8 @@ do
./node_modules/.bin/gulp setup ./node_modules/.bin/gulp setup
# Rebuild libraries and run tests. # Rebuild libraries and run tests.
./node_modules/.bin/gulp native.test || FAILED="true" JUNIT_REPORT_PATH="node$version/" JUNIT_REPORT_STACK=1 ./node_modules/.bin/gulp native.test || FAILED="true"
rename 's/([^\/]+).xml/$1_sponge_log.xml/' "node$version"/*
done done
if [ "$FAILED" != "" ] if [ "$FAILED" != "" ]

View File

@ -15,5 +15,5 @@ gulp.task('internal.test.link.add', 'Link local copies of grpc packages', () =>
}); });
gulp.task('internal.test.test', 'Run API-level tests', () => { gulp.task('internal.test.test', 'Run API-level tests', () => {
return gulp.src(`${apiTestDir}/*.js`).pipe(mocha()); return gulp.src(`${apiTestDir}/*.js`).pipe(mocha({reporter: 'mocha-jenkins-reporter'}));
}); });