Skip to content

Commit

Permalink
Generate and publish coverage report to pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyriar committed Oct 31, 2019
1 parent 79f3a73 commit a450bd5
Show file tree
Hide file tree
Showing 4 changed files with 530 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ node_modules/
lib/
out/
out-test/
.nyc_output/
Makefile.gyp
*.Makefile
*.target.gyp.mk
Expand Down
17 changes: 17 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,23 @@ jobs:
displayName: 'Unit tests'
- script: yarn lint
displayName: 'Lint'
- script: |
NODE_PATH=$(pwd)/out ./node_modules/.bin/nyc ./node_modules/.bin/mocha './out/*test.js' './out/**/*test.js'
./node_modules/.bin/nyc report --reporter=cobertura
displayName: 'Coverage report'
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/*coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/coverage'
displayName: 'Publish coverage'
- task: mspremier.BuildQualityChecks.QualityChecks-task.BuildQualityChecks@6
displayName: 'Check build quality'
inputs:
checkCoverage: true
coverageType: branches
coverageThreshold: 55
coverageFailOption: fixed

- job: macOS
pool:
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"jsdom": "^11.11.0",
"mocha": "^6.1.4",
"node-pty": "0.7.6",
"nyc": "13",
"puppeteer": "^1.15.0",
"source-map-loader": "^0.2.4",
"ts-loader": "^6.0.4",
Expand Down
Loading

0 comments on commit a450bd5

Please sign in to comment.