-
Notifications
You must be signed in to change notification settings - Fork 106
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
Incorrect format for TestCaseFilter Error: Missing '(' #691
Comments
Thanks! We're aware of these cases too, but thanks for the test code! Part of this is a Visual Studio issue, part of it is the name handling in the adapter - and these things are not properly aligned yet. |
Thanks for the response & update. I can confirm that I'm also getting test explorer issues as described in issue 691, as well as general issues with test explorer being glitchy and not updating status from the nunit test run. This is why I cringe every time I update something that works :'( (VS in this case) |
I just ran into this issue as well. I'm using |
Still open ? |
A workaround for fellow developers / testers who just want to make the tests run again: Wrap your test case data in a // Still looking forward to a proper fix though. |
I had just the same error. I solved it by removing all tuples form my tests. At least from the TestData and the function interface. Inside the test function I could again use tuples. BTW: Both kind of tuples caused problems. Meaning ValueTuples (like After I replaced all places, where I used those Tuples in my test data (TestCaseSource), everything works now. @igabesz To wrap all data in a new object probably works, but I actually used tuples in some places, to not have to write a new class for every test. |
Same issue happening with nunit test adapter v 3.17.0.0. |
Found out this issue is also documented in 622 (#622), which in turn has been addressed in the nunit test adapter 3.16. I've just gone all the way up to 4.0.0.0 beta, though, and no change :( |
I am running the 4.0 release and am seeing this problem. Could the fix not have made it from 3.16 to 4.0? |
I assume you refer to the fix in 3.16 that had to be reverted in 3.16.1. It can still be invoked using runsettings options, see https://docs.nunit.org/articles/vs-test-adapter/Adapter-Release-Notes.html#nunit3-test-adapter-for-visual-studio---version-3161---january-16-2020 |
It seems this works now, using the latest VS2019, version 16.11.3. I have added the repro to the repro-repo together with the same for #711 and #549 which are similar to this one. All works. See repro solution here: https://github.com/nunit/nunit3-vs-adapter.issues/tree/master/Issue711 This works both with and without Real Time Test Discovery |
Just got this in 16.11.3 |
@mikhail-barg You mean it still failed for you? Can you please add a repro for that. |
Yes, I think so. Will double-check and try to create a repro |
Awesome if you also could check the TestFrom691 in the repo and sln https://github.com/nunit/nunit3-vs-adapter.issues/tree/master/Issue711 , and check that both with and without Real time test discovery. If those works, and your new repro doesn't we possibly have another issue here. If those doesn't work, then there is something else here that is "rotten". |
Okay, so I've got a (not minimal) repro here: https://github.com/mikhail-barg/jsonata.net.native/tree/repro_for_nunit_691 |
So I was able to minimize the repro to this: public class Tests
{
[TestCaseSource(nameof(GetTestCases))]
public void Test1()
{
Assert.Pass();
}
public static List<TestCaseData> GetTestCases()
{
return new List<TestCaseData>() {
new TestCaseData() {
TestName = "name ( () )"
}
};
}
} Here's the project: Test691.zip |
I also noticed that VS created test project with not latest package versions, so I updated everything to latest version and got a bit different output:
|
So I just checked out the repo, opened the Issue711\NUnitTestAdapterCharacters.sln and pressed "Run" on the topmost test group in the tree. This gave me:
|
Did the same as above with the Issue691\Issue691\Issue691.sln and everything seem to be working:
And all tests are green. |
The last one runs 3.16.0, that version doesn't run methods separately, so there should be no issue. What about 4.0 ? |
Updated all packages in Issue691.sln to latest versions, and still everything work:
|
@mikhail-barg Thanks for checking this out :-) |
I'm getting this error with the latest packages (for vs2019) running in vs 2022:
I've created a gist with the relevant files I can think of: https://gist.github.com/redwyre/0fb0c9f177af278f76aa8cf49c1eb1dc It seems like NUnit is just calling ToString() on all the parameters to make the test name, and in some cases it doesn't work properly with more complex objects. I think I can work around this by wrapping each record in |
Nunit bug is that InlineData in strings need to have balanced quotes. Update test case. This shouldn't lose coverage since the quote comes after the intellisense cursor.
I was on 4.0.0.0 and experienced this issue when using ValueSource with an array of tuples. I updated to 4.2.0.0 and am still experiencing this. |
@nthornton2010 Have you checked the repro above? Does it appear there? How does your code differ from that repro? |
I have a huge project and I have no clue where this is coming from. Is there a way to add the bad test name to the logs? |
@Lohoris You can enable the VSTest trace logs . Since this error crashes the adapter, the only way is to use the vstest logs. |
I mean, the normal logs that end up in the Output/Tests pane do not show anything interesting, or do you mean there's a way to increase the verbosity of that? Or finding some logfiles somewhere? |
@OsirisTerje I saw the findings in this issue - #935 - and figured out that I'm suffering from the same problem. After disabling that setting in Visual Studio, it started working. |
It's already off here, so unfortunately I'll need to investigate further. I'll have a look to the diagnose tool @OsirisTerje linked, thanks! |
Environment
Description
When executing a category of tests (e.g. Run All), if a test is included in the list of tests that contains an escaped double quote followed by a closing parenthesis, the following error may occur and the test run will fail:
Note
There are a number of recently closed issues (thanks :) ) that are similar regarding braces or quotes in the test case name or arguments, but this is not quite the same (esp. since it breaks despite resolution of the other issues)
Reproduction
Run this code, and examine the Test Output window to see the exception as per above.
The text was updated successfully, but these errors were encountered: