2

svUnit ( sciViewsの一部である R の単体テスト スイート) を拡張して、Hudson で読み取ることができる出力も生成するようにしています。実際、私はすでにこれを行うものを持っていますが、「無効化された」テストを処理しません。

つまり、 svTestData.Rファイルのprotocol_junit.svTestDataメソッドを見てください。

問題は、Hudson によって受け入れられたスキーマの定義を見つけることができず、Java プロジェクトを失敗させてエラーにすることをなんとか納得させて、そのテスト スイートがいくつかの要素の中に<failure/>and<error/>要素を追加するようにしたことですが、装飾<testcase/>で何が起こるかを見ることができませんでした。@Ignore @Test

他の多くの人がこれと同じ質問をしています。たとえば、私が試行錯誤して発見した要素については言及されていません。<error/>

ハドソンが読んだソースを読み込もうとしましたが、どこから始めればよいかわかりませんでした。

ヒントはありますか?

4

1 に答える 1

0

Hudson のソース (特にCaseResult.java ) を詳しく見てみると、<skipped/>要素に要素を含める<testcase/>ことが探していたものであることがわかりました。

将来の参考のために、私が作成しているスキーマの RELAX NG コンパクトな構文 (自由に編集/維持してください):

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*
}
#----------------------------------------
于 2010-09-25T07:11:01.333 に答える