[英]Maven+Jenkins+Testng Build Failure after running tests
我在jenkins上運行了一組測試,得到以下結果:
Tests run: 5, Failures: 1, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 04:39 min
[INFO] Finished at: 2014-07-21T16:33:14-07:00
[INFO] Final Memory: 7M/18M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.16:test (default-test) on project barcoAutomation: There are test failures.
[ERROR]
[ERROR] Please refer to C:\Code\Maven\.\Maven\barcoAutomation\target\surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[INFO] Build failures were ignored.
[Maven] $ cmd /c call C:\Windows\TEMP\hudson8319915807901667722.bat
好吧,這告訴我這行:maven-surefire-plugin:2.16是這里的問題,所以這是我檢查的pom文件:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.barco.automation</groupId>
<artifactId>barcoAutomation</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>barcoAutomation</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<!-- added -->
<!-- <suiteFile>src/test/resources/barcoColor.xml</suiteFile> <suiteFile>src/test/resources/GeneralSettings.xml</suiteFile> -->
</properties>
<dependencies>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8</version>
</dependency>
<dependency>
<groupId>org.uncommons</groupId>
<artifactId>reportng</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.42.2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.10-FINAL</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.10-FINAL</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/barcoGeneralSettings.xml</suiteXmlFile>
<!-- <suiteXmlFile>${suiteFile}</suiteXmlFile> -->
</suiteXmlFiles>
<!--<suiteXmlFile>src/test/resources/GeneralSettings.xml</suiteXmlFile>
<suiteXmlFiles> <suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
<suiteXmlFile>src/test/resources/NewFile.xml</suiteXmlFile> <suiteXmlFile>src/test/resources/barcoColor.xml</suiteXmlFile>
</suiteXmlFiles> -->
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/test/resources/</directory>
</resource>
</resources>
</build>
</project>
我已經檢查了Maven存儲庫中的插件,唯一看到的區別是插件標簽中有插件,而在網站上它是Dependecy標簽中的插件。
這可能是什么錯誤?
謝謝
注意:對純文本表示抱歉,但是我不知道如何在代碼上加上顏色= /
maven命令成功運行,但是您的5個測試之一失敗了。
Tests run: 5, Failures: 1, Errors: 0, Skipped: 0
測試失敗會導致構建“失敗”
看一下:
C:\Code\Maven\.\Maven\barcoAutomation\target\surefire-reports
並查看哪個測試失敗以及為什么。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.