2

我正在使用 Team Foundations Services 和 Windows Azure。我的解决方案有一个 MsUnitTest 项目,其中包含我所有的单元测试。我正在尝试做的事情:签入我的源代码并在发布到 azure 之前,我希望 TFS 运行我的单元测试。

我打破了一个单元进行测试,检查它是否会发布或执行回滚,不幸的是它正在发布。

在我的构建定义/过程中,我使用"**\*test*.dll"测试源规范的默认值,并且我还尝试了完整路径“$/root-folder/mstestproject/nameofassembly.dll”,但都没有成功。

Ps:上面的路径(“$/root-folder/mstestproject/nameofassembly.dll”)只是一个示例。

我做错了什么?

完整的测试项目程序集名称:“Ipe.Tests.dll”

构建定义:

<Activity mc:Ignorable="sad" x:Class="TfsBuild.Process" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mt="clr-namespace:Microsoft.TeamFoundation;assembly=Microsoft.TeamFoundation.Common" xmlns:mtb="clr-namespace:Microsoft.TeamFoundation.Build.Common;assembly=Microsoft.TeamFoundation.Build.Common" xmlns:mtbc="clr-namespace:Microsoft.TeamFoundation.Build.Client;assembly=Microsoft.TeamFoundation.Build.Client" xmlns:mtbw="clr-namespace:Microsoft.TeamFoundation.Build.Workflow;assembly=Microsoft.TeamFoundation.Build.Workflow" xmlns:mtdwa="clr-namespace:Microsoft.TeamFoundation.Deployment.Workflow.Activities;assembly=Microsoft.TeamFoundation.Deployment.Workflow" xmlns:mtdw="clr-namespace:Microsoft.TeamFoundation.Deployment.Workflow;assembly=Microsoft.TeamFoundation.Deployment.Workflow" xmlns:mtbwa="clr-namespace:Microsoft.TeamFoundation.Build.Workflow.Activities;assembly=Microsoft.TeamFoundation.Build.Workflow" xmlns:mtbwt="clr-namespace:Microsoft.TeamFoundation.Build.Workflow.Tracking;assembly=Microsoft.TeamFoundation.Build.Workflow" xmlns:mttbb="clr-namespace:Microsoft.TeamFoundation.TestImpact.BuildIntegration.BuildActivities;assembly=Microsoft.TeamFoundation.TestImpact.BuildIntegration" xmlns:mtvc="clr-namespace:Microsoft.TeamFoundation.VersionControl.Client;assembly=Microsoft.TeamFoundation.VersionControl.Client" xmlns:mtvco="clr-namespace:Microsoft.TeamFoundation.VersionControl.Common;assembly=Microsoft.TeamFoundation.VersionControl.Common" xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:sad="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:sad1="clr-namespace:System.Activities.Debugger;assembly=System.Activities" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib" xmlns:sl="clr-namespace:System.Linq;assembly=System.Core" xmlns:this="clr-namespace:TfsBuild;" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <x:Members>
    <x:Property Name="SolutionToBuild" Type="InArgument(x:String)" />
    <x:Property Name="ConfigurationsToBuild" Type="InArgument(mtbwa:PlatformConfigurationList)" />
    <x:Property Name="TestSpecs" Type="InArgument(mtbwa:TestSpecList)" />
    <x:Property Name="BuildNumberFormat" Type="InArgument(x:String)" />
    <x:Property Name="CleanWorkspace" Type="InArgument(mtbwa:CleanWorkspaceOption)" />
    <x:Property Name="RunCodeAnalysis" Type="InArgument(mtbwa:CodeAnalysisOption)" />
    <x:Property Name="SourceAndSymbolServerSettings" Type="InArgument(mtbwa:SourceAndSymbolServerSettings)" />
    <x:Property Name="AgentSettings" Type="InArgument(mtbwa:AgentSettings)" />
    <x:Property Name="AssociateChangesetsAndWorkItems" Type="InArgument(x:Boolean)" />
    <x:Property Name="CreateWorkItem" Type="InArgument(x:Boolean)" />
    <x:Property Name="MSBuildArguments" Type="InArgument(x:String)" />
    <x:Property Name="MSBuildPlatform" Type="InArgument(mtbwa:ToolPlatform)" />
    <x:Property Name="MSBuildMultiProc" Type="InArgument(x:Boolean)" />
    <x:Property Name="PerformTestImpactAnalysis" Type="InArgument(x:Boolean)" />
    <x:Property Name="CreateLabel" Type="InArgument(x:Boolean)" />
    <x:Property Name="DisableTests" Type="InArgument(x:Boolean)" />
    <x:Property Name="GetVersion" Type="InArgument(x:String)" />
    <x:Property Name="PrivateDropLocation" Type="InArgument(x:String)" />
    <x:Property Name="Verbosity" Type="InArgument(mtbw:BuildVerbosity)" />
    <x:Property Name="Metadata" Type="mtbw:ProcessParameterMetadataCollection" />
    <x:Property Name="SupportedReasons" Type="mtbc:BuildReason" />
    <x:Property Name="DeploymentEnvironmentName" Type="InArgument(x:String)" />
    <x:Property Name="AllowUntrustedCertificates" Type="InArgument(x:Boolean)" />
    <!-- Additional Cloud Service Overrides -->
    <x:Property Name="AlternatePublishProfile" Type="InArgument(x:String)" />
    <x:Property Name="AlternateHostedServiceName" Type="InArgument(x:String)" />
    <x:Property Name="AllowUpgrade" Type="InArgument(x:Boolean)" />
    <!-- NOTE: this deliberately a String instead of Enum type so it can easily be set by server code. -->
    <x:Property Name="AlternateDeploymentSlot" Type="InArgument(x:String)" />
    <x:Property Name="AlternateStorageAccountName" Type="InArgument(x:String)" />
    <x:Property Name="AlternateDeploymentLabel" Type="InArgument(x:String)" />
    <x:Property Name="AlternateServiceConfiguration" Type="InArgument(x:String)" />
    <!-- Additional Web Deploy Overrides -->
    <x:Property Name="AlternateWebDeployPublishProfile" Type="InArgument(x:String)" />
  </x:Members>
  <this:Process.SolutionToBuild>
    <InArgument x:TypeArguments="x:String" />
  </this:Process.SolutionToBuild>
  <this:Process.ConfigurationsToBuild>[New Microsoft.TeamFoundation.Build.Workflow.Activities.PlatformConfigurationList()]</this:Process.ConfigurationsToBuild>
  <this:Process.DisableTests>[False]</this:Process.DisableTests>
  <this:Process.TestSpecs>[New Microsoft.TeamFoundation.Build.Workflow.Activities.TestSpecList(New Microsoft.TeamFoundation.Build.Workflow.Activities.AgileTestPlatformSpec("**\*test*.dll") With { .FailBuildOnFailure = True } )]</this:Process.TestSpecs>
  <this:Process.BuildNumberFormat>["$(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.r)"]</this:Process.BuildNumberFormat>
  <this:Process.AssociateChangesetsAndWorkItems>[True]</this:Process.AssociateChangesetsAndWorkItems>
  <this:Process.CreateWorkItem>[True]</this:Process.CreateWorkItem>
  <this:Process.CleanWorkspace>[Microsoft.TeamFoundation.Build.Workflow.Activities.CleanWorkspaceOption.All]</this:Process.CleanWorkspace>
  <this:Process.MSBuildArguments>
    <InArgument x:TypeArguments="x:String" />
  </this:Process.MSBuildArguments>
  <this:Process.RunCodeAnalysis>[Microsoft.TeamFoundation.Build.Workflow.Activities.CodeAnalysisOption.AsConfigured]</this:Process.RunCodeAnalysis>
  <this:Process.MSBuildMultiProc>[True]</this:Process.MSBuildMultiProc>
  <this:Process.MSBuildPlatform>[Microsoft.TeamFoundation.Build.Workflow.Activities.ToolPlatform.Auto]</this:Process.MSBuildPlatform>
  <this:Process.PerformTestImpactAnalysis>[True]</this:Process.PerformTestImpactAnalysis>
  <this:Process.SourceAndSymbolServerSettings>[New Microsoft.TeamFoundation.Build.Workflow.Activities.SourceAndSymbolServerSettings(True, Nothing)]</this:Process.SourceAndSymbolServerSettings>
  <this:Process.CreateLabel>[True]</this:Process.CreateLabel>
  <this:Process.GetVersion>
    <InArgument x:TypeArguments="x:String" />
  </this:Process.GetVersion>
  <this:Process.AgentSettings>[New Microsoft.TeamFoundation.Build.Workflow.Activities.AgentSettings() With {.MaxWaitTime = New System.TimeSpan(4, 0, 0), .MaxExecutionTime = New System.TimeSpan(0, 0, 0), .TagComparison = Microsoft.TeamFoundation.Build.Workflow.Activities.TagComparison.MatchExactly }]</this:Process.AgentSettings>
  <this:Process.Verbosity>[Microsoft.TeamFoundation.Build.Workflow.BuildVerbosity.Normal]</this:Process.Verbosity>
  <this:Process.AllowUntrustedCertificates>[True]</this:Process.AllowUntrustedCertificates>
  <this:Process.AllowUpgrade>[True]</this:Process.AllowUpgrade>
4

0 回答 0