Behavior of personal build on configuration with artifact dependency

Hi,

we're in a situation where it's not clear what the right behavior of TeamCity should be.

We have a Compile and a Test configurations.
The Compile configuration is triggered when files are checked into source control.
The Test configuration has only an artifact dependency on Compile.
Everything runs fine as long as we don't perform personal builds.
We would like to be able to run the Test configuration as a personal build from Visual Studio, either as a consequence to a successful run of a personal build of the Compile configuration or a standalone run where it would get the last artifacts generated by the Compile configuration, but we tried several times with no luck.

Is there a way to accomplish that?

Thanks

8 comments
Comment actions Permalink

If Compile produces artifacts and Test must use these artifacts to run tests then you need to add snapshot dependency from Test to Compile. Otherwise even without personal builds you may have a situation when Compile started with one number of changes while Test with another. Snapshot dependency provides source code synchronization, i.e. when Test starts on a number of changes Compile will be added in the queue on the same changes (in case of personal build - on the same personal changes).

Note that with snapshot dependency Test should depend on last finished build of Compile.

0
Comment actions Permalink

If Compile produces artifacts and Test must use these artifacts to run tests then you need to add snapshot dependency from Test to Compile. Otherwise even without personal builds you may have a situation when Compile started with one number of changes while Test with another.


Ok, but does this influence the triggering aspect? What I'm experiencing is that performing a personal build of Compile doesn't trigger the Test build confguration, while if this is done outside of a personal build Test is triggered correctly when Compile completes successfully (I have a dependency from Test to Compile, not a snapshot dependency tough).

0
Comment actions Permalink

You will need to run personal builds in Test configuration. This will automatically add Compile to the queue with your personal changes. When Compile finishes Test will start. And if artifact dependency uses last finished rule artifacts of Compile with personal changes will be taken.

0
Comment actions Permalink

I see that indeed adding a snapshop dependency changes the triggering aspect as well, but I'm not sure I understand why.

I mean, Test already had a normal depencency and an artifact dependency on Compile. In that case if I trigger a personal build of Test nothing happens.
If I add the snapshot dependency as well then the Test configuration runs correctly.

0
Comment actions Permalink

By normal dependency you mean dependency trigger? It is not actually a dependency. It is just a trigger which acts on event (probably name is confusing) - when succcessful build finishes new build is added to the queue, and nothing more. While having a snapshot dependency on a build is like having a requirement - to build Test you need to build Compile first (on the same sources).

0
Comment actions Permalink

By normal dependency you mean dependency trigger?


Yes, that's what I meant. So, just to sum up, if I wanto to build Test when Compile runs I have to

  • create a trigger dependency from Test to Compile
  • create an artifact dependency from Test to Compile
  • create a snapshop dependency from Test to Compile


That's a lot of work for what's probably the most common operation

0
Comment actions Permalink

We are working to simplify such configuration. BTW do you really need a dependency trigger in Test? If Test and Compile share same VCS root and have VCS triggering turned on then both will be added to queue when change appear. I doubt dependency trigger is required in this case.

0
Comment actions Permalink

Yes, it's the only trigger I have for Test, since it doesn't use any VCS root, it just depends on and uses the artifacts generated by the Compile configuration.

Thanks for your support.

0

Please sign in to leave a comment.