-
Notifications
You must be signed in to change notification settings - Fork 152
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
exception occurred while invoking executor Unexpected token '(' at position 100 in selection expression. #1510
Comments
Hi @livebe01
|
Thanks @stevenaw, I tried your suggestion, but it results in the same error/behavior. It's strange to see |
The same error happens on Windows. It should work according to the docs https://docs.nunit.org/articles/nunit/running-tests/Test-Selection-Language.html#simple-expressions The error happens in the NUnit.Engine, so I'll transfer the issue there. |
I took a quick look at this when it was reported and as far as I quickly could determine then
I'm actually unsure if this have ever worked (perhaps the documentation and code is out of sync?). Ps. NUnitLite seems to have the same problem |
If this is an error in the engine, we should be able to repro it with a failing unit test for the tokenizer and/or the parser. I'll try to do that when I get back to work in a few weeks but if somebody wants to start on it now, please go ahead. We haven't often checked in failing tests deliberately, but that's actually a good way to prove a bug and does no harm since we won't merge a failing branch. It's harder for us if the failure only occurs on a Mac, but @livebe01 could give it a try as well. We run into this problem (lack of devs with Macs on the team) periodically. |
Per nunit/docs#316, it looks like the feature may have worked at some earlier point. |
For sure. Let me know if there's something you'd like me to try. |
If you are able to build a test case that excercises the engine at a lower level, that would help. See our Tokenizer tests and TestSelectionParser tests for examples. This might be simpler for you than building the entire engine and runner, although that's an option as well. Have you looked at the console output yet? It may actually show how the runner is interpreting your where filter. |
I tested it on windows, same results. |
I wanted to add, I get the same error whether running |
OK, I missed that. I labeled it a bug and if nobody gets to it before the 25th, I'll work it. |
I've been able to try a few things tonight here.
However there still seems to be an issue with the test selection. I can correctly select a test method which expects an int or an enum but not a string. It does appear there is an existing test for exactly that scenario, though, which passes on the engine side. I have to stop the investigation for now, but if the engine test proves correct XML generation then I am wondering if perhaps this is a framework issue.
|
Free time is a little unpredictable at the moment for me so I've put up a PR with some of the tests I'd written as part of my investigation tonight: #1513 |
I have the following test
[Test]
[TestCase(ThisEnum.Option1, "ABC")]
[TestCase(ThisEnum.Option2, "DEF")]
[TestCase(ThisEnum.Option3, "GHI")]
public void TestSomething(ThisEnum thisEnum, string expected)
{
// do something
}
I can run the tests individually, and as a group in Rider w/o issue. But, for some use cases, it'd be really useful to be able to run parameterized tests individually, from the CLI.
I'm developing on a Mac using Rider. My project is using "NUnit" Version="3.13.3" and "NUnit3TestAdapter" Version="4.3.1".
I run the following from the Mac terminal:
dotnet test -- NUnit.Where="test==Some.Name.Space.SomeClass.TestSomething(EnumValue,\"ABC\")"
and get this error:
When I run
dotnet test -- NUnit.Where="test==Some.Name.Space.SomeClass.TestSomething"
, all three tests run w/o error. I wonder if you can point me at what I might be doing wrong or what I might try to get passed this.Thanks!
The text was updated successfully, but these errors were encountered: