próbuję użyć Jenkins xUnit plug-in do mojego projektu badawczego jednostka Qt, ale nie może to działać ...Pokazuje wynik QTestlib z Jenkins xUnit plug-in
Oto co ja zrobione do tej pory:
Przede wszystkim buduję mój projekt testowy jednostka z qmakebuilder plug-in (dostarczaniu .pro do wtykania qmakebuilder), następnie dodać sekcję Execute Shell
gromadzeniu gdzie po raz pierwszy rm -f
na testResult plik xml, po tym uruchomię testowy plik binarny z flagą -xunitxml
, aby wygenerował dla mnie plik xml I nazwałem plik xml testResult.xml
, innymi słowy:
rm -f /home/guest/QT/unitTest/testResult.xml
cd /home/guest/QT/unitTest
./tst_unittesttest -xunitxml > testResult.xml
Wreszcie w post Budowanie Akcja, wybiorę Publish xUnit test result
i określić wzorzec jako *.xml
.
Budowanie zadanie nie powiedzie się jednak, Oto wynik, że mam przy budowie pracę z Jenkins:
[xUnit] [INFO] - Starting to record.
[xUnit] [INFO] - Processing QTestlib-Version N/A
[xUnit] [INFO] - [QTestlib-Version N/A] - 1 test report file(s) were found with
the pattern '*.xml' relative to '/home/guest/QT/unitTest' for the testing framework
'QTestlib-Version N/A'.
[xUnit] [ERROR] - The converted file for the result file '/home/guest/QT/unitTest
/testResult.xml' (during conversion process for the metric 'QTestlib') is not
valid.
The report file has been skipped.
[xUnit] [ERROR] - The plugin hasn't been performed correctly: hudson.util.IOException2:
Failed to read /home/guest/QT/unitTest/generatedJUnitFiles/QTestlib/TEST--735044756.xml
Build step 'Publish xUnit test result report' changed build result to FAILURE
Build step 'Publish xUnit test result report' marked build as failure
Finished: FAILURE
Jak widać nie ma problemu konwersji wynik mojego testu pliku xml, co xUnit plug w można przeczytać. Mój plik testResult.xml wygląda następująco:
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite errors="2" failures="0" tests="4" name="UnitTestTest">
<properties>
<property value="4.7.4" name="QTestVersion"/>
<property value="4.7.4" name="QtVersion"/>
</properties>
<testcase result="pass" name="initTestCase">
<!-- message="called before everything else" type="qdebug" -->
</testcase>
<testcase result="pass" name="myFirstTest"/>
<testcase result="pass" name="mySecondTest"/>
<testcase result="pass" name="cleanupTestCase">
<!-- message="called after myFirstTest and mySecondTest" type="qdebug" -->
</testcase>
<system-err>
<![CDATA[called before everything else]]>
<![CDATA[called after myFirstTest and mySecondTest]]>
</system-err>
</testsuite>
ale TEST--735044756.xml
to plik XML jedna linia: <?xml version="1.0" encoding="UTF-8"?>
Ktoś ma pojęcia, gdzie to, co robię źle? Powinien pojawić się problem z wygenerowaniem wyjściowego pliku xml.
Na innej notatki, Dodałem thingi dziennika w systemie logowania menu Jenkins, to nie wydaje się być przyczyną tego problemu chociaż ... przynajmniej IMO
Myślę, że zależy to od formatu wybranego w konfiguracji wtyczki xUnit. Format "QTestLib-Version N/A" (który został dodany w wersji 1.50 wtyczki) oczekuje formatu '-xml' QTestLib. – Ignitor