Personal Build, Remote Run, Pre-tested Commit
When working with a centralized version control system, where feature branches are not a part of the workflow, you normally have two options:
Build the solution and run tests locally before you commit your changes to the main branch. This way you can make sure that you will not introduce any problems to the repository, but you might spend significant time waiting until the build and tests are over.
Commit your untested changes to the main branch of your repository and then run build and tests on your build server. This way you can continue working after the commit, but at the risk of breaking the repository.
With TeamCity Add-in, you have a third option - you can quickly create a personal build, which will only be visible to you and include your selected non-committed changes.
Then you can initiate a remote run on the TeamCity server - TeamCity Add-in will take a snapshot of the selected changes, send them to your TeamCity server and start your personal build and tests. Note that by doing this, you do not commit anything to your VCS, and you can continue working while your changes are built and tested remotely.
You can use the pre-tested commit option to automatically commit your changes only if your personal build succeeds.
Run a personal build on your TeamCity server
Choosein the main menu.
In the Local Changes window, choose the changes that you want to include into the remote build. If you do not see some of your changes, click Re-collect Local Changes on the toolbar
Click Configure Personal Build on the toolbar. This will open the Personal Build dialog.
The dialog will display the build configurations whose sources were modified in the Visual Studio on your machine, as well as their snapshot-dependent build configurations. They are listed if the VCS settings of the TeamCity Add-in and the VCS root on the TeamCity server are the same, and the checkout paths are configured properly. Select the configurations that you want to run with your changes.
Optionally, you can customize each build configuration. To do so, right-click the desired configuration and choose Customize build or click the corresponding button on the toolbar.
If your project's VCS is TFS or Perforce, you can configure additional VCS-specific settings on the corresponding tab.
Type a comment for your changes or select one of the previous comments from the Recent comments list.
If you want to automatically commit selected changes on a successful build, select Pre-tested Commit and then choose the condition of a successful build in the Commit if selector.
Note that TeamCity Add-in will commit the selected changes as they are at the moment of starting the personal build. Therefore, you can go on working on your project and be sure that untested changes will not be committed.
Click Run to start your personal build with specified parameters.
You can monitor execution of your personal builds in two ways:
On the web interface of your TeamCity server, your personal builds are designated with the corresponding icons. For example, in the illustration below, the failed build is a personal one.
Selectin the main menu and check states of your changes:
Similarly to the TeamCity web UI, changes corresponding to personal builds are designated with special icons. If necessary, you can click Hide non-personal on the toolbar, so that only changes corresponding to personal builds are displayed in the list.
You can see a brief summary of each remote run underneath the corresponding change set, and click it to see more details. Information in this view is provided by your TeamCity server.
If necessary, you can view any of the changesets or build details in the web UI of your TeamCity server. To do so, select the desired item and click Open in Web on the toolbar.
For more information, see Analyzing Server Changesets, Builds, and Tests.