当前位置:网站首页>单元测试报告成功率低
单元测试报告成功率低
2022-07-07 05:19:00 【@进行中】
单元测试报告成功率低
最近新项目上线需要生成单元测试报告,在maven控制台中使用mvn surefire-report:report命令,即可生成单元测试报告。在工程文件夹下target-site路径下即可看到对应文件,使用浏览器打开即可看到详细报告。


如果使用该命令生成报告出错,那么有可能是pom文件中跳过了test文件(在正式项目启动时要跳过测试用例,否则有可能出错)。打开pom文件,搜索surefile关键字,在skip标签中改为false即可。

目前生成的报告中,在本地跑测试用例都可以通过,但是在生成的测试报告中,成功率很低,基本都是失败。


查看错误信息发现,报错都是由于找不到eureka注册中心或者配置服务器导致的。


查看测试用例的properties配置文件发现,在设置eureka注册中心地址的时候使用了占位符,在正常服务启动中,该占位符会在启动脚本中赋值,但是由于现在是测试代码,不会运行启动脚本,所以就找不到注册中心的地址。找到原因以后,我们把占位符地址换成ip地址直接连接,然后重新生成测试报告,可以看到正确率已经百分百成功了。



边栏推荐
- 互动送书-《Oracle DBA工作笔记》签名版
- JS cross browser parsing XML application
- Notes on PHP penetration test topics
- Complex network modeling (II)
- Rainbond 5.7.1 支持对接多家公有云和集群异常报警
- Qinglong panel - today's headlines
- The element with setfieldsvalue set is obtained as undefined with GetFieldValue
- WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after conne
- 轻松上手Fluentd,结合 Rainbond 插件市场,日志收集更快捷
- Understanding of out covariance, in inversion and invariance in kotlin
猜你喜欢
随机推荐
Notes on PHP penetration test topics
Réplication de vulnérabilité - désrialisation fastjson
JS复制图片到剪切板 读取剪切板
The use of generics and vararg variable parameters in kotlin
轻松上手Fluentd,结合 Rainbond 插件市场,日志收集更快捷
Network learning (I) -- basic model learning
jeeSite 表单页面的Excel 导入功能
力扣(LeetCode)187. 重复的DNA序列(2022.07.06)
[step on the pit series] H5 cross domain problem of uniapp
The zblog plug-in supports the plug-in pushed by Baidu Sogou 360
[quick start of Digital IC Verification] 12. Introduction to SystemVerilog testbench (svtb)
Qinglong panel -- finishing usable scripts
Function extension, attribute extension and non empty type extension in kotlin
Minimum absolute difference of binary search tree (use medium order traversal as an ordered array)
The largest 3 same digits in the string of leetcode simple question
Avatary's livedriver trial experience
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after conne
Avatary的LiveDriver试用体验
Qinglong panel -- Huahua reading
复杂网络建模(二)









