Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Add task to upload code coverage report files (#50)
Browse files Browse the repository at this point in the history
* Add separate step to upload CC report files

* Add reference to vsts-task-lib

* Add reference to path
  • Loading branch information
Jeff Young committed Sep 15, 2016
1 parent 98db9f6 commit 7396ffe
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -3,3 +3,4 @@ out/
*.vsix
team-extension.log
*.zip
.taskkey
10 changes: 10 additions & 0 deletions gulpfile.js
Expand Up @@ -8,6 +8,8 @@ var tslint = require('gulp-tslint');
var del = require('del');
var argv = require('yargs').argv;
var istanbul = require('gulp-istanbul');
var tl = require('vsts-task-lib');
var path = require('path');

// Default to list reporter when run directly.
// CI build can pass 'reporter=junit' to create JUnit results files
Expand Down Expand Up @@ -104,6 +106,14 @@ gulp.task('test-coverage', function() {
.on('error', errorHandler);
});

//The following task is used by the CI build to upload code coverage files
//Added due to race condition between writeReports and ccPublisher.publish
//It's OK for this to fail if the coverage file doesn't exist
gulp.task('upload-coverage-file', function() {
var ccPublisher = new tl.CodeCoveragePublisher();
ccPublisher.publish('cobertura', path.join(__dirname, 'out/results/coverage/cobertura-coverage.xml'), path.join(__dirname, 'out/results/coverage'), "");
});

gulp.task('test-all', ['test', 'test-integration'], function() { });

gulp.task('packageonly', function (cb) {
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -131,6 +131,7 @@
"tslint": "^2.5.0",
"typescript": "^1.7.5",
"vscode": "^0.11.x",
"vsts-task-lib": "^0.9.18",
"yargs": "^5.0.0"
},
"dependencies": {
Expand Down

0 comments on commit 7396ffe

Please sign in to comment.