I have the following set-up in TeamCity 7.1.3:
Project A
- Build & Deploy A
- Test A (Quick)
- Test A (Slow)
- Test A (Very Slow)
Project B
- Build & Deploy B
- Test B (Quick)
- Test B (Slow)
All of the tests for A depend on 'Build & Deploy A' and all of the tests for B depend on 'Build & Deploy B'. The dependencies are all snapshot dependencies with the following settings:
- Do not run new build if there is a suitable one
- Only use successful builds from suitable ones
- Run build on the same agent
All of the tests have VCS triggers. The slow tests only run when particular folders in source control are changed. When a commit is made to project A, the following projects are added to the build queue:
- Build & Deploy A
- Test A (Quick)
- Test A (Slow)
- Test A (Very Slow)
Pre-commit builds run with higher priority in the build queue. As such, if while 'Build & Deploy A' is running a pre-commit check is made to project B, the build queue then looks like:
- Build & Deploy B
- Test B (Quick)
- Test B (Slow)
- Test A (Quick)
- Test A (Slow)
- Test A (Very Slow)
The problem with this set-up is that it will mean that the tests for A are run after project B has been deployed. This is an issue as the deployment of project B overwrites some of the files required by project A. The files which are being overwritten by the personal build are deployed files which are not in the checkout folder which is why they are not rolled back. Is there any way to enforce that the build chain for the tests isn't interrupted?
If I remove the 'Do not run new build if there is a suitable one' setting from the dependency, each of the tests will require a full build and deploy. The slower tests can't depend on other tests to make a linear chain as sometimes 'Test A (Very Slow)' is run, but 'Test A (Slow)' isn't.
Unfortunately it isn't currently possible to split the build and deploy to create artefacts.
Is there any way to efficiently set this up in TeamCity?