Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run tests affected by code changes first in TeamCity

Using TeamCity, we want to run tests which are affected by code changes first.

NCrunch (http://ncrunch.net) and Mighty Moose (http://continuoustests.com/) provide solutions for that on a local development machine. Is there some solution for TeamCity?

Context: We are running many integration tests and programmers tests against our code base. It takes up to 4h to run all tests on the integration server. It runs on rather powerful hardware and there is not much room for improvement on that end. When a developer commits und pushes, it would be nice to get a quick feedback.

like image 984
Robert Avatar asked Jan 26 '12 12:01

Robert


People also ask

How do I check my TeamCity code coverage?

Code Coverage in TeamCity The code coverage results can be viewed on the Overview tab of Build Results. A detailed report is displayed on the dedicated Code Coverage tab. The chart for code coverage is also available on the Statistic Charts tab of a build configuration.

How does TeamCity integrate with selenium?

If you need to coordinate with Selenium tests with the TeamCity server, you can do it by including former created project into your development project files. From that point onward, you can arrange TeamCity build setup to run your Selenium tests on each triggered build.

What is TeamCity in automation?

Deliver quality software faster TeamCity is a general-purpose CI/CD solution that allows the most flexibility for all sorts of workflows and development practices. The Projects Overview lets you quickly check the status of your builds, see what triggered them, download the latest build artifacts, and more.


1 Answers

To reduce overall tests duration, you probably can split your tests on two or even more parts and have separate build configuration in TeamCity for each part. Then you can create one more build configuration with snapshot dependencies on all these parts. Finally, you can add VCS trigger to this configuration with option to trigger on changes in dependencies. Build configurations actually running tests may not have triggers at all.

With this setup and enough agents you'll have several parts of your tests running in parallel. Note that snapshot dependencies results will be consistent, because when integration test build configurations are triggered, their revisions are fixed and will be the same for all triggered builds. The build configuration depending on test configurations may not have build steps at all, it's only task is to provide aggregated test results and triggering.

TeamCity also supports tests reordering for .NET and Java, you can read more about this feature in documentation: http://confluence.jetbrains.net/display/TCD65/Running+Risk+Group+Tests+First

like image 171
Pavel Sher Avatar answered Oct 30 '22 23:10

Pavel Sher