From 3ec2579d09ad3790630d77f9cd519d6bad238363 Mon Sep 17 00:00:00 2001 From: Kayla Ngan Date: Wed, 31 Oct 2018 14:39:50 -0400 Subject: [PATCH] chore(ci, azure): report test results on azure pipelines (#4242) --- azure-pipelines.yml | 10 ++++++++-- jest.config.js | 5 +++++ package.json | 1 + yarn.lock | 18 +++++++++++++++++- 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4fa4d6940d..3c166a785a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -20,9 +20,15 @@ steps: displayName: 'Install dependencies' - script: | - yarn test:fixtures -w=2 + set JEST_JUNIT_OUTPUT=test-fixtures-junit.xml && yarn test:fixtures -w=2 displayName: 'Test: Build Fixtures' - script: | - yarn test:unit -w=2 + set JEST_JUNIT_OUTPUT=test-unit-junit.xml && yarn test:unit -w=2 displayName: 'Test: Run unit tests' + +- task: PublishTestResults@2 + inputs: + testResultsFormat: 'JUnit' + testResultsFiles: 'test-*.xml' + displayName: 'Publish test results to Azure Pipelines' diff --git a/jest.config.js b/jest.config.js index c2546d018f..90431ce159 100644 --- a/jest.config.js +++ b/jest.config.js @@ -40,5 +40,10 @@ module.exports = { moduleFileExtensions: [ 'js', 'json' + ], + + reporters: [ + 'default', + 'jest-junit' ] } diff --git a/package.json b/package.json index d61d8f7cbb..9741594392 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,7 @@ "get-port": "^4.0.0", "glob": "^7.1.3", "jest": "^23.6.0", + "jest-junit": "^5.2.0", "jsdom": "^13.0.0", "klaw-sync": "^6.0.0", "lerna": "^3.4.3", diff --git a/yarn.lock b/yarn.lock index aa6cd707c2..7dd858b23d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6127,6 +6127,17 @@ jest-jasmine2@^23.6.0: jest-util "^23.4.0" pretty-format "^23.6.0" +jest-junit@^5.2.0: + version "5.2.0" + resolved "https://registry.npmjs.org/jest-junit/-/jest-junit-5.2.0.tgz#980401db7aa69999cf117c6d740a8135c22ae379" + integrity sha512-Mdg0Qpdh1Xm/FA1B/mcLlmEmlr3XzH5pZg7MvcAwZhjHijPRd1z/UwYwkwNHmCV7o4ZOWCf77nLu7ZkhHHrtJg== + dependencies: + jest-config "^23.6.0" + jest-validate "^23.0.1" + mkdirp "^0.5.1" + strip-ansi "^4.0.0" + xml "^1.0.1" + jest-leak-detector@^23.6.0: version "23.6.0" resolved "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-23.6.0.tgz#e4230fd42cf381a1a1971237ad56897de7e171de" @@ -6262,7 +6273,7 @@ jest-util@^23.4.0: slash "^1.0.0" source-map "^0.6.0" -jest-validate@^23.6.0: +jest-validate@^23.0.1, jest-validate@^23.6.0: version "23.6.0" resolved "https://registry.npmjs.org/jest-validate/-/jest-validate-23.6.0.tgz#36761f99d1ed33fcd425b4e4c5595d62b6597474" integrity sha512-OFKapYxe72yz7agrDAWi8v2WL8GIfVqcbKRCLbRG9PAxtzF9b1SEDdTpytNDN12z2fJynoBwpMpvj2R39plI2A== @@ -11345,6 +11356,11 @@ xml-name-validator@^3.0.0: resolved "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" 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: version "1.3.1" resolved "https://registry.npmjs.org/xmlchars/-/xmlchars-1.3.1.tgz#1dda035f833dbb4f86a0c28eaa6ca769214793cf"