2012-11-12 8 views
10

मैं उपयोग करने के लिए जेनकींस XUnit प्लग में मेरी क्यूटी इकाई परीक्षण परियोजना के लिए कोशिश कर रहा हूँ, लेकिन मैं यह काम नहीं कर सकते हैं ...जेनकींस XUnit साथ QTestlib का परिणाम दिखा रहा है प्लग में

यहाँ मैं क्या है है अब तक किया:

सबसे पहले, मैं qmakebuilder प्लग में, तो मैं एक Execute Shell निर्माण खंड जोड़ने (qmakebuilder प्लग-इन करने के लिए .pro उपलब्ध कराने के) जहां मैं पहली बार rm -f testResult के साथ अपने इकाई परीक्षण परियोजना का निर्माण xml फ़ाइल, उसके बाद, मैं -xunitxml ध्वज के साथ परीक्षण बाइनरी चलाता हूं ताकि यह मेरे लिए एक्सएमएल फ़ाइल उत्पन्न कर सके और मैं xml फ़ाइल testResult.xml का नाम अन्य शब्द में:

rm -f /home/guest/QT/unitTest/testResult.xml 
cd /home/guest/QT/unitTest 
./tst_unittesttest -xunitxml > testResult.xml 

अंत पोस्ट में कार्रवाई का निर्माण, मैं Publish xUnit test result का चयन करें और *.xml के रूप में पैटर्न निर्दिष्ट करें।

काम बिल्डिंग हालांकि असफल हो जायेगी, यहाँ उत्पादन जब जेनकींस के साथ काम का निर्माण है कि मैं मिलता है:

[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 

आप देख सकते हैं क्या XUnit प्लग करने के लिए अपने परीक्षा परिणाम xml फ़ाइल परिवर्तित समस्या है पढ़ सकते हैं <?xml version="1.0" encoding="UTF-8"?>

किसी को भी एक सुराग जहाँ मैं क्या गलत कर रहा हूँ है:

<?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> 

लेकिन TEST--735044756.xml एक एक पंक्ति xml फ़ाइल है: मेरी testResult.xml फ़ाइल इस तरह दिखता है? आउटपुट एक्सएमएल फ़ाइल उत्पन्न करने में कोई समस्या होनी चाहिए।

एक अलग टिप्पणी पर, मैं प्रणाली में लॉग thingi जोड़ लिया है लोग इन जेनकींस मेनू, यह हालांकि इस समस्या का कारण हो प्रतीत नहीं होता है ... कम से कम IMO

उत्तर

9

के साथ परीक्षण द्विआधारी निष्पादित -xml ध्वज ठीक काम करेगा। अजीब तरह से -xunitxml भ्रष्ट xml फ़ाइल बनाता है जो इसकी <testcase> में time विशेषता नहीं है। केवल -xml के साथ परीक्षण बाइनरी को सफलतापूर्वक नौकरी बनाने में परिणाम मिलते हैं।

+0

मुझे लगता है कि यह xUnit प्लगइन की कॉन्फ़िगरेशन में आपके द्वारा चुने गए प्रारूप पर निर्भर करता है। "QTestLib-Version N/A" प्रारूप (जिसे प्लगइन के संस्करण 1.50 में जोड़ा गया था) प्रारूप QTestLib के '-xml' प्रारूप की अपेक्षा करता है। – Ignitor

संबंधित मुद्दे