Skip to content

Commit

Permalink
Test reports are not being published to Azure Pipelines (#2302)
Browse files Browse the repository at this point in the history
  • Loading branch information
vagisha-nidhi authored and devongovett committed Nov 21, 2018
1 parent 25b64d9 commit 52e3644
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 4 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# in the same file

packages/*/*/test/integration/**
packages/*/*/test/mochareporters.json

# Generated by the build
lib
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ packages/core/parcel-bundler/src/builtins
packages/core/parcel-bundler/test/integration
packages/core/parcel-bundler/test/input
packages/core/parcel-bundler/test/dist
packages/core/parcel-bundler/test/mochareporters.json
tmp
11 changes: 11 additions & 0 deletions azure-pipelines-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,14 @@ jobs:
displayName: 'Run tests'
- script: yarn lint
displayName: 'Lint'
- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFiles: '**/junit-*.xml'
testRunTitle: TestRun ${{ parameters.name }} $(node_version)
- task: PublishCodeCoverageResults@1
displayName: 'Publish code coverage results'
inputs:
codeCoverageTool: 'cobertura'
summaryFileLocation: '**/coverage/cobertura-coverage.xml'
reportDirectory: '**/parcel-bundler/coverage'
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ jobs:

- template: azure-pipelines-template.yml
parameters:
name: Windows
vmImage: vs2017-win2016
name: Windows
vmImage: vs2017-win2016
6 changes: 4 additions & 2 deletions packages/core/parcel-bundler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@
"less": "^3.0.1",
"lint-staged": "^7.1.2",
"mocha": "^5.1.1",
"mocha-junit-reporter": "^1.18.0",
"mocha-multi-reporters": "^1.1.7",
"ncp": "^2.0.0",
"nib": "^1.1.2",
"node-elm-compiler": "^5.0.1",
Expand All @@ -119,9 +121,9 @@
"vue-template-compiler": "^2.5.16"
},
"scripts": {
"test": "cross-env NODE_ENV=test mocha",
"test": "cross-env NODE_ENV=test mocha --reporter mocha-multi-reporters --reporter-options configFile=./test/mochareporters.json",
"test-coverage": "rm -rf coverage/* && nyc yarn test",
"report-coverage": "nyc report --reporter=lcov && codecov",
"report-coverage": "nyc report --reporter=lcov --reporter=cobertura --reporter=html && codecov",
"test-ci": "yarn test-coverage && yarn report-coverage",
"format": "prettier --write \"./{src,bin,test}/**/*.{js,json,md}\"",
"build": "yarn minify && babel src -d lib && ncp src/builtins lib/builtins",
Expand Down
6 changes: 6 additions & 0 deletions packages/core/parcel-bundler/test/mochareporters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"reporterEnabled": "mocha-junit-reporter",
"mochaJunitReporterReporterOptions": {
"mochaFile": "junit-testresults.xml"
}
}

0 comments on commit 52e3644

Please sign in to comment.