how to avoid redeploying before each run of end2end tests


We have following build chain:

  1. build
  2. deploy (snapshot& artifact dep. on 1)
  3. integration tests (snapshot dep. on 2) - issues remote calls to the deployed application

The problem is that the snapshot dependency between 3 and 2:

  • If I check "Do not run new build if there is a suitable one" then it will not trigger deployment if given branch was built in the past. E.g. chain is executed for branch A rev 1 (build, deploy, tests), then for branch B rev 2 (build, deploy tests), then when someone runs the tests for A-1 it will skip the the build (ok) and the deployment (will "reuse" it) - that's bad
  • If I do not check "Do not run new build if there is a suitable one" then every time someone wants to run the tests will also trigger the deployment - that's bad.

What I want is the following behavior: when someone runs the tests on A-1 it should run deploy only if the most recent deployment was for version other than A-1.

How to achieve that?
Comment actions Permalink

Hi Marcin,

It is not possible to configure such behavior in TeamCity.
Do you run "tests" manually? If yes, then you can use promote action instead. E.g. the latest deployed revision is A-1, then you promote tests from this deployment build. If the latest deployed revision is B-2, then you go to "build" and promote needed revision.

Another workaround is to add a check in "deploy" build configuration that the latest build ran on needed revision and if yes, then skip deployment. You can get the details of the latest build using REST API.
Please feel free to create feature request in our tracker.

Comment actions Permalink


For now I just dropped the snapshot dependency - tests are run after deployment automatically and can be run manually without triggering deployment. I lost the feature of triggering appropiate deployment depending on which branch/revision the tests are triggered, but that's not really needed.


Please sign in to leave a comment.