-
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
Using new adapter related settings from runsettings of testplatform #391
Conversation
navin22
commented
Sep 27, 2017
- Added to code to read DisableAppDomain, DisableParallelization and DesignMode.
- Respective parameter changes in the adapter code based on above setting.
- Added related unit tests.
- TestPlatform can send DisableAppDomain setting to adapters. - When DisableAppDomain is true Will set "DomainUsage" to "None"
- DisableParallelization - DesignMode : Can be used to figure out if IsRunningUnderIDE.
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.
It looks good to me provided we decide how to resolve the potential conflict between DisableParallelization and NumberOfTestWorkers.
if(DisableParallelization) | ||
{ | ||
NumberOfTestWorkers = 0; | ||
} |
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.
Should we account for the possibility that the user has used the NumberOfTestWorkers setting directly? Cases are:
DisableParalllelization | NumberOfTestWorkers | Action |
---|---|---|
true | 0 | Disable |
true | > 0 | Conflict - error message? |
false | 0 | Disable |
false | > 0 | Conflict - see note |
NOTE: Currently we don't distinguish between the setting being missing and being set to false. Since that's the case, I would be inclined to allow parallel execution in the fourth row. If we were to distinguish the two, then I'd give a message if DisableParallelization
were explicitly set to false while NumberOfTestWorkers
was positive.
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.
Will take action only if DisableParallelization
is true
. If not will not take any action.
DisableParalllelization | NumberOfTestWorkers | Action |
---|---|---|
true | 0 | Disable |
true | > 0 | Conflict - error message? [Is Warning Better than error message?] |
false | 0 | Disable [Will not take any action, since NumberOfTestWorkers is already set] |
false | > 0 | Conflict - see note [Will not take any action, so it will be parallel] |
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.
If DisableParallelization is false, and NumberofTestWorkers > 0 then we have parallel. There is no conflict there.
(@charlie: Did you switch the values there for DisableParallelization in the Note?)
For the 2nd case, DP = false and NOTW>0, I think it makes sense to make DP take precedence when true, and disable Parallel. A message can be ok, but could also be set to display only for Verbosity>0. All these messages are annoying in build outputs.
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.
You're right Terje, I switched two cases. I'm moving this discussion to the general comments because it gets hidden as a line comment when changes are made.
Repeating/Expanding/Correcting my table here for discussion...
I expanded the table to include DP not specified. That's different from an actual false setting, IMO, although I don't know if we can actually tell the difference. It depends on how the Conflict1: Conflict2: Note that we use a negative setting of NOTW to conventionally indicate that the setting was unspecified. In that case, we don't pass anything to the framework, which uses its defaults. |
And we can differentiate if We should decide on whether to stop the flow in case of conflict or continue with warning or verbose log ? |
I think we should differentiate between DP not specified and specified as false but only if we intend to do something different in each case. If not, we should keep it as a simple bool. IMO, deciding how we want to handle each situation should come before coding changes. After looking at all the options, I'd be on the side of simply documenting that DP overrides NOTW. I think we should log a warning in case NOTW has been set to a positive value because we know that had to come from the user. It might be a good general principal to say that general settings in the |
@CharliePoole: Yes we want to differentiate between DP not specified and take no action. And if specified override if there's a conflicting NOTW and log warning. |
@navin I agree with @CharliePoole that we should only differentiate between not specified DP and DP==false if we decide to do something different in those two cases. I don't see any reason to make those two situations different. |
I think @OsirisTerje has summarized it well. I'd only warn that IIRC we only honor verbosity==1 if a debugger is attached. |
@OsirisTerje then it means that NOTW settings will be overridden only if DP is true. Otherwise ignore. Even if it's specified and has false as value? |
@navin22 Yes. |
@OsirisTerje: Changed the code to override NOTW only when DA is true. |
# Conflicts: # src/NUnitTestAdapter/AdapterSettings.cs
Ok, LGTM now. Merging |