-
Notifications
You must be signed in to change notification settings - Fork 748
Resolve differences between NUnit Console and NUnitLite implementations of @filename #1877
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
Comments
I've used Regex from @oznetmaster and I could add the nesting of any levels during 5 minutes if it is needed. I agree it would be better to have one code base and it doesn't matter for me which code will be preferable. I am just interested in implementation of this feature. So I would like to highlight some questions: About requirements:
About implementation:
|
I support @oznetmaster 's proposal in PR #1856: "I guess I am recommending we leave at least one level of nesting (currently my code has two - it is only a constant), and remove the alternative delimiter. Then modify the console code to support the same syntax." I think this is a minimum fix that will keep users from getting confused. As already stated, I don't support trying to make the code common right now. There's a bigger project I would like to do that would include this: developing an entire shared codebase for option handling, including our own version of Options.cs and using a submodule to share the code. But we have many more high priority things to worry about right now, so I think this can wait. So long as the two bits of code actually do the same thing, we will avoid complaints from our users. |
I intended this to be in the Discussion pipeline when I created it but didn't put it there. @NikolayPianikov Once we are done discussing and have decided on a course of action, we'll move it to the Backlog. Someone will decide to do it or we will pick someone. Then they will do it. 😄 |
OK... I don't see any action on this folks, so I'll lay out a proposal... Let's allow a single level of nesting and remove the alternative delimiter as @oznetmaster suggested. If this is agreed upon, then we need to
@rprouse @oznetmaster @NikolayPianikov Do you agree? |
The number of levels of nesting in my code is a constant. It is only there to eliminate the possibility of infinite recursion. It serves no other function. Removing the alternative delimiter is easy. |
Agreed to all points. |
Replicating the issue for nunit-console |
@oznetmaster |
@CharliePoole not sure what you are asking. This issue is about @filename, not parameters |
My mistake - I had both issues open. |
I agree with it |
The issue is duplicated for nunit-console as nunit/nunit-console#126. Both issues are available for somebody to self-assign. |
As indicated in the earlier comment, the following differences exist between the two implementations:
Design:
I'll leave a brief period for comment. |
I thought the alternative delimiter in nunitlite is going to be removed too? |
If we use the line-based approach, as I'm proposing, then there are no tokens and therefore no delimiters. So there is no need for an alternative delimiter. This is essentially what I laid out back in November. It's just that nobody picked up the ball and implemented it, so I thought I should say it one more time and then just do it. |
As I pointed out in November, if the line-based approach is used, then the file inserted with the @ option cannot, for instance, contain a --where option that actually spans multiple lines, perhaps one condition per line. That is a very useful capability, like writing fluent asssertions on multiple lines. |
Console runner is not only line based, for example see ArgumentsFileParserTests: There is only one difference as I see: console runner works without a recursion - I can add this by several lines of code if it is needed. But if we want to combine these approaches it is other task |
@NikolayPianikov I guess I'm using the term in a very limited way. What I mean is that This was a design restriction I originally placed on the implementation. I felt it would give us a very simple pre-processor without restricting things too much. @oznetmaster is arguing otherwise: that we need to allow a single argument to extend across lines of text. I wasn't convinced before but I'm beginning to see that there could be such a need, so let's continue the discussion. |
@oznetmaster I see your point. For test name selection, it's simple to just use multiple
In such a case, the main reason for using a file might be to make the option more legible. What do other folks think? |
Exactly! |
We could allow it if user limits each argument by symbols " and it is quite easy |
I agree, although it has some issues if the argument uses quotes internally. At this point, still waiting for a concensus on supporting the feature. @nunit/framework-team @nunit/core-team Please don't assume that your silence will be taken to mean agreement. |
I'm an advocate for treating all whitespace characters equally. |
I do not line the quote approach, for exactly the reason that @CharliePoole mentioned - nested quotes. The approach that I implemented in nunitlite has been working quite successfully for my users for almost two years now, so I know it is a viable solution. |
So how would your approach handle the example? |
Since the console runner already handles |
@oznetmaster I'd like to hear how the user would input those examples in your implementation. @JustinRChou While I like your example, the fact is that there isn't a standard for how options are specified at the command-line. The OS handles it. |
@oznetmaster Still waiting to hear from you regarding how you suggest that multiple-line options, like where clauses, should be handled. It's not clear to me from your comments so far. |
I decided to add tests as a starting point. 😄 |
I have tests for the my nunitlite implementation. Do you want them? |
Actually, they are in the repo in nunitlite.tests\CommandLineTests.cs |
Yes, I started with those and am expanding them. So far, there doesn't seem to be a clean way to handle multi-line arguments containing spaces other than putting them into quotes. I'd really like something like the cited example above to work. |
@CharliePoole the way I would imagine is for each argument to control consumption of the remainder of the command line. So |
@jnm2 Currently, the handling of @filename in the command-line is done by a pre-processing step. The actual processing is done by Mono.Options, which is included as source in both NUnitLite and the console runner, but which we have made it a practice to leave unmodified. I have a back-burner project to create our own command-line options processor. Mono.Options has features we don't need and lacks a few things we could use. I was hoping, however, to be able to fix the current issue while sticking with the pre-processor model. One option may be a "smarter" pre-processor. Or I may just do as much as is possible within the current design constraints and deal with better stuff later. @oznetmaster
|
General approach I plan to use for resolving this issue together with nunit/nunit-console#126...
|
We (well actually I) mistakenly merged the nunitlite changes thinking that the differences between the console runner and nunitlite implementations had already been resolved between @NikolayPianikov and @oznetmaster
We need to decide first what features to include / exclude then change one or both of them so that users do not get confused and features we have not decided to support do not become supported by default.
Eventually, we should also resolve code differences for the common features but that can await the point where we create a shared codebase for conmmand-line option processing.
I'm putting this in the discussion pipeline so that the NUnit team can work out what we want to support. Everyone else is welcome to participate in the discussion as well.
The text was updated successfully, but these errors were encountered: