2
votes

I am tasked to improve quality and implement TeamCity for continuous integration. My experience with TeamCity is very limited - I use mostly TFS myself and have some experience with CC.NET.

A lot should happen within a build process... actually the build is already pushed into three different configurations that will run one after the next.

My main problem is that in each of those I actually would need to start multiple runners. For example, the first build step shall consist of:

  • The generation of new AssemblyInfo.cs files for consistent in assembly numbering
  • The actual compilation
  • A partial unit test run (all tests that run fast and check core functionality)
  • An FxCop run
  • A StyleCop run

The current version of TeamCity only allows to configure one runner ... which leaves me stuck with a lot of things.

How you would approach this? My current idea is going towards using the MsBuild runner for everything and basically start my own MsBuild based script which then does all the things, pretty much the way that TFS handles it (and the same way i did things back in the cc.net way with my own Nant build script).

On a further problem the question is how to present statistical information, for example from unit tests running in different stages (build configurations). We have some further down that take some time to run and want that to run in a 2nd or 3rd step (the latest for example testing database generation code which, including loading base data, takes about 15+ minutes to run). OTOH we would really like test results to be somehow consolidated.

Anyone any ideas?

Thanks.

3

3 Answers

4
votes

TeamCity 6.0 allows multiple build steps for a single build configuration. Isn't it what you're looking for?

1
votes

You'll need to script this out, at least parts of it. TeamCity provides some nice UI based config for some of your needs, but not all. Here's my suggestion:

Create an msbuild script to handle your first two bullet points, AssemblyInfo generation and compilation. Configure the msbuild runner to run your script, and to run your tests. Collect your assemblies as artifacts.

Create a second build configuration for FxCop. Trigger it from the first build. Give it an 'artifact dependency' on the first build, which is how it gets a hold of your dlls.

For StyleCop, TC doesn't support it out of the box like it does FxCop. Add it to your msbuild script manually, and have it produce an html report (which TeamCity can then display).

0
votes

You need to take a look at the Dependencies functionality in the TeamCity. This feature allows you to create a sequence of build configurations. In other words, you need to create a build configuration for each step and then link all them as dependencies. For consolidating test results please take a loot at the Artifact Dependencies. It might help.