publish jUnit test result file from karma tests

Test plan:
* run `yarn test`
* there should be xml file in coverage-js/karma-test-results.xml
  With the spec results that we will use for Jenkins builds

Change-Id: Ic68de197d2b52dbccdf58dc2d148aef1f2ca2646
Reviewed-on: https://gerrit.instructure.com/135949
Tested-by: Jenkins
Reviewed-by: Robert Lamb <rlamb@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
This commit is contained in:
Ryan Shaw 2017-12-18 08:21:42 -07:00
parent 0db73148fa
commit 4e64e18fd5
3 changed files with 32 additions and 1 deletions

View File

@ -11,10 +11,22 @@ const karmaConfig = {
exclude: [],
// 'dots', 'progress', 'junit', 'growl', 'coverage', 'spec'
reporters: ['progress'],
reporters: ['spec', 'junit'],
// enable the verbose reporter if you want to have more information of where/how specs fail
// reporters: ['verbose'],
// this is to make a nice "spec failures" report in the jenkins build instead of having to look at the log output
junitReporter: {
outputDir: 'coverage-js', // just reusing same dir as the coverage stuff so it doesn't need its own .gitignore
outputFile: 'karma-test-results.xml', // if included, results will be saved as $outputDir/$browserName/$outputFile
useBrowserName: false, // add browser name to report and classes names
},
specReporter: {
maxLogLines: 50, // limit number of lines logged per test
suppressErrorSummary: false, // print error summary
showSpecTiming: true, // print the time elapsed for each spec
},
port: 9876,
colors: true,

View File

@ -119,8 +119,10 @@
"karma-chrome-launcher": "^2.0.0",
"karma-coverage-istanbul-reporter": "^1.3.0",
"karma-firework-reporter": "~0.2.4",
"karma-junit-reporter": "^1.2.0",
"karma-qunit": "~1.2.1",
"karma-sourcemap-loader": "^0.3.7",
"karma-spec-reporter": "^0.0.32",
"karma-verbose-reporter": "^0.0.6",
"karma-webpack": "^2.0.5",
"merge-stream": "^1.0.1",

View File

@ -5609,6 +5609,13 @@ karma-firework-reporter@~0.2.4:
request "~2.33.0"
rsvp "~3.0.3"
karma-junit-reporter@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/karma-junit-reporter/-/karma-junit-reporter-1.2.0.tgz#4f9c40cedfb1a395f8aef876abf96189917c6396"
dependencies:
path-is-absolute "^1.0.0"
xmlbuilder "8.2.2"
karma-qunit@~1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/karma-qunit/-/karma-qunit-1.2.1.tgz#88252afd2127bc03b0cc31978ed6882b139f470a"
@ -5619,6 +5626,12 @@ karma-sourcemap-loader@^0.3.7:
dependencies:
graceful-fs "^4.1.2"
karma-spec-reporter@^0.0.32:
version "0.0.32"
resolved "https://registry.yarnpkg.com/karma-spec-reporter/-/karma-spec-reporter-0.0.32.tgz#2e9c7207ea726771260259f82becb543209e440a"
dependencies:
colors "^1.1.2"
karma-verbose-reporter@^0.0.6:
version "0.0.6"
resolved "https://registry.yarnpkg.com/karma-verbose-reporter/-/karma-verbose-reporter-0.0.6.tgz#5909052451c607f02ac77c763791a2fe1251260c"
@ -9786,6 +9799,10 @@ xml2js@^0.4.10:
sax ">=0.6.0"
xmlbuilder "~9.0.1"
xmlbuilder@8.2.2:
version "8.2.2"
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-8.2.2.tgz#69248673410b4ba42e1a6136551d2922335aa773"
xmlbuilder@^2.6.4:
version "2.6.5"
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-2.6.5.tgz#6ff7ad60fb72d22764f007a164b77f2bf1400526"