当前位置:网站首页>Low success rate of unit test report

Low success rate of unit test report

2022-07-07 08:22:00 @In progress

The success rate of unit test report is low

Recently, a unit test report needs to be generated when a new project is launched , stay maven Use... In the console mvn surefire-report:report command , You can generate a unit test report . Under project folder target-site You can see the corresponding file under the path , Open the browser to see the detailed report .

If an error occurs when using this command to generate a report , So it could be pom File skipped test file ( Skip test cases when starting a formal project , Otherwise, there is a risk of error ). open pom file , Search for surefile keyword , stay skip In the label, change to false that will do .

Among the currently generated reports , Running test cases locally can pass , But in the generated test report , The success rate is very low , Basically, they all fail .

Check the error message and find , Errors are reported because they cannot be found eureka Registration center or configuration server .

View the... Of the test case properties Configuration file discovery , Set up eureka Placeholders are used when registering the address of the center , During normal service startup , This placeholder will be assigned in the startup script , But now it's test code , Will not run the startup script , So I can't find the address of the Registration Center . After finding out the reason , Let's replace the placeholder address with ip Address direct connection , Then regenerate the test report , You can see that the accuracy rate has been 100% successful .

label : java Experience Development maventest Unit test report

Original address : The success rate of unit test report is low - mikiiii - Blog Garden

原网站

版权声明
本文为[@In progress]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207070519267359.html