-
Notifications
You must be signed in to change notification settings - Fork 323
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
Remove duplicate counting of test results in Consolelogger #2267
Remove duplicate counting of test results in Consolelogger #2267
Conversation
var executionId = GetExecutionId(e.Result); | ||
var parentExecutionId = GetParentExecutionId(e.Result); | ||
|
||
if (parentExecutionId != null && leafExecutionIdAndTestOutcomePairDictionary.ContainsKey(parentExecutionId)) |
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.
@hvinett GetParentExecutionId
returns non-nullable guid, removing the nullability check, as well as replacing it with != Guid.Empty
check passes all the tests in ConsoleLoggerTests
what is the intent here?
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.
I kept parentExecutionId != null, because .containskey() throws error if key is null. As it is not null we can check parentExecutionId != Guid.Empty to avoid check in dictionary. Is that fine?
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.
Yup. Let me quickly patch that, because I have the code open, and merge if that passes (it should, I tried it before).
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.
ok
Description
Current behavior:
Recognizing parent result as passed ,failed or skipped and adding to respective counts.By this we are showing duplicate count.
ex:
Scenario:
if we have a parent test result(passed) and two child test results in which one is passed and the other is failed.
current behavior:
total test =3
passed tests =1
Failed =2
expected behavior:
total tests =2
passed tests =1
failed tests =1
Approach :
Storing every result and it's outcome in dictionary. if it is recognized as parent then removing it from dictionary. By this way we end up with the dictionary that has non parent results and it's outcome. Finally counting the passed,failed, skipped and total in the resulting dictionary will give the expected behavior mentioned above
Assumed parent test result comes first and then the child test result comes.
Related issue
Kindly link any related issues. E.g. Fixes #xyz.