Automated building and testing

Hello,

Has anyone done any automated builds or testing with Unity? For example, I want to have a build generated every night and run some unit tests on the code and possibly a system test on gameplay logic. I looked at the command line arguments for Unity and didn’t see a way to automate building. For testing, I know you can embed DLLs and Unity hooks everything up for you. I don’t know if there is a way to specify command line arguments as to how to build a scene so it knows to embed the test DLL or not. Any help on this would be greatly appreciated. Thanks!

Yes, this is possible (and it makes sense to have an automated nightly build machine for bigger projects).

The argument you’re looking for is:

-executeMethod ClassName.MethodName

Then you need to implement ClassName.MethodName to perform all the build steps you need. They key here is the BuildPipeline class, which exposes the functionality to build players, assetbundles, etc.

Awesome :smile: I think that provides everything I need. Thanks!