仅运行单元测试哪个相应的源代码已更改? [英] Only run unit tests which's respective source code has changed?

查看:102
本文介绍了仅运行单元测试哪个相应的源代码已更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Jenkins CI服务器中运行单元测试和Selenium测试.众所周知,测试需要很长时间才能在大型项目中运行.

I am running unit tests and Selenium tests in our Jenkins CI server. As we all know, tests take long to run in a large project.

是否有用于Java的工具/框架只能触发其相应源代码已更改的测试?这是因为并非每次对SCM的提交都会影响源代码的所有区域...

Is there a tool/framework for Java which could only trigger tests whose respective source code has changed? This because not every commit to SCM affects all areas of the source code...

我正在使用Cobertura进行代码覆盖,并使用Surefire进行报告.

I am using Cobertura for code coverage and Surefire for reporting.

我找到了Atlassian Clover,但我正在寻找免费的解决方案.

I found Atlassian Clover, but I am searching for a free solution.

推荐答案

我正在Jenkins CI服务器中运行单元测试和Selenium测试. 众所周知,测试需要很长时间才能在大型项目中运行.

I am running unit tests and Selenium tests in our Jenkins CI server. As we all know, tests take long to run in a large project.

这是我要解决的问题.将您的项目分成多个逻辑单元(例如,持久层,服务层,Web层)并分别进行测试.这样,您只需要在Web层发生更改并且每个工件的构建时间变短时运行Selenium测试

This is the problem I'd tackle. Split your project into multiple logical units (e.g. Persistence Layer, Service Layer, Web Layer) and test them individually. That way you only need to run Selenium tests when the web layer has changed and the build time per artifact grows shorter

这篇关于仅运行单元测试哪个相应的源代码已更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆