vstest | Visual Studio Test Platform is the runner and engine | Unit Testing library
kandi X-RAY | vstest Summary
kandi X-RAY | vstest Summary
The Visual Studio Test Platform is an open and extensible test platform that enables running tests, collect diagnostics data and report results. The Test Platform supports running tests written in various test frameworks, and using a pluggable adapter model. Based on user-choice, the desired test framework and its corresponding adapter can be acquired as a vsix or as NuGet package as the case may be. Adapters can be written in terms of a public API exposed by the Test Platform. The Test Platform currently ships as part Visual Studio 2019, and in the .NET Core Tools Preview 3.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of vstest
vstest Key Features
vstest Examples and Code Snippets
Community Discussions
Trending Discussions on vstest
QUESTION
I'm trying to set up a C# project with the latest version of Visual Studio, 2022; this is with .Net 6 on Windows 10. It's a simple console program, and I've set up the project and a corresponding unit test project basically following the steps described in https://docs.microsoft.com/en-us/visualstudio/test/walkthrough-creating-and-running-unit-tests-for-managed-code?view=vs-2022 so I've got something isomorphic to that tutorial project.
And the unit tests work fine when run from within Visual Studio.
Now I want to also run them from the command line.
vstest.console bin\Debug\net6.0\foo.dll
gives
Testhost process exited with error: Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.TestPlatform.CoreUtilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. File name: 'Microsoft.TestPlatform.CoreUtilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' at Microsoft.VisualStudio.TestPlatform.TestHost.Program.Main(String[] args) . Please check the diagnostic logs for more information.
Looks like the toolchain is failing to find one of its own libraries? Is there some option I need to be specifying?
...ANSWER
Answered 2022-Mar-29 at 16:16Make sure that foo.dll
is the project which contain the tests and reference MSTest.TestFramework
if you follow convention naming, this should be fooTests.dll
QUESTION
In our Jenkins pipeline, we use SonarQube to report on our code coverage. After running all of our unit/integration tests to produce the .coverage file, we need to analyze this file to create the ".coverage.coveragexml" which is ultimately what is used by SonarQube to interpret the code coverage. We do this by using the CodeCoverage.exe:
...ANSWER
Answered 2022-Mar-25 at 19:29It seems the base image we use must have a non-enterprise edition of the Code Coverage tools (which is a requirement). We tested our SonarQube projects commands locally using an enterprise edition of the tools (I have Visual Studio 2022 Enterprise installed on my machine), and the coverage files produced contain the correct data. However, when we used a Visual Studio Professional install, the files are empty just like our Jenkins pipeline.
As stated, this started happening when the base image was updated - in particular it was around November 8th 2021. It seems the base docker image we were using (mcr.microsoft.com/dotnet/framework/sdk:4.8-20220210-windowsservercore-ltsc2019) has the latest 2022 tools, but it must not be an enterprise edition - hence the empty files.
We switched our pipeline over to using dotCover instead to perform the analysis, which works as expected and our SonarQube coverage is back to normal.
QUESTION
In Azure DevOps I have a local agent running dotnet test
in a pipeline on my code. It used to work before my holiday, but something has changed and causes this pipeline to hang for 60 minutes and then kill itself.
I enabled the debug mode, but can only see TestManagement.Server.TriggerCoverageMergeJob
and then nothing.
Does someone here know what to do?
The code is .NET5 based and uses a few Selenium Tests on both Chrome and Firefox. According to the run report this part works fine and all tests passed. Agent is Windows 10 Enterprise, running agent version 2.198.3 (=latest)
...ANSWER
Answered 2022-Mar-25 at 16:52Issue was not with the pipeline itself. It was running UI Tests that started chromedriver and a BrowserStackLocal.exe. If a test failed these executables where not terminated causing the pipeline to wait untill these services were closed. That did never happen, resulting in a long wait and abort after 60 minutes.
QUESTION
I have successfully pushed my NuGet package to a feed in my Azure DevOps Artifacts:
But, I want to use this package in my pipeline, because this currently fails because it cannot find the package. I tried to add a service connection in my Project Settings, using the URL I get when creating the artifact feed:
But still, my build fails because it cannot find the package.
This is my pipeline YAML file:
...ANSWER
Answered 2022-Mar-14 at 16:15I used the DevOps YAML editor to add the correct steps to my azure-pipelines.yml
. I added a NuGet step:
In the Use packages from this Azure Artifacts/TFS feed
option, I could select my Artifacts feed. This added this task to the YAML file:
QUESTION
I have main yml file for my pipeline. Is it possible to call/use another yml after condition is met in a task of main yaml?
...ANSWER
Answered 2022-Mar-07 at 12:06See https://docs.microsoft.com/en-us/azure/devops/pipelines/process/templates?view=azure-devops
Copied from the link:
QUESTION
I am using in the Test Filter criteria TestCategory=CategoryA In my Tests I have the below saved and think it should be the only test run but I get success and no tests ran. I have tried with dotnet test and used the same in the arguments and gain it fails with other issues. I can get dot net test to run without adding any arguments for VS Test agent it seems to not want to run even when I do not add the test filter criteria.
...ANSWER
Answered 2022-Mar-01 at 05:111. Check whether the following latest packages are installed or not:
QUESTION
I use Specflow with SpecRunner+ I am using the Deafult.srprofile to to re-run failed tests 3 times in visual studio it shows 2passed 1 failed but the status of the test is a failure, the same goes for azure devops if a re-ran test passes the outcome of the run is a failure. The Failures are sometimes caused by locator timeouts or server timeouts not often but saw it happen few time thats why we decided to implement a re-run.
Could anyone help on this?
...ANSWER
Answered 2022-Feb-10 at 14:22The behavior of the report is the correct one and sadly this can't be configured to be changed.
What you can do is to adjust how the results are reported back to Azure DevOps.
You can configure it via the VSTest
element in the srProfile- File.
This example means, that at least one retry has to be passing:
QUESTION
I am using Azure DevOps for our CI/CD pipeline. The Visual Studio Test task on the Agent Job has suddenly started failing.
The error in the logs is:
An exception occurred while invoking executor 'executor://nunit3testexecutor/': Value cannot be null. (Parameter 'type')
- No changes have been made to the pipeline.
- No changes have been made to the source code.
- However something might have changed on the build server (I don't know yet).
The task is defined as follows:
...ANSWER
Answered 2022-Jan-27 at 15:57Solved this by modifying the Azure Pipeline to clean the build directories.
Go to: Pipeline > Get sources > Clean options
Set this to value 'All build directories'.
QUESTION
I have an Azure DevOps project that has 2 repos in it, one with the .net web app and another with Cypress tests. I need to create a pipeline that builds and runs the unit tests from the web app repo, then checkout the Cypress repo and runs the e2e tests. When my pipeline tries to run the Cypress tests, I get the error "Cypress could not verify that this server is running: https://localhost:5001/"
I believe because my cypress tests are in a different repo, I need to keep my web app running on a server until my cypress tests are completed. Is this correct? I'm not sure so this is a guess. How can I set this up so that my tests can run properly?
Here is my pipeline yaml file:
...ANSWER
Answered 2022-Jan-14 at 18:50A possible solution would be to check out both repositories in the same job like:
QUESTION
I have an Azure Pipeline configured to build and deploy a .NET 5 application to an on prem server. This works fine for .NET 5, but after upgrading to .NET 6, I had to update the vmImage
from windows-latest
to windows-2022
, as windows-latest
doesn't have the .NET 6 SDKs on (according to https://github.com/dotnet/core/issues/6907). This was the error I received
The nuget command failed with exit code(1) and error(C:\Program Files\dotnet\sdk\5.0.404\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(141,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 6.0. Either target .NET 5.0 or lower, or use a version of the .NET SDK that supports .NET 6.0.
That makes sense, so I've updated the vmImage
to windows-2022
, and it now gets past that bit, but the pipeline now fails on the webpack task.
Original YAML file (failed on NuGet task due to not having .NET 6 tools available)
...ANSWER
Answered 2022-Jan-15 at 20:31Webpack is not installed by default on the windows-2022 image, while it is installed on windows-latest.
However, you can easily install it as part of your build pipeline:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install vstest
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page