-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Visual Studio Test Task ignores Test Filter Criteria with Nunit #4251
Comments
Hi, Can you run this command in your local machine and see if it's working If not can you please check by changing this to |
Hello Nigurr, thank you for your response. At the moment I'am in holiday. I will try that, when I'am back next week. Best regards |
Hello Nigurr, I've tried the command above on my local machine with the same result. What I can see is that the filter works partly. It filters out only the tests in one file with the category of DataAccess set. It seems that filter is only applied for one file and the same filter on another file is ignored? I can see this behavior on my local run and Team Services build. Regards |
@RCerff, sorry didn't get you. There's only one "test dll" available from your build log. |
Ah ok. I will try to clarify it.
I've used the command exactly (with correct paths) as you recommended. Best Regards |
@RCerff I have created a sample project with two class, one with [TestFixture(Category = "DataAccess")] and other without it. I'm able to use filter. Following is output.
Here is sample Solution I used: NUnitTestCaseFilter.zip. |
My guess is that the filter works partly in some scenarios. I think to reproduce my issue change the following: Add another class with the same Category value [TestFixture(Category = "DataAccess")]. Then run the test again. Is the filter applied on both classes? Thank you in advance Best Regards |
@RCerff Yes, Filter is applied even after adding another class with Category annotation. |
At the moment I have a new general problem with vstest.console.exe. With your project and my project I get the following message: And no Test has run. In Visual Studio it works fine. Maybe this problem has to do with a Windows 10 Updates installed yesterday - (KB3150513) und (KB4019472)? Attached the TpTrace. Regards |
Yes you were right. I forgot testadapterpath switch. With your Test assembly the filter works as expected, but with my project the filter does not seem work correctly. Also it seems to ignore the Ignore attribute on one of my test methods. Here a new TpTrace |
Please open this issue in github.com/Microsoft/vstest. Closing this thread as it's related to vstest.console runner. |
Good news about this issue. This morning I've installed the 3.8.0-alpha1 of the NUnit3TestAdapter. This fixed the issue. Thank you for your efforts. Best Regards |
Hello,
I have the problem that Team Services Test task ignores Test Filter criteria.
I'am using Nunit 3.6.1 and Nunit3TestAdapter 3.7.0
I decorate my TestFixture with a category
As Test Filter criteria I use TestCategory!=DataAccess
It seems that the task ignores this criteria.
2017-05-05T12:29:57.7446530Z ##[section]Starting: Test Assemblies \release*test.dll;-:*\obj**
2017-05-05T12:29:57.7446530Z ==============================================================================
2017-05-05T12:29:57.7446530Z Task : Visual Studio Test
2017-05-05T12:29:57.7446530Z Description : Run tests with Visual Studio test runner
2017-05-05T12:29:57.7446530Z Version : 1.0.84
2017-05-05T12:29:57.7446530Z Author : Microsoft Corporation
2017-05-05T12:29:57.7446530Z Help : More Information
2017-05-05T12:29:57.7446530Z ==============================================================================
2017-05-05T12:29:57.7776654Z Preparing task execution handler.
2017-05-05T12:30:00.8419190Z Executing the powershell script: d:\a_tasks\VSTest_ef087383-ee5e-42c7-9a53-ab56c98420f9\1.0.84\VSTest.ps1
2017-05-05T12:30:01.5073344Z Working folder: d:\a\1\s
2017-05-05T12:30:01.5073344Z Executing C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe "d:\a\1\s\Trovare.Base\Trovare.Base.Sample.Test\bin\Release\Trovare.Base.Sample.Test.dll" /TestCaseFilter:"TestCategory=DataAccess" /logger:trx /TestAdapterPath:"d:\a\1\s"
2017-05-05T12:30:01.8207382Z Microsoft (R) Test Execution Command Line Tool Version 14.0.25420.1
2017-05-05T12:30:01.8207382Z Copyright (c) Microsoft Corporation. All rights reserved.
2017-05-05T12:30:01.8207382Z
2017-05-05T12:30:01.9807385Z Starting test execution, please wait...
2017-05-05T12:30:02.2447382Z Information: NUnit Adapter 3.7.0.0: Test execution started
2017-05-05T12:30:02.2447382Z
2017-05-05T12:30:02.2447382Z Information: Running all tests in d:\a\1\s\Trovare.Base\Trovare.Base.Sample.Test\bin\Release\Trovare.Base.Sample.Test.dll
2017-05-05T12:30:02.2447382Z
2017-05-05T12:30:03.5122750Z Information: NUnit3TestExecutor converted 12 of 12 NUnit test cases
2017-05-05T12:30:03.5132756Z
Then all the Test are run.
I've tried Categoy instead of TestCCategory but the it complaines that Category is not a valid value for filter criteria.
I'am missing something? Or what might be the reason. Thank you in advance for any help.
Best Regards
Rolf
The text was updated successfully, but these errors were encountered: