nunit3-vs-adapter icon indicating copy to clipboard operation
nunit3-vs-adapter copied to clipboard

TFS cant rerun failed tests when using TestFixtureSource attribute

Open TheXby opened this issue 5 years ago • 6 comments

When reporting a bug, please provide the following information to speed up triage:

NUnit 3.11.0 NUnit3TestAdapter 3.11.2 Azure DevOps Server 17.143.28621.4 Visual studio test task

I specify browser on which test should run through [TestFixtureSource(typeof(BaseConfiguration), "GetAllBrowsersType")] GetAllBrowsersType() return a string with name of Browser

Im using re-run failed tests option in VSTest task, but it give me a error

An exception occurred while invoking executor 'executor://nunit3testexecutor/': Incorrect format for TestCaseFilter Error: Invalid Condition '"Chrome"'. Specify the correct format and try again. Note that the incorrect format can lead to no test getting executed. 2019-03-27T10:56:17.5577975Z Information: Additionally, you can try specifying '/UseVsixExtensions' command if the test discoverer & executor is installed on the machine as vsix extensions and your installation supports vsix extensions. Example: vstest.console.exe myTests.dll /UseVsixExtensions:true

I think nunit test adapter cant interpret TestCaseFilter in right way when using TestCaseSource. In TFS log i see this

/TestCaseFilter:"FullyQualifiedName=Company.Tests.MarketplaceTesting("Chrome").SubmitItemforSaleWithEmptyValues"

TheXby avatar Mar 27 '19 11:03 TheXby

I assume you see the same behavior running vstest.console locally ? Can you please upload a repro project? Make it as small as you can, it should compile "as is".

OsirisTerje avatar Mar 30 '19 12:03 OsirisTerje

Hello, Yes, vstest also give me similar error.

An exception occurred while invoking executor 'executor://nunit3testexecutor/': Incorrect format for TestCaseFilter Missing Operator '|' or '&'. Specify the correct format and try again. Note that the incorrect format can lead to no test getting executed.

I create a simple project. I think it should be enough. Link

I found that issue can be resolved if escape '(' and ')' chars in class name.

TheXby avatar Apr 01 '19 15:04 TheXby

@TheXby How does your vstest.console line command line look like ?

OsirisTerje avatar Apr 02 '19 20:04 OsirisTerje

@OsirisTerje vstest.console BugSmaple\bin\Debug\BugSmaple.dll /TestCaseFilter:FullyQualifiedName=BugSmaple.MyTest(\"Question\").Test1

But this command produce no issue: vstest.console BugSmaple\bin\Debug\BugSmaple.dll /TestCaseFilter:FullyQualifiedName=BugSmaple.MyTest\(\"Question\"\).Test1

TheXby avatar Apr 02 '19 20:04 TheXby

This appears to be the same issues as #622 and resolved by PR https://github.com/nunit/nunit3-vs-adapter/pull/668

johnmwright avatar Oct 28 '19 20:10 johnmwright

@johnmwright Doesn't look like #668 fixes this one. Same behavior unfortunately. Is the new filter syntax properly introduced using the sources form?

image

OsirisTerje avatar Nov 01 '19 19:11 OsirisTerje