TFS 构建和测试影响
我正在尝试 TFS 构建的测试影响功能。 如果您使用 .vsdmi 文件,则似乎无法使用此功能,但前提是您使用 .testsettings 文件(尽管 VSDMI 文件包含对测试设置文件的引用)。
我已在测试设置文件中允许测试影响,等等 TFS 构建配置。 我需要使用 VSDMi 文件的原因是我创建了一个想要在 CI 中执行的测试列表。问题是所有版本都显示“无影响测试”,尽管我知道有一些。
我在这里错过了什么吗?请查找附件中的 vsdmi 文件、测试设置文件和 TFS 构建配置的快照。
这是 .testsettings 文件的内容:
<?xml version="1.0" encoding="UTF-8"?>
<TestSettings name="Master" id="68af9170-92f5-49d8-83dd-827359a79042" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<Description>These are default test settings for a local test run.</Description>
<Deployment>
<DeploymentItem filename="..\Common\Terra.Environment.Common.Data.Test\TpEnvFileParser\InputFiles\" />
<DeploymentItem filename="..\Common\Terra.Environment.Fake\FakeData\HSW\Resources" />
<DeploymentItem filename="..\Tpie.Engines.Build\Tpie.Engines.Build.Test\ExpectedFiles\" />
<DeploymentItem filename="..\Tpie.Engines.Build\Tpie.Engines.Build.Test\Resources\" />
<DeploymentItem filename="..\Common\Terra.Environment.Common.Model\bin\Debug\TerraEntitiesModel.ssdl" />
<DeploymentItem filename="..\Common\Terra.Environment.Common.Model\bin\Debug\TerraEntitiesModel.csdl" />
<DeploymentItem filename="..\Common\Terra.Environment.Common.Data.Test\PListFileParser\InputFiles\" />
<DeploymentItem filename="..\Common\Terra.Environment.Common.Model\bin\Debug\TerraEntitiesModel.msl" />
<DeploymentItem filename="..\Tpie.Client\Tpie.Client.Common.Test\ExcelParsers\InputFiles\" />
<DeploymentItem filename="..\Tpie.Engines.Build\Tpie.Engines.Build.TestProgram\Templates\" />
</Deployment>
<Execution>
<ExecutionThread apartmentState="MTA" />
<Timeouts runTimeout="1800000" testTimeout="300000" />
<TestTypeSpecific>
<UnitTestRunConfig testTypeId="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b">
<AssemblyResolution>
<TestDirectory useLoadContext="true" />
</AssemblyResolution>
</UnitTestRunConfig>
<WebTestRunConfiguration testTypeId="4e7599fa-5ecb-43e9-a887-cd63cf72d207">
<Browser name="Internet Explorer 7.0">
<Headers>
<Header name="User-Agent" value="Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)" />
<Header name="Accept" value="*/*" />
<Header name="Accept-Language" value="{{$IEAcceptLanguage}}" />
<Header name="Accept-Encoding" value="GZIP" />
</Headers>
</Browser>
</WebTestRunConfiguration>
</TestTypeSpecific>
<AgentRule name="LocalMachineDefaultRole">
<DataCollectors>
<DataCollector uri="datacollector://Microsoft/TestImpact/1.0" assemblyQualifiedName="Microsoft.VisualStudio.TraceCollector.TestImpactDataCollector, Microsoft.VisualStudio.TraceCollector, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
</DataCollector>
</DataCollectors>
</AgentRule>
</Execution>
</TestSettings>
这是 .vsmdi 文件:
<?xml version="1.0" encoding="UTF-8"?>
<TestLists xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<TestList name="TPIE Auto Build" id="2cbc1525-8079-4959-a126-4d4fb8fdb803" parentListId="8c43106b-9dc1-4907-a29f-aa66a61bf5b6">
<TestLinks>
<TestLink id="ee8dae77-c23e-df6b-c6b5-4be930087750" name="LevelTestConditionGroupCheckCalculationDataTypeVoltageTest" storage="..\tpie.client\tpie.client.common.test\bin\debug\tpie.client.common.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<TestLink id="74441000-f8e5-ac1b-fbd6-bb94da0bf3ce" name="LevelPowerSequenceBlockCheckSequenceElementTest" storage="..\tpie.client\tpie.client.common.test\bin\debug\tpie.client.common.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<TestLink id="afb21bed-4eff-9f9f-7e58-c72e7d133b32" name="TestGetMiscEnvironmentVariables" storage="..\server\terra.binmatrix.server.test\bin\debug\terra.server.bl.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</TestLinks>
</TestList>
<TestList name="Lists of Tests" id="8c43106b-9dc1-4907-a29f-aa66a61bf5b6">
<RunConfiguration id="68af9170-92f5-49d8-83dd-827359a79042" name="Master" storage="master.testsettings" type="Microsoft.VisualStudio.TestTools.Common.TestRunConfiguration, Microsoft.VisualStudio.QualityTools.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</TestList>
</TestLists>
谢谢, 布西
I'm playing around with the Test Impact feature of TFS build.
It seems like you cannot use this feature if you are using a .vsdmi file, but only if you use a .testsettings file (although the VSDMI file includes a reference to the test settings file).
I have allowed Test Impact in the test settings file, and so on the TFS build configuration.
The reason I need to use the VSDMi file is that I created a test list that i want to be executed in CI. The problem is that all builds show "No Impacted Test" though I know there are some.
Am I missing something here? Please find attached the vsdmi file, the testsettings file and a snapshot of the TFS build configuration.
Here is the content of the .testsettings file:
<?xml version="1.0" encoding="UTF-8"?>
<TestSettings name="Master" id="68af9170-92f5-49d8-83dd-827359a79042" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<Description>These are default test settings for a local test run.</Description>
<Deployment>
<DeploymentItem filename="..\Common\Terra.Environment.Common.Data.Test\TpEnvFileParser\InputFiles\" />
<DeploymentItem filename="..\Common\Terra.Environment.Fake\FakeData\HSW\Resources" />
<DeploymentItem filename="..\Tpie.Engines.Build\Tpie.Engines.Build.Test\ExpectedFiles\" />
<DeploymentItem filename="..\Tpie.Engines.Build\Tpie.Engines.Build.Test\Resources\" />
<DeploymentItem filename="..\Common\Terra.Environment.Common.Model\bin\Debug\TerraEntitiesModel.ssdl" />
<DeploymentItem filename="..\Common\Terra.Environment.Common.Model\bin\Debug\TerraEntitiesModel.csdl" />
<DeploymentItem filename="..\Common\Terra.Environment.Common.Data.Test\PListFileParser\InputFiles\" />
<DeploymentItem filename="..\Common\Terra.Environment.Common.Model\bin\Debug\TerraEntitiesModel.msl" />
<DeploymentItem filename="..\Tpie.Client\Tpie.Client.Common.Test\ExcelParsers\InputFiles\" />
<DeploymentItem filename="..\Tpie.Engines.Build\Tpie.Engines.Build.TestProgram\Templates\" />
</Deployment>
<Execution>
<ExecutionThread apartmentState="MTA" />
<Timeouts runTimeout="1800000" testTimeout="300000" />
<TestTypeSpecific>
<UnitTestRunConfig testTypeId="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b">
<AssemblyResolution>
<TestDirectory useLoadContext="true" />
</AssemblyResolution>
</UnitTestRunConfig>
<WebTestRunConfiguration testTypeId="4e7599fa-5ecb-43e9-a887-cd63cf72d207">
<Browser name="Internet Explorer 7.0">
<Headers>
<Header name="User-Agent" value="Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)" />
<Header name="Accept" value="*/*" />
<Header name="Accept-Language" value="{{$IEAcceptLanguage}}" />
<Header name="Accept-Encoding" value="GZIP" />
</Headers>
</Browser>
</WebTestRunConfiguration>
</TestTypeSpecific>
<AgentRule name="LocalMachineDefaultRole">
<DataCollectors>
<DataCollector uri="datacollector://Microsoft/TestImpact/1.0" assemblyQualifiedName="Microsoft.VisualStudio.TraceCollector.TestImpactDataCollector, Microsoft.VisualStudio.TraceCollector, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
</DataCollector>
</DataCollectors>
</AgentRule>
</Execution>
</TestSettings>
And here is the .vsmdi file:
<?xml version="1.0" encoding="UTF-8"?>
<TestLists xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<TestList name="TPIE Auto Build" id="2cbc1525-8079-4959-a126-4d4fb8fdb803" parentListId="8c43106b-9dc1-4907-a29f-aa66a61bf5b6">
<TestLinks>
<TestLink id="ee8dae77-c23e-df6b-c6b5-4be930087750" name="LevelTestConditionGroupCheckCalculationDataTypeVoltageTest" storage="..\tpie.client\tpie.client.common.test\bin\debug\tpie.client.common.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<TestLink id="74441000-f8e5-ac1b-fbd6-bb94da0bf3ce" name="LevelPowerSequenceBlockCheckSequenceElementTest" storage="..\tpie.client\tpie.client.common.test\bin\debug\tpie.client.common.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<TestLink id="afb21bed-4eff-9f9f-7e58-c72e7d133b32" name="TestGetMiscEnvironmentVariables" storage="..\server\terra.binmatrix.server.test\bin\debug\terra.server.bl.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</TestLinks>
</TestList>
<TestList name="Lists of Tests" id="8c43106b-9dc1-4907-a29f-aa66a61bf5b6">
<RunConfiguration id="68af9170-92f5-49d8-83dd-827359a79042" name="Master" storage="master.testsettings" type="Microsoft.VisualStudio.TestTools.Common.TestRunConfiguration, Microsoft.VisualStudio.QualityTools.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</TestList>
</TestLists>
Thanks,
Busi
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这有点棘手,但很有效。
如果要运行测试影响分析,您需要设置
Disable Test = true
和Analyse Test Impact = true
。我已经完成了以下
It is a little bit tricky, but it works.
If you want to run the test impact analysis you need to set
Disable Test = true
andAnalyse Test Impact = true
.I have done the following
您需要使用以下步骤来运行测试。
通过这个你可以看到日志,无论你的构建是否正在获取测试 dll。
You need to use the below steps to run your test.
through this you can see the log whether your build is getting test dll or not.