Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filtering from the CLI using /TestCaseFilter is not supported on extensions to TestPropertyAttribute #201

Closed
pvlakshm opened this issue Jun 20, 2017 · 4 comments · Fixed by #3015

Comments

@pvlakshm
Copy link
Contributor

pvlakshm commented Jun 20, 2017

Here is an example of an extention to TestPropertyAttribute (RFC):

using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using MSTestV2Ex;

namespace MSTestV2Ex
{
    [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
    public class SmokeTest : TestPropertyAttribute
    {
        public SmokeTest()
            : base("SmokeTest", null)
        {
        }
    }
}

namespace UnitTestProject20
{
   [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        [SmokeTest]
        public void TestMethod1()
        {
        }

        [TestMethod]
        public void TestMethod2()
        {
        }
    }
}

Filtering and Grouping from within the Visual Studio IDE’s TestExplorer works.

However, filtering using the /TestCaseFilter switch on the CLI is not working.
It ought to be supported in a manner similar to how I am able to filter on TestProperty.

AB#2078175

@pvlakshm
Copy link
Contributor Author

Here is where we have a list of supported properties today

@pvlakshm pvlakshm added the Help-Wanted The issue is up-for-grabs, and can be claimed by commenting label Nov 2, 2017
@Evangelink Evangelink added this to the 3.5.0 milestone Apr 24, 2024
@Evangelink
Copy link
Member

@engyebrahim Can you double check that your PR also fixes this case?

@engyebrahim
Copy link
Member

@Evangelink it's not working, I'm debugging it

@engyebrahim
Copy link
Member

https://learn.microsoft.com/en-us/dotnet/core/testing/selective-unit-tests?pivots=mstest#:~:text=dotnet%20test%20%2D%2Dfilter%20Method
--filter SmokeTest as for the link the default if user filtered value without key will be filtered by fullyQualifiedName
and --filter SmokeTest=null it's not valid filter
by the new fix here #3015 you can filter like that but you have to add a value to the TestProperty e.g. base("SmokeTest", "test")

@microsoft-github-policy-service microsoft-github-policy-service bot removed the Help-Wanted The issue is up-for-grabs, and can be claimed by commenting label Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants