testplan
testplan copied to clipboard
Incorrect Fix Match when only one of the messages contains a repeating group
Sample Test Case :-
@testcase
def fix_match(self, env, result):
fix_msg_1 = {
36: 6,
22: 5,
55: 2,
38: 5,
75: 123,
555: [
{
600: 'A'
}
],
54: 2,
851: 4
}
fix_msg_2 = {
36: 6,
22: 5,
55: 2,
75: 1234,
38: comparison.GreaterEqual(4),
54: 2,
20001: "SAMPLE"
}
result.fix.match(fix_msg_1, fix_msg_2, description='Simple Fix match', exclude_tags=[75])
Output :-
(Passed) Key(36), 6 <int> == 6 <int>
(Passed) Key(22), 5 <int> == 5 <int>
(Passed) Key(55), 2 <int> == 2 <int>
(Passed) Key(38), 5 <int> == VAL >= 4 <func>
(Ignore) Key(75), 123 <int> 1234 <int>
(Failed) Key(555), None != ABSENT <None>
(Ignore) None 2 <int>
(Ignore) Key(600), A <str> None
(Passed) Key(54), 2 <int> == ABSENT <None>
(Failed) Key(851), 4 <int> != SAMPLE <str>
(Failed) Key(20001), ABSENT <None> != None
[fix_match] -> Failed
In the above output, the last 3 entries have incorrect values.
@23nigam Thanks for reporting the issue, I was able to reproduce it. We will discuss within the team and get back to you.
Thank you @M6AI. I spent some time today and traced the issue to the flatten_dict_comparison method.
Appreciate the help, we have an internal item tracking this now and will be on board during the next replenishment.
Hello, Do you have a due date by which the fix will be merged?
Hello, Do you have a due date by which the fix will be merged?
Sorry @23nigam for the late response, there were vacations in the squad. Due to internal prioritization, the issue did not fit the previous replenishment batch. Let me get back to you this week with an best/worst case scenario.
@23nigam For your interest, this is in progress now. The issue seems to be with a utility function that splits the comparison result into left and right hand side. An extra element is produced in case one of the dictionaries has a container under a particular key, but the other dictionary either does not have that key (your example) or the key refers a non-container type (so there is no indent information for the display). Will ping you here once the PR is ready.
@23nigam An initial fix is merged and should resolve the display issue. Can you please give it a go on your end and provide feedback? If all good, I will be close the issue.
Thanks @M6AI. Will try it out and let you know
@M6AI Working as expected. You can close the ticket. Thanks
@M6AI Working as expected. You can close the ticket. Thanks
Thanks @23nigam We are closing the issue.