testplan icon indicating copy to clipboard operation
testplan copied to clipboard

Incorrect Fix Match when only one of the messages contains a repeating group

Open 23nigam opened this issue 1 year ago • 4 comments

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 avatar Aug 02 '22 05:08 23nigam

@23nigam Thanks for reporting the issue, I was able to reproduce it. We will discuss within the team and get back to you.

M6AI avatar Aug 02 '22 07:08 M6AI

Thank you @M6AI. I spent some time today and traced the issue to the flatten_dict_comparison method.

23nigam avatar Aug 02 '22 09:08 23nigam

Appreciate the help, we have an internal item tracking this now and will be on board during the next replenishment.

M6AI avatar Aug 02 '22 09:08 M6AI

Hello, Do you have a due date by which the fix will be merged?

23nigam avatar Aug 16 '22 08:08 23nigam

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.

M6AI avatar Aug 22 '22 08:08 M6AI

@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.

M6AI avatar Aug 24 '22 08:08 M6AI

@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.

M6AI avatar Aug 26 '22 09:08 M6AI

Thanks @M6AI. Will try it out and let you know

23nigam avatar Aug 29 '22 12:08 23nigam

@M6AI Working as expected. You can close the ticket. Thanks

23nigam avatar Sep 20 '22 09:09 23nigam

@M6AI Working as expected. You can close the ticket. Thanks

Thanks @23nigam We are closing the issue.

M6AI avatar Sep 20 '22 15:09 M6AI