-
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
NUnit 3 console should produce xml events for ITestEventListener which contain unique id in the scope of all test agents for NUnit 2 tests #38
Conversation
I see two problems with using the process id as the first part of the test id:
I think this should be fixed by using the same approach as the NUnit 3 driver. Each driver takes on the unique test package ID, stored in the package. This will be unique across all packages and subpackages created for a run. See the nunit3 driver code. |
I've done something like you are talking about. But I am not sure that this code looks fine. I mean that now there is some implicit rule - in what order each method should be called. Also there is another rule - |
int runnerId; | ||
if (ID == null || !int.TryParse(ID, out runnerId)) | ||
{ | ||
throw new InvalidSuiteException("ID must be defined at first as a string representation of an integer value."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an NUnit V2 Exception, completely unknown to the engine. Let's use NUnitEngineException, which gets special handling by some runners.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, can we add something to the message indicating that it's the V2 driver that requires an int?
"Implicit rule - in what order each method should be called" Do you mean that Load must be called first? That has always been the rule. Or is it something else? "TestPackage.ID should be a string representation of an integer value" That's true. But the only way to eliminate the problem is to limit NUnit V3 forever to using integer values. NUnit V2 uses ints and we can't change that unless the driver intercepts every event and modifies the id using a lookup table. I don't think we want to do that! So I think we are stuck with this bit of awkwardness so long as we are supporting V2. |
@rprouse This looks good to merge, modulo my comments. |
09b7b21
to
f16dd8a
Compare
…hich contain unique id in the scope of all test agents for NUnit 2 tests - use current process id as a prefix for ID
f16dd8a
to
cee1c93
Compare
@CharliePoole Yes I mean Load must be called first |
@NikolayPianikov The DirectRunner takes care that this is done. It probably should be documented somewhere as an assumption that a driver can make. Maybe in the interface comments? |
@rprouse Ready to merge, I think. |
@CharliePoole comments will never be superfluous |
Looks good. |
#30 does not work again |
Use the current process id as a prefix for ID