vstest | Visual Studio Test Platform is the runner and engine | Unit Testing library

 by   microsoft C# Version: v17.6.2 License: MIT

kandi X-RAY | vstest Summary

kandi X-RAY | vstest Summary

vstest is a C# library typically used in Testing, Unit Testing applications. vstest has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

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

            kandi-support Support

              vstest has a medium active ecosystem.
              It has 775 star(s) with 282 fork(s). There are 83 watchers for this library.
              There were 4 major release(s) in the last 12 months.
              There are 198 open issues and 1426 have been closed. On average issues are closed in 522 days. There are 7 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of vstest is v17.6.2

            kandi-Quality Quality

              vstest has 0 bugs and 0 code smells.

            kandi-Security Security

              vstest has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              vstest code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              vstest is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              vstest releases are available to install and integrate.
              Installation instructions are available. Examples and code snippets are not available.
              It has 661 lines of code, 0 functions and 1162 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of vstest
            Get all kandi verified functions for this library.

            vstest Key Features

            No Key Features are available at this moment for vstest.

            vstest Examples and Code Snippets

            No Code Snippets are available at this moment for vstest.

            Community Discussions

            QUESTION

            VSTest.Console.exe Could not load file or assembly Microsoft.TestPlatform.CoreUtilities
            Asked 2022-Mar-29 at 16:16

            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:16

            Make 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

            Source https://stackoverflow.com/questions/71664177

            QUESTION

            Why is CodeCoverage.exe producing near empty .coverage Files?
            Asked 2022-Mar-25 at 19:29

            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:29

            It 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.

            Source https://stackoverflow.com/questions/71587878

            QUESTION

            Donet test in Azure DevOps gets stuck after TestManagement.Server.TriggerCoverageMergeJob is on
            Asked 2022-Mar-25 at 16:52

            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:52

            Issue 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.

            Source https://stackoverflow.com/questions/71047008

            QUESTION

            How can I use Artifacts from "This feed" source in my pipeline?
            Asked 2022-Mar-14 at 16:15

            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:15

            I 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:

            Source https://stackoverflow.com/questions/71469297

            QUESTION

            Call yml file into main yml file based on condition AZ Devops
            Asked 2022-Mar-07 at 12:06

            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:06

            QUESTION

            VSTest-testAssemblies agent is not running my Category search filter for NUnit framework in Azure Pipelines
            Asked 2022-Mar-01 at 05:11

            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:11

            1. Check whether the following latest packages are installed or not:

            Source https://stackoverflow.com/questions/71179665

            QUESTION

            Azure Devops - Release Pipeline when re-running failed tests azure devops shows failure status even if re-run succeeded
            Asked 2022-Feb-10 at 14:22

            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:22

            The 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:

            Source https://stackoverflow.com/questions/71063194

            QUESTION

            NUnit3TestExecutor throwing an ArgumentNullException - Value cannot be null
            Asked 2022-Jan-27 at 15:57

            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:57

            Solved 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'.

            Source https://stackoverflow.com/questions/70771176

            QUESTION

            Cypress can't find server when checking out repo in Azure DevOps pipeline
            Asked 2022-Jan-18 at 08:54

            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:50

            A possible solution would be to check out both repositories in the same job like:

            Source https://stackoverflow.com/questions/70687467

            QUESTION

            Azure Pipeline webpack script failing using windows-2022
            Asked 2022-Jan-15 at 20:31

            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:31

            Webpack 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:

            Source https://stackoverflow.com/questions/70608028

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install vstest

            You can download it from GitHub.

            Support

            There are many ways to contribute to VSTest.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/microsoft/vstest.git

          • CLI

            gh repo clone microsoft/vstest

          • sshUrl

            git@github.com:microsoft/vstest.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link