skinnyWill
skinnyWill

Reputation: 277

Can't run my build release task on azure release pipeline error Exception: An error occurred while initializing the settings provider named 'MSTest'

I have not been able to resolve this issue, been working on it for over 2 to 3 days. Here is my setup and what i have done so far.

building release on a on premise agent. agent has latest version of VS2017 on it I'm able to run my test on my local computer that also has VS2017 latest updated version on it. I was able to run test, in both debug/release configuration.

I was also able to run test on this same agent using Vstest.exe command line tool pointing it to my test dll and my runsettings file.

I've tried to run it using latest installer task as well as disabling installer task and using latest version of VS Test.

Here is the errors i'm seeing below when i try to run. Some directions on what i need to do with some steps would be helpful since i cant get this resolved.

Here is the steps in my installer

  1. Agent Job Agent selection pool - QA 2 Parallelism - none Artifact download - xxxx CI Build Latest

  2. Replace tokens in config

  3. Visual Studio Test Platform Installer - disabled

  4. Visual Studio test task vervison 2* Select test using - Test Plan Test Plan - 94223 - xxxxxxx Test Suite - xxxx xxxxxxx; xxxx xxxxxx\test test configuration - 83 - Windows 10 / IE 11 Search folder $(System.DefaultWorkingDirectory) Test results folder -$(Agent.TempDirectory)\TestResults Select test platform using - Version Test platform version - Latest Settings file $(System.DefaultWorkingDirectory)/_XXXXX CI Build/drop/XXXXX_Automation_Test/bin/Release/XXXXXtest.runsettings Collect advanced diagnostic in case of catastrophic failures

2020-07-20T14:09:03.7831149Z ##[error]DiscoveryMessage : An exception occurred while test discoverer 'MSTestDiscoverer' was loading tests. Exception: An error occurred while initializing the settings provider named 'MSTest'. Error: The test settings file E:\xxxxx_xxxx\x7\a\xxxxxxxxxxx.testsettings, specified in the MSTestAdapter settings, is not available. Either access to the file is denied or the file does not exist. Ensure that the test settings file is available and try again.

##[error]ExecutionAndPublish.Run : Microsoft.VisualStudio.TestService.VstestAdapter.TestsNotFoundException: No test assemblies found on the test machine matching the source filter criteria or no tests discovered matching test filter criteria. Verify that test assemblies are present on the machine and test filter criteria is correct.

##[error]The slice of type 'Execution' is 'Aborted' because of the error : Microsoft.VisualStudio.TestService.VstestAdapter.TestsNotFoundException: No test assemblies found on the test machine matching the source filter criteria or no tests discovered matching test filter criteria. Verify that test assemblies are present on the machine and test filter criteria is correct.

Running without installer ##[error]DiscoveryMessage : An exception occurred while test discoverer 'MSTestDiscoverer' was loading tests. Exception: An error occurred while initializing the settings provider named 'MSTest'. Error: The test settings file E:\xxx_xxxxx\x7\a\xxxxxxxxxxxxxxxx.testsettings, specified in the MSTestAdapter settings, is not available. Either access to the file is denied or the file does not exist. Ensure that the test settings file is available and try again. and stating vs version

Upvotes: 0

Views: 1053

Answers (1)

LoLance
LoLance

Reputation: 28186

I was also able to run test on this same agent using Vstest.exe command line tool pointing it to my test dll and my runsettings file.

As a workaround you can run vstest command via CMD task, this should work since you can run tests in command-line.

If the issue persists, you can add an Installer task which installs latestStable version for you.

Upvotes: 1

Related Questions