I have a test solution (TestSolutionA) which contains a test project (TestProjectA: containing system tests with NUnit) and have a reference to another existing project (ProjectB) since my test project needs to read some of the classes of that project such as EmailHelper.
Folder structure in TFS:
*Root
**Tests
***References
***TestSolutionA
****TestProjectA
**ClassLibraries
***ProjectB
The References folder contains assemblies such as NUnit.dll, etc which are used by the TestProjectA.
Now I have configured TeamCity so that it builds the TestSolutionA and runs the tests of the TestProjectA. This means that when the TestSolutionA is built, all the files and folders which have been referenced in this solution are checked out to a “Check Out Directory” and then the solution builds.
The problem is that this test solution is slow to build because each time it has to check out/export all the files and folders of the ProjectB to the TeamCity Server and rebuild them whereas only the dll of the ProjectB is required not all files/classes which are in it.
The problem appears more when more external projects are involved.
Would there be any better solution to speed up the build in such scenarios where a test project has to reference external projects? e.g. building the assembly on the fly rather than checking them out/exporting them to the TeamCity Server.
Not sure it’s possible.
Hope the question is clear.
Thanks,
What you need to do is to create a separate TeamCity build configuration for ProjectB that builds the DLL and publishes it as an artifact. You can then configure the TestSolution build configuration so that it has an artifact dependency on the ProjectB DLL. This way your TestSolution build configuration won’t have to pull any source code for ProjectB at all.
Some useful links in the TeamCity documentation are:
http://confluence.jetbrains.net/display/TCD65/Build+Artifact
http://confluence.jetbrains.net/display/TCD65/Artifact+Dependencies