1

I'm having a integrated environment with TFS BuildServer + TestControler + Several TestAgents.

Previously I used a *.testsettings file and define the remote server under Roles.

I update the BuildServer to VS2013 and introduced SpecRun for test executions.

As i'm having a custom *.srprofile file for TFS, I have to use a .runsettings file instead of .testsettings file.

I can not find a tag where i can define "Remote Controller name" in .runsettings file.

Is there a way to include 'Remote Controller name' in *.runsettings file??

I'm very new to Build Configurations. Any insight highly appreciated.

Additional Details:

I found this article and defined the .testsettings file path inside the .runsettings file. Following are the changed files according to the article. But It's not working. May be SpecRun Adaptor do not support tag.

TestSettings file i used.

<?xml version="1.0" encoding="UTF-8"?>
<TestSettings name=".........." id="........." xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
  <Description>Remote settings for running the tests on.....</Description>
  <Deployment>
    ....
  </Deployment>
  <RemoteController name=".....local:6901" />
  <Execution location="Remote">
    <TestTypeSpecific>
      <UnitTestRunConfig testTypeId=".....">
        <AssemblyResolution>
          <TestDirectory useLoadContext="true" />
        </AssemblyResolution>
      </UnitTestRunConfig>
    </TestTypeSpecific>
    <AgentRule name=".....">
    </AgentRule>
  </Execution>
   <Properties />
</TestSettings>

Sample *.runsettings file i'm using now.

<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
  <!-- Configurations that affect the Test Framework -->
  <RunConfiguration>
    <!-- Path relative to solution directory -->
    <ResultsDirectory>......</ResultsDirectory>
  </RunConfiguration>

  <SpecRun>
    <Profile>TFS.srprofile</Profile>
    <ReportFile>TestResults.html</ReportFile>
    <GenerateSpecRunTrait>true</GenerateSpecRunTrait>
    <GenerateFeatureTrait>false</GenerateFeatureTrait>
    <SettingsFile>.....\Remote.AutoTest_2013.testsettings</SettingsFile>
    <ForcedLegacyMode>true</ForcedLegacyMode>
  </SpecRun>
</RunSettings>
  • Hi, I'm trying to do the same thing but I don't believe it is possible. If you read this https://msdn.microsoft.com/en-us/library/ms182486.aspx it states mstest.exe can use a controller but there's no mention of vstest, which uses the runsettings file instead. It doesn't look like it's possible to use vstest with a controller/agent configuration sadly, and I've yet to find an alternative. – Ben Power Apr 11 '16 at 04:48
  • I had the same research output. Please be kind enough to let me know if you found any alternative. I'm very keen to know. Thanks.. – Anjana Kulasinghe Apr 12 '16 at 21:04

1 Answers1

0

OK, I think the mistake you've made is to use the runsettings file. You specify it in the testsettings file instead. Ours looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<TestSettings name="RemoteTest" id="9cfa5873-0238-4d56-a1ec-079192fa72c8" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
  <Description>Settings set up to run remotely through test controller</Description>
  <RemoteController name="**YOURCONTROLLERMACHINE**" />
  <Execution location="Remote" hostProcessPlatform="MSIL">
    <TestTypeSpecific>
      <UnitTestRunConfig testTypeId="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b">
        <AssemblyResolution>
          <TestDirectory useLoadContext="true" />
        </AssemblyResolution>
      </UnitTestRunConfig>
    </TestTypeSpecific>
    <AgentRule name="AllAgentsDefaultRole">
    </AgentRule>
  </Execution>
  <Properties />
</TestSettings>

You then call this from the command line, passing in the testsettings path:

"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" "C:\blahblah\TestsAssembly.dll" /Logger:trx /settings:C:\DummyTests\Remote.testsettings /Platform:x64

Where TestsAssembly.dll contains the tests you want to run, and Remote.testsettings is as above. The resultant .trx file appears in \TestResults...

You shouldn't need the runsettings file at all.

Ben Power
  • 1,786
  • 5
  • 27
  • 35