2014-01-15 186 views
0

我有一個在Jenkins上運行的TestNG項目。由於某些原因,我不知道它停止運行測試。它編譯完美,但它不運行測試。這裏是一個運行的輸出:Jenkins沒有運行TestNG測試

<===[JENKINS REMOTING CAPACITY]===>channel started 
    log4j:WARN No appenders could be found for logger 
    (org.apache.commons.beanutils.converters.BooleanConverter). 
    log4j:WARN Please initialize the log4j system properly. 
    Executing Maven: -B -f C:\Java\jenkins-1.523\workspace\TEST_HEAD_NOEXPORT\CMS-WEB SELENIUM-WEB-TEST\pom.xml clean install 
    [INFO] Scanning for projects... 
    [INFO]                   
    [INFO] ------------------------------------------------------------------------ 
    [INFO] Building TEST-CMS-WEB 0.0.1 
    [INFO] ------------------------------------------------------------------------ 
    [INFO] 
    [INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ Web --- 
    [INFO] 
    [INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ Web --- 
    [debug] execute contextualize 
    [INFO] Using 'cp1252' encoding to copy filtered resources. 
    [INFO] Copying 69 resources 
    [INFO] 
    [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ Web --- 
    [INFO] Compiling 73 source files to C:\Java\jenkins-1.523\workspace\TEST_HEAD_NOEXPORT\CMS-WEB\SELENIUM-WEB-TEST\target\classes 
    [INFO] 
    [INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ Web --- 
    [debug] execute contextualize 
    [INFO] Using 'cp1252' encoding to copy filtered resources. 
    [INFO] skip non existing resourceDirectory C:\Java\jenkins-1.523\workspace\TEST_HEAD_NOEXPORT\CMS-WEB\SELENIUM-WEB-TEST\src\test\resources 
    [INFO] 
    [INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ Web --- 
    [INFO] Compiling 2 source files to C:\Java\jenkins-1.523\workspace\TEST_HEAD_NOEXPORT\CMS-WEB\SELENIUM-WEB-TEST\target\test-classes 
    [INFO] 
    [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ Web --- 
    [JENKINS] Recording test results 
    [INFO] 
    [INFO] --- maven-jar-plugin:2.3.2:jar (default-jar) @ Web --- 
    [INFO] Building jar: C:\Java\jenkins-1.523\workspace\TEST_HEAD_NOEXPORT\CMS-WEB\SELENIUM-WEB-TEST\target\Web-0.0.1.jar 
    [INFO] 
    [INFO] --- maven-install-plugin:2.3.1:install (default-install) @ Web --- 
    [INFO] Installing C:\Java\jenkins-1.523\workspace\TEST_HEAD_NOEXPORT\CMS-WEB\SELENIUM-WEB-TEST\target\Web-0.0.1.jar to C:\.m2\repository\Test\Web\0.0.1\Web-0.0.1.jar 
    [INFO] Installing C:\Java\jenkins-1.523\workspace\TEST_HEAD_NOEXPORT\CMS-WEB\SELENIUM-WEB-TEST\pom.xml to C:\.m2\repository\Test\Web\0.0.1\Web-0.0.1.pom 
    [INFO] ------------------------------------------------------------------------ 
    [INFO] BUILD SUCCESS 
    [INFO] ------------------------------------------------------------------------ 
    [INFO] Total time: 5.211s 
    [INFO] Finished at: Wed Jan 15 14:21:03 UYST 2014 
    [INFO] Final Memory: 26M/310M 
    [INFO] ------------------------------------------------------------------------ 
    [JENKINS] Archiving C:\Java\jenkins-1.523\workspace\TEST_HEAD_NOEXPORT\CMS-WEB\SELENIUM-WEB-TEST\pom.xml to C:\Java\jenkins-1.523\jobs\TEST_HEAD_NOEXPORT\modules\Test$Web\builds\2014-01-15_14-20-56\archive\Test\Web\0.0.1\Web-0.0.1.pom 
    [JENKINS] Archiving C:\Java\jenkins-1.523\workspace\TEST_HEAD_NOEXPORT\CMS-WEB\SELENIUM-WEB-TEST\target\Web-0.0.1.jar to C:\Java\jenkins-1.523\jobs\TEST_HEAD_NOEXPORT\modules\Test$Web\builds\2014-01-15_14-20-56\archive\Test\Web\0.0.1\Web-0.0.1.jar 
    Waiting for Jenkins to finish collecting data 

如果有人知道會發生什麼,我會感激的幫助。

+0

我看不到它找到你的測試。既然你正在使用maven,你的測試是否在'src/test/java'下? – sircapsalot

+0

它們是在src /主/ JAVA,但使用TestNG和行家萬無一失和IM事情是IM: 的src /主/資源/ testsCasesRun/smokeTestPlan.xml elcharrua

+0

每個maven約定,如果你的測試不在'src/test/java'中,你的測試將不會運行。或者你需要知道如何明確地告訴maven你的測試目錄是在src/main/java裏面的。 – sircapsalot

回答

2

如果您使用Maven Surefire,您是否正確指定了「測試包含」過濾器?測試階段將在src/test/java中搜索包含@Test註釋的類。將maven錯誤地配置爲src/test/java目錄的位置很容易,因此只需小心一點,你就會知道它。

+0

是的,我使用Maven Surefire,我已經在pom中這樣指定它: \t \t \t \t \t \t \t \t \t org.apache.maven.plugins \t \t \t \t Maven的萬無一失,插件 \t \t \t \t 2.12.4 \t \t \t \t <結構> \t \t \t \t \t \t \t \t \t \t \t ** /試驗*的.java \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t 的src /主/資源/ testsCasesRun /詹金斯。XML \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t elcharrua

+0

這不是我說的要小心部分。要非常小心你如何配置(或接受的默認值),並放置你的src/main和src/test目錄位置。 – djangofan