compare performance results from junit-xml-parser output json
npm install git://github.com/Malkiz/grunt-performance-comparer --save-dev
grunt.loadNpmTasks('performance-comparer');
'performance-comparer': {
options: {
prev: 'tests-reports/prev-',
out: 'tests-reports/report-',
verbose: true,
warnings: false,
threshold: 20,
override: true
},
unit: {
src: 'tests-reports/unitests-results.xml',
},
multi: {
src: 'tests-reports/multi/**/*unitests-results.xml',
options: {
aggregate: 'unitests-results.xml'
}
}
}
Here is an example how to use this task with watch and karma (with junit reporter).
Run this with grunt concurrent:unit
concurrent: {
options: {
logConcurrentOutput: true
},
unit: ['karma:unit', 'watch:unit']
},
watch: {
options: {
spawn: false,
},
unit: {
files: ['tests-reports/unitests-results.xml'],
tasks: ['performance-comparer:unit']
}
},
'performance-comparer': {
options: {
prev: 'tests-reports/prev-',
out: 'tests-reports/report-',
warnings: false,
verbose: true,
threshold: 20,
override: true
},
unit: {
src: 'tests-reports/unitests-results.xml',
}
},
karma : {
unit: {
configFile : 'test-config/karma-unit.conf.js',
reporters: ['dots', 'junit'],
junitReporter: {
outputFile: '../tests-reports/unitests-results.xml'
}
}
}