chore(ci): upload test report to CircleCI and Azure (#5802)

This commit is contained in:
Xin Du (Clark) 2019-05-25 15:17:21 +01:00 committed by Pooya Parsa
parent 5ae03d0d4b
commit 80ba740e63
6 changed files with 45 additions and 3 deletions

View File

@ -105,6 +105,10 @@ jobs:
- run: - run:
name: Build Fixtures name: Build Fixtures
command: yarn test:fixtures -i --coverage && yarn coverage -F fixtures command: yarn test:fixtures -i --coverage && yarn coverage -F fixtures
environment:
JEST_JUNIT_OUTPUT_NAME: fixtures.xml
- store_test_results:
path: reports/junit
- persist_to_workspace: - persist_to_workspace:
root: ~/project root: ~/project
paths: paths:
@ -132,6 +136,10 @@ jobs:
- run: - run:
name: Unit Tests name: Unit Tests
command: yarn test:unit -w=2 --coverage && yarn coverage -F unit command: yarn test:unit -w=2 --coverage && yarn coverage -F unit
environment:
JEST_JUNIT_OUTPUT_NAME: unit.xml
- store_test_results:
path: reports/junit
test-e2e: test-e2e:
<<: *defaults <<: *defaults
@ -151,6 +159,10 @@ jobs:
- run: - run:
name: E2E Tests name: E2E Tests
command: CHROME_PATH=/bin/chromium yarn test:e2e && yarn coverage -F e2e command: CHROME_PATH=/bin/chromium yarn test:e2e && yarn coverage -F e2e
environment:
JEST_JUNIT_OUTPUT_NAME: e2e.xml
- store_test_results:
path: reports/junit
test-types: test-types:
<<: *defaults <<: *defaults

3
.gitignore vendored
View File

@ -23,6 +23,9 @@ distributions/*/LICENSE
# Dist folders # Dist folders
dist dist
# Junit reports
reports
# Coverage reports # Coverage reports
coverage coverage
*.lcov *.lcov

View File

@ -20,9 +20,15 @@ steps:
displayName: 'Install dependencies' displayName: 'Install dependencies'
- script: | - script: |
set NODE_OPTIONS=--max_old_space_size=4096 && yarn test:fixtures -i set JEST_JUNIT_OUTPUT_NAME=fixtures.xml && set NODE_OPTIONS=--max_old_space_size=4096 && yarn test:fixtures -i
displayName: 'Test: Build Fixtures' displayName: 'Test: Build Fixtures'
- script: | - script: |
set NODE_OPTIONS=--max_old_space_size=4096 && yarn test:unit -w=2 set JEST_JUNIT_OUTPUT_NAME=unit.xml && set NODE_OPTIONS=--max_old_space_size=4096 && yarn test:unit -w=2
displayName: 'Test: Run unit tests' displayName: 'Test: Run unit tests'
- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: 'reports/junit/*'
displayName: 'Publish test results to Azure Pipelines'

View File

@ -43,5 +43,10 @@ module.exports = {
'ts', 'ts',
'js', 'js',
'json' 'json'
],
reporters: [
'default',
['jest-junit', { outputDirectory: 'reports/junit' }]
] ]
} }

View File

@ -62,6 +62,7 @@
"glob": "^7.1.4", "glob": "^7.1.4",
"is-wsl": "^2.0.0", "is-wsl": "^2.0.0",
"jest": "^24.8.0", "jest": "^24.8.0",
"jest-junit": "^6.4.0",
"jsdom": "^15.1.0", "jsdom": "^15.1.0",
"klaw-sync": "^6.0.0", "klaw-sync": "^6.0.0",
"lerna": "^3.14.1", "lerna": "^3.14.1",

View File

@ -6407,6 +6407,16 @@ jest-jasmine2@^24.8.0:
pretty-format "^24.8.0" pretty-format "^24.8.0"
throat "^4.0.0" throat "^4.0.0"
jest-junit@^6.4.0:
version "6.4.0"
resolved "https://registry.npmjs.org/jest-junit/-/jest-junit-6.4.0.tgz#23e15c979fa6338afde46f2d2ac2a6b7e8cf0d9e"
integrity sha512-GXEZA5WBeUich94BARoEUccJumhCgCerg7mXDFLxWwI2P7wL3Z7sGWk+53x343YdBLjiMR9aD/gYMVKO+0pE4Q==
dependencies:
jest-validate "^24.0.0"
mkdirp "^0.5.1"
strip-ansi "^4.0.0"
xml "^1.0.1"
jest-leak-detector@^24.8.0: jest-leak-detector@^24.8.0:
version "24.8.0" version "24.8.0"
resolved "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-24.8.0.tgz#c0086384e1f650c2d8348095df769f29b48e6980" resolved "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-24.8.0.tgz#c0086384e1f650c2d8348095df769f29b48e6980"
@ -6570,7 +6580,7 @@ jest-util@^24.8.0:
slash "^2.0.0" slash "^2.0.0"
source-map "^0.6.0" source-map "^0.6.0"
jest-validate@^24.8.0: jest-validate@^24.0.0, jest-validate@^24.8.0:
version "24.8.0" version "24.8.0"
resolved "https://registry.npmjs.org/jest-validate/-/jest-validate-24.8.0.tgz#624c41533e6dfe356ffadc6e2423a35c2d3b4849" resolved "https://registry.npmjs.org/jest-validate/-/jest-validate-24.8.0.tgz#624c41533e6dfe356ffadc6e2423a35c2d3b4849"
integrity sha512-+/N7VOEMW1Vzsrk3UWBDYTExTPwf68tavEPKDnJzrC6UlHtUDU/fuEdXqFoHzv9XnQ+zW6X3qMZhJ3YexfeLDA== integrity sha512-+/N7VOEMW1Vzsrk3UWBDYTExTPwf68tavEPKDnJzrC6UlHtUDU/fuEdXqFoHzv9XnQ+zW6X3qMZhJ3YexfeLDA==
@ -11652,6 +11662,11 @@ xml-name-validator@^3.0.0:
resolved "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" resolved "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a"
integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==
xml@^1.0.1:
version "1.0.1"
resolved "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz#78ba72020029c5bc87b8a81a3cfcd74b4a2fc1e5"
integrity sha1-eLpyAgApxbyHuKgaPPzXS0ovweU=
xmlchars@^1.3.1: xmlchars@^1.3.1:
version "1.3.1" version "1.3.1"
resolved "https://registry.npmjs.org/xmlchars/-/xmlchars-1.3.1.tgz#1dda035f833dbb4f86a0c28eaa6ca769214793cf" resolved "https://registry.npmjs.org/xmlchars/-/xmlchars-1.3.1.tgz#1dda035f833dbb4f86a0c28eaa6ca769214793cf"