DeploymentEnabled false не работает в моем файле runsettings - PullRequest
0 голосов
/ 10 июля 2020

В настоящее время я обновился до Visual Studio 2017 Enterprise Edition версии 15.9.24. Проблема, с которой я столкнулся, заключается в том, что я не могу отладить свой тест с помощью файла runsettings. Когда я отлаживаю тест, он получает доступ к любым DLL и развернутым файлам из моей папки TestResults Out вместо папки bin / debug, поскольку я нахожусь в режиме отладки. Когда я запускал Visual Studio 2015, я использовал файл .testsettings и смог запустить свой тест из папки bin / debug. Поскольку .testsettings будет устаревшим, я решил перейти к runsettings.

При поиске в Интернете и стеке кто-то заявил, что мне нужно, чтобы настройки, расположенные в файле runsettings с меткой DeploymentEnabled, имели значение false, чтобы достичь этого. Я сделал это и все еще получаю ошибку, потому что приложение работает и пытается получить доступ к файлам из моей папки TestResults Out. Я также изменил настройки запуска на принудительный устаревший режим на true и добавил каталог моего старого файла тестовых настроек, но все еще не работает.

Есть ли другой параметр, который я не принимаю во внимание, или я что-то упускаю или что-то не так с моими настройками запуска. Пожалуйста, посмотрите мой пример моего текущего файла runsettings ниже. Спасибо за любую помощь или указание.

 <?xml version="1.0" encoding="utf-8"?>
<RunSettings>
  <!-- Configurations that affect the Test Framework -->
  <RunConfiguration>
    <MaxCpuCount>1</MaxCpuCount>
    <!-- Path relative to directory that contains .runsettings file
    <ResultsDirectory>.\TestResults</ResultsDirectory> -->

    <!-- x86 or x64 -->
    <!-- You can also change it from the Test menu; choose "Processor Architecture for AnyCPU Projects" -->
    <TargetPlatform>x86</TargetPlatform>

    <!-- Framework35 | [Framework40] | Framework45 -->
    <TargetFrameworkVersion>Framework45</TargetFrameworkVersion>

    <!-- Path to Test Adapters -->
    <!--<TestAdaptersPaths>%SystemDrive%\Temp\foo;%SystemDrive%\Temp\bar</TestAdaptersPaths>-->

    <!-- TestSessionTimeout was introduced in Visual Studio 2017 version 15.5 -->
    <!-- Specify timeout in milliseconds. A valid value should be greater than 0 -->
    <TestSessionTimeout>15000000</TestSessionTimeout>
  </RunConfiguration>

  <!-- Configurations for data collectors -->
  <DataCollectionRunSettings>
    <DataCollectors>
      <DataCollector friendlyName="Code Coverage" uri="datacollector://Microsoft/CodeCoverage/2.0" assemblyQualifiedName="Microsoft.VisualStudio.Coverage.DynamicCoverageDataCollector, Microsoft.VisualStudio.TraceCollector, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
        <Configuration>
          <CodeCoverage>
            <ModulePaths>
              <Exclude>
                <ModulePath>.*CPPUnitTestFramework.*</ModulePath>
              </Exclude>
            </ModulePaths>

            <!-- We recommend you do not change the following values: -->
            <UseVerifiableInstrumentation>True</UseVerifiableInstrumentation>
            <AllowLowIntegrityProcesses>True</AllowLowIntegrityProcesses>
            <CollectFromChildProcesses>True</CollectFromChildProcesses>
            <CollectAspDotNet>False</CollectAspDotNet>

          </CodeCoverage>
        </Configuration>
      </DataCollector>

    </DataCollectors>
  </DataCollectionRunSettings>

  <!-- Parameters used by tests at run time -->
  <TestRunParameters>
    <Parameter name="webAppUrl" value="http://localhost" />
    <Parameter name="xxxxUser" value="xxxxm,xxxxtAuto01,xxxxtAuto02,xxxxxtAuto03,xxxxtAuto04" />
    <Parameter name="xxxxxxxxxnbr" value="xx86,xx90,xx91,xx92,xx93" />
  </TestRunParameters>

  <!-- MSTest adapter -->
  <MSTest>
    <MapInconclusiveToFailed>true</MapInconclusiveToFailed>
    <CaptureTraceOutput>false</CaptureTraceOutput>
    <DeleteDeploymentDirectoryAfterTestRunIsComplete>true</DeleteDeploymentDirectoryAfterTestRunIsComplete>
    <DeploymentEnabled>false</DeploymentEnabled>
    <!---->
    <ForcedLegacyMode>true</ForcedLegacyMode>
    <SettingsFile>%xxxx_Automation_Test\xxxx_Automation_Test\xxx_Automation_Test\xxxxAutomation.testsettings;</SettingsFile>
    <InProcMode>true</InProcMode>
    <KeepExecutorAliveAfterLegacyRun>False</KeepExecutorAliveAfterLegacyRun>
    <AssemblyResolution>
      <!--
      <Directory path="C:\xxx_Automation\xxxx_Automation_Test\xxx_Automation_Test\bin\" includeSubDirectories="false"/>-->
    </AssemblyResolution>
  </MSTest>

</RunSettings>

1 Ответ

0 голосов
/ 16 июля 2020

Я обновил свои настройки запуска, чтобы иметь имя файла настроек запуска и обновить ForcedLegacyMode до true.

 <ForcedLegacyMode>true</ForcedLegacyMode>
<SettingsFile>xxxxxAutomation.testsettings</SettingsFile>
<KeepExecutorAliveAfterLegacyRun>False</KeepExecutorAliveAfterLegacyRun>
<AssemblyResolution>
...