What is the TestNG XML report pattern for Jenkins when using Maven with surefire?

Deadly 提交于 2019-12-12 04:11:46

问题


I'm using TestNG Results Plugin. I defined TestNG XML report pattern as: **\target\surefire-reports\testng-results.xml I'm getting this error: TestNG Reports Processing: START Looking for TestNG results report in workspace using pattern: **\target\surefire-reports\testng-results.xml Did not find any matching files.

What should be the correct pattern?


回答1:


I just fixed this problem!

It's because that the current directory was changed to the default Jenkins workspace, something like '/Users/Shared/Jenkins/Home/workspace/your_project_name' when it ran!!

You will find it yourself if you add shell command 'pwd' before Post-build Actions in the Configuration of your project in Jenkins.

You just need configure your project in General -> Advanced... -> Use custom workspace, and fill in the full path of your project, and it will work!!!




回答2:


The following pattern works for me: **/target/surefire-reports/*.xml

Also ensure that the default listeners are not disabled in your surefire configuration to ensure that surefire creates the xml reports for ReoprtNG/TestNG. Until I removed the disabling of default listeners I got the same error.



来源:https://stackoverflow.com/questions/44257657/what-is-the-testng-xml-report-pattern-for-jenkins-when-using-maven-with-surefire

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!