Unit testing 生成正确完整的xml单元测试报告(针对Hudson)
我正在为R扩展一个单元测试套件,它是的一部分,这样它也可以生成Hudson可以读取的输出。事实上,我已经有了一些可以做到这一点的东西,但它不处理“停用”测试 要了解我的意思,请查看文件中的protocol_junit.svTestData方法 问题是,我没有找到Hudson接受的模式的任何定义,并且我成功地说服了一个Java项目失败并出错,因此它的测试套件将在几个元素中添加and元素,但我没有看到@Ignore@测试装饰会发生什么 例如,许多其他人也提出了同样的问题,但最终得出了一个很好的起点,但并不完整。例如,它没有提到我通过反复试验发现的元素 我试图阅读哈德逊阅读的资料,但我没有找到从哪里开始Unit testing 生成正确完整的xml单元测试报告(针对Hudson),unit-testing,r,hudson,junit4,jenkins,Unit Testing,R,Hudson,Junit4,Jenkins,我正在为R扩展一个单元测试套件,它是的一部分,这样它也可以生成Hudson可以读取的输出。事实上,我已经有了一些可以做到这一点的东西,但它不处理“停用”测试 要了解我的意思,请查看文件中的protocol_junit.svTestData方法 问题是,我没有找到Hudson接受的模式的任何定义,并且我成功地说服了一个Java项目失败并出错,因此它的测试套件将在几个元素中添加and元素,但我没有看到@Ignore@测试装饰会发生什么 例如,许多其他人也提出了同样的问题,但最终得出了一个很好的起点,
有什么提示吗?仔细观察了哈德逊光源,特别是,我发现在一个元素中包含一个元素就是我要寻找的 仅供将来参考,我正在生成的模式的RELAX NG compact语法可以随意编辑/维护:
junit.rnc:
#----------------------------------------
start = testsuite
property = element property {
attribute name {text},
attribute value {text}
}
properties = element properties {
property*
}
failure = element failure {
attribute message {text},
attribute type {text},
text
}
error = element error {
attribute message {text},
attribute type {text},
text
}
skipped = element skipped {
text
}
testcase = element testcase {
attribute classname {text},
attribute name {text},
attribute time {text},
(failure|error)?,
skipped?
}
testsuite = element testsuite {
attribute errors {xsd:integer},
attribute failures {xsd:integer},
attribute hostname {text},
attribute name {text},
attribute tests {xsd:integer},
attribute time {xsd:double},
attribute timestamp {xsd:dateTime},
properties,
testcase*,
element system-out {text},
element system-err {text}
}
#----------------------------------------
and junitreport.rnc
#----------------------------------------
include "junit.rnc" {
start = testsuites
testsuite = element testsuite {
attribute errors {xsd:integer},
attribute failures {xsd:integer},
attribute hostname {text},
attribute name {text},
attribute tests {xsd:integer},
attribute time {xsd:double},
attribute timestamp {xsd:dateTime},
attribute id {text},
attribute package {text},
properties,
testcase*,
element system-out {text},
element system-err {text}
}
}
testsuites = element testsuites {
testsuite*
}
#----------------------------------------
特别是仔细观察了哈德逊光源,我发现在一个元素中包含一个元素就是我要寻找的 仅供将来参考,我正在生成的模式的RELAX NG compact语法可以随意编辑/维护:
junit.rnc:
#----------------------------------------
start = testsuite
property = element property {
attribute name {text},
attribute value {text}
}
properties = element properties {
property*
}
failure = element failure {
attribute message {text},
attribute type {text},
text
}
error = element error {
attribute message {text},
attribute type {text},
text
}
skipped = element skipped {
text
}
testcase = element testcase {
attribute classname {text},
attribute name {text},
attribute time {text},
(failure|error)?,
skipped?
}
testsuite = element testsuite {
attribute errors {xsd:integer},
attribute failures {xsd:integer},
attribute hostname {text},
attribute name {text},
attribute tests {xsd:integer},
attribute time {xsd:double},
attribute timestamp {xsd:dateTime},
properties,
testcase*,
element system-out {text},
element system-err {text}
}
#----------------------------------------
and junitreport.rnc
#----------------------------------------
include "junit.rnc" {
start = testsuites
testsuite = element testsuite {
attribute errors {xsd:integer},
attribute failures {xsd:integer},
attribute hostname {text},
attribute name {text},
attribute tests {xsd:integer},
attribute time {xsd:double},
attribute timestamp {xsd:dateTime},
attribute id {text},
attribute package {text},
properties,
testcase*,
element system-out {text},
element system-err {text}
}
}
testsuites = element testsuites {
testsuite*
}
#----------------------------------------
其他要看的东西:别处提到的bug报告的更新位置;其他要看的东西:别处提到的bug报告的更新位置;蚂蚁RFE。