Defining jobs to run same tests from either last successful or build from same chain, but not both

I'm trying to set up so that TeamCity will run a set of tests based on a VCS trigger if a user checks in to /folderA/ or /folderB/:

if the user checks in to /folderA/, I want to use an artifact from the same chain
If the user checks in to /folderB/, I want to use last successful.

Easy enough so far to implement by just having 2 copies of the test job with different dependencies and triggers.  The difficulty comes here:

If the user checks in to /folderA/ and /folderB/, then I only want to run the tests using the artifact from the same chain, I don't want to trigger both sets of tests, because it will be doing the same thing, wasting valuable time on the agents.

Does anyone know how I could go about setting this up?

3 comments
Comment actions Permalink

Hi David

It will be useful if you could describe WHAT it is that you are trying to achieve, and not ask how to do it, because maybe another solution is easier.
What is the puspose of 2 folders and 2 types of dependencies?

regards
Ziv Shapira

0
Comment actions Permalink

We have code and assets that make up our product checked into different folders. When a check-in occurs, if it was asset only, we don't need to build the code, but if the code changes, the assets need to be rebuilt as well.  Regardless of the type of check-in, we need to take code and assets together and run a suite of tests on them.

Currently, we build both, regardless of what was checked in.  Both builds take a significant amount of time and will greatly increase in time over the remainer of the project, and we are already starting to hit the limits of our agent's capacity.  For asset only check-ins, we can skip the code build and just take the last built version instead, saving us approximately a third of our time on the agents for those check-ins (which are more than half of the check-ins).

Any suggestions would be appreciated...

Cheers,

-Dave

0
Comment actions Permalink

That is much clearer.

When a check-in occurs,
1. [if it was asset only, we don't need to build the code] - so make a VCS trigger on assets build, that builds it every time there is an asset checkin. no dependencies
2. [but if the code changes, the assets need to be rebuilt as well] so make a VCS trigger on code build, that builds it every time there is a code checkin. and create a snaphot dependency on Assets (but mark as not to run if there is a suitable build, so it will not run again on checkin to both code and assets)
3. [Regardless of the type of check-in, we need to take code and assets together and run a suite of tests on them.] create a test suite build configuration. Create a build finish trigger on it (Section 5), where there the selected build is assets configuration. Assets is always built (once) so it will trigger the test suite.

I hope this helps.

ziv shapira

0

Please sign in to leave a comment.