Kazi Rashedul Haque
Kazi Rashedul Haque

Reputation: 1

Test suites run interrupted in TeamCity by intermediate builds

I am using TeamCity to run around 15 different test suites consisting of hundreds of test cases whenever any new changes come in the existing project. It is configured in a way that it checks for any new changes in Git every half an hour and if it finds any changes, it starts building the project even in the middle of running the test suites. As a result, the database is getting outdated and the test cases are failing for the wrong reasons. How can I configure it so that if TeamCity is in the middle of running the test suites and if any changes come before it can finish running all the available test suites it will not start building the project. It will wait until all the test suites are run and then start building the project with the latest changes. Please help me out.

Upvotes: 0

Views: 73

Answers (1)

lmsec
lmsec

Reputation: 374

You may use a Resource Locker with a quota of 1.

Create the Locker at project level (a project both your builds are a part of). For the example I named it ServiceLocker.

enter image description here

Then, in both builds (Tests and Build project), add the Resource Locker you created.

enter image description here

As a result, when coming to the top of the build queue, both the builds will :

  • check that the Locker is used by less than 1 build (meaning 0 build) ;
  • if another build is using this Locker, then the build does not start. It will stay in the queue until the Locker is free ;
  • if/when this Locker is free, the build takes the Locker and starts.

In other words, it prevents the builds having this Locker to run simultaneously.

Upvotes: 1

Related Questions