2013-10-02 10 views
6

otrzymuję ten błąd, gdy Jenkins próbuje odczytać plik wynik xml przez JUnitJenkins: Plik wynikowy dla metryki "JUnit" jest nieprawidłowy. Plik wynik został pominięty

to jest wyjście

> [xUnit] [INFO] - Starting to record. 
[xUnit] [INFO] - Processing JUnit 
[xUnit] [INFO] - [JUnit] - 1 test report file(s) were found with the pattern '**\testResults\*.xml' relative to 'C:\Jenkins\jobs\InstantMatcher\workspace' for the testing framework 'JUnit'. 
[xUnit] [ERROR] - The result file 'C:\Jenkins\jobs\InstantMatcher\workspace\Code\RegressionTest\testResults\result-InstantMatcher - Copy.xml' for the metric 'JUnit' is not valid. The result file has been skipped. 
[xUnit] [INFO] - Fail BUILD because 'set build failed if errors' option is activated. 
[xUnit] [INFO] - There are errors when processing test results. 
[xUnit] [INFO] - Skipping tests recording. 
[xUnit] [INFO] - Stop build. 
Finished: FAILURE 

Mój plik XML wygląda to

<testsuite failures="0" tests="209" name="UnitTests.MainClassTest"> 
    <testcase classname="UnitTests.OSUtils" name="stripExtension" parameters="" assertions="pass" time="0.03 ms"/> 
     <testcase classname="UnitTests.OSUtils" name="changeExtension" parameters="" assertions="pass" time="0.04 ms"/> 
     <testcase classname="UnitTests.OSUtils" name="stripPathAndExtension" parameters="" assertions="pass" time="0.04 ms"/> 
     <testcase classname="UnitTests.OSUtils" name="getFilename" parameters="" assertions="pass" time="0.03 ms"/> 
     <testcase classname="UnitTests.OSUtils" name="atoi" parameters="" assertions="pass" time="0.47 ms"/> 
     <testcase classname="UnitTests.CImage" name="jpg matches bmp" parameters="" assertions="pass" time="N/A"/> 
     <testcase classname="UnitTests.InstantMatcher" name="Bandpass Sync: " parameters="" assertions="pass" time="109.73 ms"/> 
     <testcase classname="UnitTests.InstantMatcher" name="Orientation Dominance Sync: " parameters="" assertions="pass" time="109.73 ms"/> 
     <testcase classname="UnitTests.InstantMatcher" name="Test Saliency MapSync: " parameters="" assertions="pass" time="109.73 ms"/> 
     <testcase classname="UnitTests.InstantMatcher" name="Test Level Keypoints Sync: " parameters="" assertions="pass" time="109.73 ms"/> 
     <testcase classname="UnitTests.InstantMatcher" name="Bandpass Sync: " parameters="" assertions="pass" time="109.73 ms"/> 
     <testcase classname="UnitTests.InstantMatcher" name="Orientation Dominance Sync: " parameters="" assertions="pass" time="109.73 ms"/> 
     <testcase classname="UnitTests.InstantMatcher" name="Test Saliency MapSync: " parameters="" assertions="pass" time="109.73 ms"/> 
     <testcase classname="UnitTests.InstantMatcher" name="Test Level Keypoints Sync: " parameters="" assertions="pass" time="109.73 ms"/> 
     <testcase classname="UnitTests.InstantMatcher" name="Bandpass Sync: " parameters="" assertions="pass" time="109.73 ms"/> 
     <testcase classname="UnitTests.InstantMatcher" name="Orientation Dominance Sync: " parameters="" assertions="pass" time="109.73 ms"/> 
     <testcase classname="UnitTests.InstantMatcher" name="Test Saliency MapSync: " parameters="" assertions="pass" time="109.73 ms"/> 
     <testcase classname="UnitTests.InstantMatcher" name="Test Level Keypoints Sync: " parameters="" assertions="pass" time="109.73 ms"/> 
     <testcase classname="UnitTests.InstantMatcher" name="Bandpass Sync: " parameters="" assertions="pass" time="109.73 ms"/> 

Masz pomysł?

Odpowiedz

8

Istnieje wiele błędów w module śledzenia błędów Jenkins dotyczących błędów analizy xUnit z różnymi wyjściami podobnymi do JUnit. xUnit jest świetny, jeśli używasz jednego z formatów, które on rozumie, ale jest mniej dobry do analizowania generycznych danych JUnit-like generowanych przez narzędzie inne niż JUnit. Z mojego doświadczenia wynika, że ​​lepiej jest korzystać z opublikowanego raportu z testu publikowania wyników JUnit.

JENKINS-18095 ma wskaźnik do XSD używany przez xUnit do sprawdzania poprawności XML JUnit. Bazując na tym, przypuszczam, że atrybut parameters w twoim obiekcie testcase potknie się o walidację xUnit.

+0

Dzięki @Dave, rozwiązałem mój problem przez obniżenie poziomu wtyczki xUnit, więc może jest błąd w najnowszej wtyczce? –

+0

Którą wersję dokładnie obniżyłeś? – Opal

Powiązane problemy