Unity3D build runner - anyone interested?

Is anyone aware of a Unity3d build runner plugin for Teamcity?

We are using both Unity3d and Teamcity and currently run our Unity builds via a simple command line Runner. But this is not ideal - you only get log files at the end of the build, build failures don't highlight useful information, etc.

At a previous company a Python script was used to manage the unity/teamcity interaction but I would like to create a proper Unity Build Runner plugin for Teamcity.

I know that Unity themselves use Teamcity for CI as they have written a blog post about it http://blogs.unity3d.com/2011/10/21/build-engineering-and-infrastructure-how-unity-does-it/

So I am going to make this plugin open source so that others can make use of/contribute to it.

I'll probably be starting this sometime in the next month, so wanted to check if others were interested or aware of anything first.

I think initial aims would be

* execute Unity3d on mac/windows platform
* provide 'live' log output during build
* provide access to unity command line options e.g. headless, nographics
* provide error highlighting/stack traces for common failures e.g. Compilation failures, build failure
* POSSIBLY support some .net unit test frameworks like NUnit lite
* POSSIBLY include support for publishing builds via SCP

Any other wanted features? Anyone interested in using this after its done?

Many thanks,


Comment actions Permalink

I don't have an answer to your question, however i am interested in knowing what kind of things are you doing with Unity3D?

Are you doing some sort of automation process for a game built with it? what are you building exactly?

I would love to hear since i am interested in those kind of things.


Comment actions Permalink

liortal wrote:

I don't have an answer to your question, however i am interested in knowing what kind of things are you doing with Unity3D?

Are you doing some sort of automation process for a game built with it? what are you building exactly?

I would love to hear since i am interested in those kind of things.


Good questions :)

At the moment we are building a Unity web player, producing a 3d game that uses the Unity3d web player plugin, so the output of that is a .unity3d file and a bunch of html files - eventually will have a number of asset bundles as well.

We have two builds, a 'full' build that runs every 4 hours (if there are changes) and this takes about 30 minutes because it does a light and occlusion bake, which are pretty slow.

The 'quick' build doesn't do the full lighting/occlusion bake ans so only takes about 2 minutes. This is just doing a normal 'unity build' which is some Mono compilation and asset processing.

We want to eventually do some Unit Testing as well, as there are various mono and .net compatible frameworks that could be hooked into Unity3d for running a little test suite.

At the moment our build is basically a command line invocation of Unity:
"%unity.exe%" -batchmode -nographics -quit -buildWebPlayer %system.teamcity.build.tempDir%\Target -projectPath %teamcity.build.workingDir% %unity_build_arguments%
type %unity.log%

The drawback to this approach is that you only see the unity log file after the build is finished :(

Currently we also have an automated deployment for the 'full' builds to an internal web server, which is just an scp command line call.

One nice feature of Teamcity is that we are using it to store the built artifacts, and have it show a results tab in both builds and for the Project overall. As this is just an html file, this means we can actually test the latest builds of our game directly from Teamcity - as Teamcity is acting as the web server. This is handy for sanity checking our incremental builds, but we dont' want to put too much load on the Teamcity server so we have a separate web server for full testing.

It's probably worth saying that as we haven't announced the game yet, I can't go into more details on some of the specifics ;) but its a 3d game in Unity basically!

Comment actions Permalink

Sounds good, what sort of unit testing frameworks are good for using with Unity3D? are these the standard NUnit, etc or u have to use specific ones for Mono?

I am interested in setting up an automated testing framework for Unity games, however i suspect that there's little support for it built in and you would have to do most of the stuff from scratch, or rely on having support from code that you wrote specifically for that in your game.

Comment actions Permalink

I don't believe we have settled on a unit testing framework yet for Unity but I know it is possible to make NUnitLite work

SharpUnit is a Unity-specific unit test framework:

There is also TestStar

But I haven't used either of those...

Fortunately Teamcity makes it very easy to register tests with, so I'm not that bothered about which unit test framework we end up using, it just may be worth adding support in the build runner for whatever is deemed 'popular'.

Automated testing of a whole game always tends to be a custom job, unfortunately, although in a web app you might be able to do something with Eggplant http://www.testplant.com/products/eggplant/ which we are using to unit test Flash web games.
There are some good games articles on this, in general I think your best bet is to make your game 'scriptable' in some way (obviously having mono makes this a bit easier to start with in unity) and then define some automation scripts + tests they can carry out.

e.g. there was a good talk from Paul DuBois on this at GDC a while back, it's using Lua scripting to test a console application but the concept is the same:

I think the pattern you could pull out of that is that automated game testing is going to have some setup, some tests and some tear down afterwards, so it won't be hugely different to unit tests in some ways. The actual executor is going to be different but if you could make your custom game tests produce a test results xml in a format that teamcity already understands - or you could parse into something that teamcity understands - then you can integrate it into your Teamcity builds.

Comment actions Permalink

Hi Mark,

Here at Unity Technologies we run a lot of Unity based TeamCity builds. It is done this way:
1) TeamCity executes perl script
2) Perl script starts Unity with necessary params
3) Perl script attaches to Unity log and copies it line by line into stdout as it is writen by Unity in runtime
4) Perl script terminates when Unity is done

With this setup you can send messages/status/data/test count and so on to TeamCity - you just have to Debug.Log("##teamcity foo baz bar") (or something like that, I can't remember TeamCity markup). And this way TeamCity status is updated in runtime.

I hope this helps.

Paulius Liekis

Comment actions Permalink



My name is Peng DU, I tried to use it but the Build Runner is incompatible with the agent, I created a post here already:



Anyone can help?


Thanks very much!


Please sign in to leave a comment.