How to *always* trigger on successful build?

I have a setup that looks something like this:

DeployToStaging has a snapshot dependency on TestSuiteA and TestSuiteB

DeployToStaging has the VCS trigger.

TestSuiteA runs quite quickly (10-15 mins), while TestSuiteB runs rather slowly (about 1 hr).

So what happens is that we get a number of changes piled up waiting for TestSuiteB to finish. When TestSuiteB finishes successfully, DeployToStaging is not executed, instead TestSuiteB starts up again with the queued changes. Not until there are no queued changes does DeployToStaging finally execute - realistically this means we don't get a deploy until the end of the work day.

What I'd like to have happen is that every time TestSuiteB finishes sucessfully, DeployToStaging gets triggered regardless of whether there are queued changes or not.

I can't see anyway to do this, but I'm hoping I'm just missing something.

Ideas?

Darrell

10 comments
Comment actions Permalink

Try to add dependency trigger from TestSuiteB to DeployToStaging, i.e. navigate to DeployToStaging Build Triggers -> Dependency tab and select TestSuiteB. When TestSuiteB finishes successfully DeployToStaging will be invoked.

0
Comment actions Permalink

No, that's not the issue -- the dependency already exists. The problem is that DeployToStaging won't actually run until there are no pending changes in TestSuiteB. I want it to kick off after *every* successful build, whether there are pending changes or not.

I suppose I could put in some sort of artifact based trigger on a file gets written out on completion of TestSuiteB, but that seems entirely too hackish.

0
Comment actions Permalink

Do you really need snapshot dependency from DeployToStaging  on TestSuiteB?

0
Comment actions Permalink

I assume so, if I want DeployToStaging to deploy the same commit that was built by TestSuiteB. True?

0
Comment actions Permalink

It depends. If DeployToStaging is only doing a deployment and does not share source code with TestSuiteB and you want DeployToStaging to execute after every successful build of TestSuiteB then probably you do not need snapshot dependency in this case.

0
Comment actions Permalink

In this case, the source code *is* the application (it's Ruby on Rails), so getting the exact commit of the successful test run is critical.

0
Comment actions Permalink

Darrell, can you provide screenshots of the Settings tabs of all of the mentioned build configurations? Also please indicate what version of TeamCity you are using.

0
Comment actions Permalink
Here's a cut and paste of the settings. We're currently using 4.0.3, though I hope to get up to 4.5.1 soon.

General settings edit »
Name: deploy to staging
Description: none
Build number format: {0}, next build number: #21
Artifact paths: none specifed
Fail build if at least one test failed: ON
Execution timeout: disabled
Maximum number of simultaneously running builds: 1
Status widget: enabled

Version control settings edit »
VCS checkout mode: Automatically on agent (if supported by VCS roots)
Checkout directory: default
Clean all files before build: OFF
VCS labeling: disabled
Attached VCS roots:
Name Checkout rules Set label
PDXRails Github not specified NO

Runner: Command Line edit »
Type of runner: Command Line (Simple command execution)
Working directory: ../47ff832ab6f58406
Command executable: cap
Command parameters: staging deploy

Build triggering edit »
Build configuration is active (triggering enabled).
Trigger build by vcs check-in: ON
Quiet period: not specified
Start new build if last build is failed: OFF
Triggering by time: not configured
This configuration depends on:
PDXRails :: selenium

Dependencies edit »
Snapshot Dependencies:
Depends on Dependency options
PDXRails :: selenium
Do not run new build if there is a suitable one
Only use successful builds from suitable ones
PDXRails :: webrat
Do not run new build if there is a suitable one
Only use successful builds from suitable ones

Artifact dependencies:
There are no artifact dependencies.

Properties and environment variables edit »
System properties: none defined
Environment variables:
DEPLOY_VERSION: master
RAILS_ENV: staging

Agent requirements edit »
Requirements for system properties: none defined
Requirements for environment variables: none defined





Selenium testing (aka TestSuiteB)

General settings edit »
Name: selenium
Description: none
Build number format: {0}, next build number: #332
Artifact paths: log/**/*.log log/**/features*
Fail build if at least one test failed: ON
Execution timeout: disabled
Maximum number of simultaneously running builds: 1
Status widget: disabled

Version control settings edit »
VCS checkout mode: Automatically on agent (if supported by VCS roots)
Checkout directory: default
Clean all files before build: OFF
VCS labeling: disabled
Attached VCS roots:
Name Checkout rules Set label
PDXRails Github not specified NO

Runner: Rake edit »
Type of runner: Rake (Runner for executing Rake tasks, Test::Unit and RSpec tests)
Rakefile file: not specified
Working directory: same as checkout directory
Rake tasks: ci:stories:selenium
Additional Rake command line parameters: not specified
Launching Parameters:
  • Ruby interpreter path: will be searched in the PATH
  • Track invoke/execute stages OFF

Tests Parameters:
  • Tests options(TESTOPTS): not specified
  • RSpec options(SPEC_OPTS): not specified

Build triggering edit »
Build configuration is active (triggering enabled).
Trigger build by vcs check-in: OFF
Quiet period: not specified
Start new build if last build is failed: OFF
Triggering by time: not configured
This configuration depends on:
PDXRails :: default

Dependencies edit »
Snapshot Dependencies:
Depends on Dependency options
PDXRails :: default
Do not run new build if there is a suitable one
Only use successful builds from suitable ones

Artifact dependencies:
There are no artifact dependencies.

Properties and environment variables edit »
System properties: none defined
Environment variables:
DISPLAY: :2
RAILS_ENV: selenium

Agent requirements edit »
Requirements for system properties: none defined
Requirements for environment variables: none defined





And webrat (aka TestSuiteA)

General settings edit »
Name: webrat
Description: Webrat Features
Build number format: {0}, next build number: #73
Artifact paths: log/**/*.log log/**/features* log/**/*html
Fail build if at least one test failed: ON
Execution timeout: disabled
Maximum number of simultaneously running builds: 1
Status widget: enabled

Version control settings edit »
VCS checkout mode: Automatically on agent (if supported by VCS roots)
Checkout directory: default
Clean all files before build: OFF
VCS labeling: disabled
Attached VCS roots:
Name Checkout rules Set label
PDXRails Github not specified NO

Runner: Rake edit »
Type of runner: Rake (Runner for executing Rake tasks, Test::Unit and RSpec tests)
Rakefile file: not specified
Working directory: same as checkout directory
Rake tasks: ci:stories:webrat
Additional Rake command line parameters: not specified
Launching Parameters:
  • Ruby interpreter path: will be searched in the PATH
  • Track invoke/execute stages OFF

Tests Parameters:
  • Tests options(TESTOPTS): not specified
  • RSpec options(SPEC_OPTS): not specified

Build triggering edit »
Build configuration is active (triggering enabled).
Trigger build by vcs check-in: ON
Quiet period: not specified
Start new build if last build is failed: OFF
Triggering by time: not configured
This configuration depends on:
PDXRails :: default

Dependencies edit »
Snapshot Dependencies:
Depends on Dependency options
PDXRails :: default
Do not run new build if there is a suitable one
Only use successful builds from suitable ones

Artifact dependencies:
There are no artifact dependencies.

Properties and environment variables edit »
System properties: none defined
Environment variables:
RAILS_ENV: webrat

Agent requirements edit »
Requirements for system properties: none defined
Requirements for environment variables: none defined

0
Comment actions Permalink

I have the same problem and this is a big showstopper for me. Is there any solution? On busy days my "parent" build configuration never runs. Because vcs checkins between the initial trigger and the dependend configuration builds force to rerun this dependend builds over and over again, without trigger the parent one.

0
Comment actions Permalink

Please take a look at this issue: http://youtrack.jetbrains.net/issue/TW-8750
Is this your case?

0

Please sign in to leave a comment.