I have node.js project and I'd like to run test cases written mocha (visionmedia.github.io/mocha/) in our bamboo (atlassian product), but mocha does not provide any reported for bamboo, ie. JUnit reporter.
我有node.js项目,我想在我们的竹子(atlassian产品)中运行写mocha(visionmedia.github.io/mocha/)的测试用例,但是mocha没有提供竹子的任何报告,即。 JUnit记者。
I'm thinking about coverting xUnit to JUnit formart, but so far I've not found any solution for this.
我正在考虑将xUnit转换为JUnit formart,但到目前为止我还没有找到任何解决方案。
Can any one advice?
可以有任何建议吗?
2 个解决方案
#1
1
so far I fixed this by subunit combo:
到目前为止,我通过子单元组合修复了这个问题:
mocha -R tap ./test/*.js > ./test-reports/result.tap
cd ./test-reports
cat ./result.tap | \
tap2subunit | subunit2junitxml > result.junit && \
xmllint --pretty 1 result.junit > result.junit.xml
#2
0
use https://www.npmjs.com/package/mocha-bamboo-reporter there is a task "Mocha Test Parser" which is installed when you install the nodejs bamboo plugin.
使用https://www.npmjs.com/package/mocha-bamboo-reporter安装nodejs bamboo插件时会安装一个“Mocha Test Parser”任务。
Pickup the results written from the mocha-bamboo-reporter with this task in "final tasks" of your build stage
在你的构建阶段的“最终任务”中,将mocha-bamboo-reporter编写的结果与此任务一起提取
#1
1
so far I fixed this by subunit combo:
到目前为止,我通过子单元组合修复了这个问题:
mocha -R tap ./test/*.js > ./test-reports/result.tap
cd ./test-reports
cat ./result.tap | \
tap2subunit | subunit2junitxml > result.junit && \
xmllint --pretty 1 result.junit > result.junit.xml
#2
0
use https://www.npmjs.com/package/mocha-bamboo-reporter there is a task "Mocha Test Parser" which is installed when you install the nodejs bamboo plugin.
使用https://www.npmjs.com/package/mocha-bamboo-reporter安装nodejs bamboo插件时会安装一个“Mocha Test Parser”任务。
Pickup the results written from the mocha-bamboo-reporter with this task in "final tasks" of your build stage
在你的构建阶段的“最终任务”中,将mocha-bamboo-reporter编写的结果与此任务一起提取