Closed aukevin closed 4 years ago
The test project is no secret, it is quite simple:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MSTest.TestAdapter" version="2.0.0" targetFramework="net472" />
<package id="MSTest.TestFramework" version="2.0.0" targetFramework="net472" />
</packages>
namespace UnitTestProject
{
using Microsoft.VisualStudio.TestTools.UnitTesting;
[TestClass]
public class UnitTest1
{
[TestMethod]
[DataRow(1, 1, 2)]
[DataRow(12, 30, 42)]
[DataRow(14, 1, 14)]
public void Test_Add(int a, int b, int expected)
{
var actual = a + b;
Assert.AreEqual(expected, actual);
}
[TestMethod]
public void TestBasicFailure()
{
Assert.AreEqual(3, 2+2);
}
}
}
It was pointed out that I was running the wrong vstest.console.exe. The correct one can be found here, so I am closing this issue. https://github.com/Microsoft/vstest-docs/blob/master/docs/contribute.md#test
Description
The
vstest.console.exe
that is built from this repository differs with the behavior of thevstest.console.exe
that ships with VS2019 when passed an MSTestV2 dll on my machine. The one that ships with VS2019 runs all tests from the test dll, while the one I built from the repo shows "No suitable test runtime provider found for this run.".I believe this is probably a configuration issue, but had trouble finding resources. It looks like there is an existing thread with the same error regarding UWP test code. However, I do not believe this has the same root cause. If there were additional configuration steps I missed, please let me know.
Steps to reproduce
Step 1: Clone this repository, check out the rel/16.4 branch. Step 2: Build using build.cmd, verify that the build is green. Step 3: Run the following commands in Visual Studio Command prompt:
Expected behavior
The built code (16.4.1-dev) should have ran the test code in largely the same way as the version that shipped with VS2019 (16.4) and at least run the tests.
Actual behavior
The behavior is shown in the screenshot - the built code could not find a suitable test runtime provider.
Diagnostic logs
Environment
This was running on Windows 10 Enterprise, OS build 18363.535. The version of vstest.console used is from the rel/16.4 branch of this repository.