Vstest.console.exe runs as if the test name is a partial pattern rather than a full name.
Description
Vstest.console.exe runs as if the test name is a partial pattern rather than a full name. e.g. "vstest.console.exe UnitTests.dll /Tests:Beta /Platform:x64 /InIsolation" runs any test with 'Beta' in the name
Steps to reproduce
Make two tests with one being named as the substring of another. Use vstest.console.exe to run the test with the shorter name. Both tests will run when only one should.
Expected behavior
Only the specifically named test should run. Specifying wildcards would work e.g. "/Tests:Beta*" would run every test starting with "Beta"
Diagnostic logs
D:\depot-UE4-Mainline>"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" D:\depot\Encoder\Binaries\x64\Release\UnitTests.dll /Tests:StabbingTSE_Encoder /Platform:x64 /InIsolation Microsoft (R) Test Execution Command Line Tool Version 15.9.1 Copyright (c) Microsoft Corporation. All rights reserved.
Starting test discovery, please wait... Loading and instantiating ../TestData/StabbingTSE/
.. scene ../TestData/StabbingTSE/ loaded and instantiated in 259.254 millisecond(s)
Loading and instantiating ../TestData/PointedStabbingTSE/
.. scene ../TestData/PointedStabbingTSE/ loaded and instantiated in 286.104 millisecond(s)
Passed StabbingTSE_Encoder Passed PointedStabbingTSE_Encoder
Total tests: 2. Passed: 2. Failed: 0. Skipped: 0. Test Run Successful. Test execution time: 1.6650 Seconds
Environment
Windows 10 Professional. Visual Studio Community 15.9.16.
@primalspacesystems This is by design, and has the behavior ever since this argument existed. Changing the behavior can possibly break a lot of scenarios for users.
Can you try using the testcasefilter argument instead ?
Using "... /TestCaseFilter:"StabbingTSE_Encoder" /Platform:x64 /InIsolation" generates the exact same results.
Cheers John
Am experiencing this is there a workaround if you want to run only just one tests
I am in the same situation but TestCaseFilter is working for me. In powershell for me
vstest.console.exe /TestCaseFilter:"Name=$testName" ...