Execute unit tests in TFS Preview?
-
Saturday, September 01, 2012 7:53 PM
When I'm using the AzureContinuousDeployment.11.xaml Build proces file, the test project is not compiled and executed.
It's working correctly when I'm using the DefaultTemplate.11.xaml.
This means that my solution is deployed to my Cloud Service, even when I have failing tests. Is this feature not supported yet, or am I doing something wrong?
- Moved by Cathy KongMicrosoft Contingent Staff, Moderator Tuesday, September 04, 2012 8:48 AM (From:Team Foundation Server - General)
All Replies
-
Tuesday, September 04, 2012 8:47 AMModerator
Hi Bert_Erneus,
Thanks for your post!
I am moving the thread to TFS Preview for better response.
Hope it helps!
Best Regards,
Cathy Kong [MSFT]
MSDN Community Support | Feedback to us
-
Wednesday, September 05, 2012 9:41 AM
Hi Bert,
Can you show us the detail build log?
-
Wednesday, September 05, 2012 6:42 PM
This is the log:
Overall Build Process
00:00
Update Build Number
10:14
Run On Agent (reserved build agent Hosted Build Agent)
00:00
Create Workspace
00:16
Get Workspace
00:01
Create Label
08:35
Compile, Test, and Associate Changesets and Work Items
08:35
Compile and Test
00:00
Get Default Azure Cloud Service Publish Profile
00:00
Set Project to build CSPack
00:51
Run MSBuild for Project
00:32
Built $/Azure development/WindowsAzure5/WindowsAzure5.sln for target(s) WindowsAzure5:Publish.
00:31
Built $/Azure development/WindowsAzure5/WindowsAzure5/WindowsAzure5.ccproj for target(s) Publish.
00:06
Built $/Azure development/WindowsAzure5/MvcWebRole1/MvcWebRole1.csproj for default targets.
00:00
Built $/Azure development/WindowsAzure5/MvcWebRole1/MvcWebRole1.csproj for target(s) GetTargetFrameworkVersion.
00:00
Built $/Azure development/WindowsAzure5/MvcWebRole1/MvcWebRole1.csproj for target(s) PipelineTransformPhase.
00:00
Built $/Azure development/WindowsAzure5/MvcWebRole1/MvcWebRole1.csproj for target(s) GetTargetFrameworkDirectories;GetTargetFrameworkMoniker;GetTargetFrameworkMonikerDisplayName.
00:00
Built $/Azure development/WindowsAzure5/MvcWebRole1/MvcWebRole1.csproj for target(s) BuiltProjectOutputGroupDependencies.
MvcWebRole1: The configuration setting 'Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString' is set up to use the local storage emulator for role 'MvcWebRole1' in configuration file 'ServiceConfiguration.Cloud.cscfg'. To access Windows Azure storage services, you must provide a valid Windows Azure storage connection string.
MvcWebRole1: The connection string 'DefaultConnection' is using a local database '(LocalDb)\v11.0' in project 'MvcWebRole1'. This connection string will not work when you run this application in Windows Azure. To access a different database, you should update the connection string in the web.config file.
For more details about this, see the following help page: http://go.microsoft.com/fwlink/?LinkId=224877
07:41
Publish Output
07:41
Deploy application to Azure
9/1/2012 7:20:57 PM - Preparing deployment for Eindelijk with SubscriptionID: ba6eef14-6733-4300-809b-441754f937b9...
9/1/2012 7:20:57 PM - Connecting...
9/1/2012 7:21:00 PM - Verifying storage account 'autodeploytesting'.
9/1/2012 7:21:02 PM - Uploading package...
9/1/2012 7:21:32 PM - Creating...
9/1/2012 7:23:03 PM - Created Deployment ID: 95c019ec82e940b6ad8e23babfe7580c.
9/1/2012 7:23:03 PM - Starting...
9/1/2012 7:23:37 PM - Initializing...
9/1/2012 7:23:38 PM - Instance 0 of role MvcWebRole1 is in an unknown state.
9/1/2012 7:24:47 PM - Instance 0 of role MvcWebRole1 is creating the virtual machine.
9/1/2012 7:26:09 PM - Instance 0 of role MvcWebRole1 is starting the virtual machine.
9/1/2012 7:27:29 PM - Instance 0 of role MvcWebRole1 is busy.
9/1/2012 7:28:37 PM - Instance 0 of role MvcWebRole1 is ready.
9/1/2012 7:28:37 PM - Created Website URL: http://224fa4c4cd4b4ebe8b35dfc9be451fc9.cloudapp.net/.
9/1/2012 7:28:37 PM - Complete.
00:00
Associate Changesets and Work Items
00:18
Get Impacted Tests, Index Sources and Publish Symbols
00:06
Get Impacted Tests
00:11
Index Sources
00:41
Drop Files to Drop Location -
Wednesday, September 05, 2012 7:22 PM
This are the steps I took (mostly the defaults):
Start Visual Studio 2012
New project - Windows Azure Cloud Service - .Net Framework 4.0
Select 1 role: ASP.NET MVC 4 Web Role
Template: Internet Application - set Check to 'Create a unit test project'
After the solution is created I altered the first unit test.
Original version:
[TestMethod] public void Index() { // Arrange HomeController controller = new HomeController(); // Act ViewResult result = controller.Index() as ViewResult; // Assert Assert.AreEqual("Modify this template to jump-start your ASP.NET MVC application.", result.ViewBag.Message); }
new version:
[TestMethod]
public void Index()
{
Assert.IsTrue(false);
}The new code makes the test fail, which is exactly what I want.
Next step:
Right click on solution and choose Add solution to source control.
After the solution is added I check in the pending changes.
Now i create a New Build Definition. The trigger is Continuous integration. Under 'process' I set 'Fail Build on test Failure' to True.
Make a change to the source code, and check in the pending change to trigger the build.
The build executes as expected, and the Test Run failed, as expected:
Overall Build Process
00:00
Update Build Number
02:01
Run On Agent (reserved build agent Hosted Build Agent)
00:00
Create Workspace
00:31
Get Workspace
00:01
Create Label
00:57
Compile, Test, and Associate Changesets and Work Items
00:57
Compile and Test
00:32
Run MSBuild for Project
00:09
Built $/Azure development/WindowsAzure6/WindowsAzure6.sln for default targets.
00:06
Built $/Azure development/WindowsAzure6/WindowsAzure6/WindowsAzure6.ccproj for default targets.
00:03
Built $/Azure development/WindowsAzure6/MvcWebRole1/MvcWebRole1.csproj for default targets.
00:00
Built $/Azure development/WindowsAzure6/MvcWebRole1/MvcWebRole1.csproj for default targets.
00:01
Built $/Azure development/WindowsAzure6/MvcWebRole1.Tests/MvcWebRole1.Tests.csproj for default targets.
00:00
Built $/Azure development/WindowsAzure6/MvcWebRole1/MvcWebRole1.csproj for default targets.
MSBuild Log File
00:24
Run Agile Test Runner for Test Sources
Failed Index
Test Run Failed.
00:00
Handle Test Run Exception
00:00
Associate Changesets and Work Items
00:03
Get Impacted Tests, Index Sources and Publish Symbols
00:00
Get Impacted Tests
00:03
Index Sources
00:10
Copy Files to Drop LocationAs you can see 'MvcWebRole1.Tests.csproj' is built.
Now, part two, change the Build Template to deploy to Windows Azure:
Edit the build definition, go to Process and Change the build proces template to AzureContinuousDeployment.11.xaml.
Under 4. Publishing General I added the Azure Service name I want to deploy to in Deployment Settings Name.
That's all. Now when I make a change to the source code and check in the pending changes, the build is triggered, but the Tests project is not build, as you can see in the log I pasted in the previous message.
Hope this helps.
-
Friday, September 07, 2012 4:13 PMAny info on this yet?
-
Thursday, September 13, 2012 8:59 PMOwner
Bert,
A support ticket has been created for this issue. Can you please send me your email address to anj-2011@hotmail.com and we will contact you with updates on this issue.
- Marked As Answer by Anjana Mazumder MSFTMicrosoft Employee, Owner Thursday, September 13, 2012 8:59 PM
-
Friday, October 19, 2012 2:52 PM
I have the same issue, but I am running build controller with on-premise TFS 2012.
Is there any fix?
-
Tuesday, November 13, 2012 4:51 PM
Bert,
Can you help me figure out what I'm supposed to enter into Deployment Settings Name? Every time I try, I get
The DeploymentEnvironment with name <whatever I entered into Deployment Settings Name> does not exist. (type DeploymentEnvironmentNotFoundException)
-
Monday, February 11, 2013 5:34 PMI have the same issue. Did you find a solution?
-
Monday, February 11, 2013 5:46 PMI haven't worked on this in a while, but I believe I solved the problem by deleting and re-creating the build. Figuring I somehow bunked the build on my own rather than it being Microsoft's fault..
I'm not a player, I just code a lot.

