Skip to content
Snippets Groups Projects
  1. Feb 13, 2025
  2. Feb 12, 2025
    • Jarod Wilson's avatar
      Merge: test_base_mr_mixins: lower loop count for test_matching_discussions_loop · 34d77968
      Jarod Wilson authored
      
      There's up to 100 discussions in each loop, so 5 repetitions of the
      test should be enough - given that we run these tests for each MR
      and also locally.
      
      Signed-off-by: Jan Stancek's avatarJan Stancek <jstancek@redhat.com>
      
      See merge request !1743
      34d77968
    • Tales da Aparecida's avatar
      cb057e41
    • Jan Stancek's avatar
      test_base_mr_mixins: lower loop count for test_matching_discussions_loop · 9b4591e8
      Jan Stancek authored
      
      There's up to 100 discussions in each loop, so 5 repetitions of the
      test should be enough - given that we run these tests for each MR
      and also locally.
      
      Signed-off-by: Jan Stancek's avatarJan Stancek <jstancek@redhat.com>
      9b4591e8
    • Patrick Talbert's avatar
      Merge: session: fix tests to use BaseEvent as handler keys · 921149bf
      Patrick Talbert authored
      
      This was missed from !1632.
      
      Signed-off-by: Patrick Talbert's avatarPatrick Talbert <ptalbert@redhat.com>
      
      See merge request !1741
      921149bf
    • Tales da Aparecida's avatar
    • Patrick Talbert's avatar
      Merge: tests_common: fix mock objects for JI and fixversion · eeb62cd2
      Patrick Talbert authored
      
      There are 2 issues:
      
      1. Mock says that mock_ji has alias attribute, because it says
      so for any attribute you check. When webhook code tries to iterate
      over CVEs, it finds another Mock object, and it fails at:
        File "/home/jstancek/src/kernel-workflow-git/webhook/rhissue.py", line 465, in is_cve_tracker
          return bool(self.cve_ids)
                      ^^^^^^^^^^^^
        File "/home/jstancek/src/kernel-workflow-git/webhook/rhissue.py", line 428, in cve_ids
          return self._get_cve_ids(self.ji.alias) \
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/jstancek/src/kernel-workflow-git/webhook/rhissue.py", line 591, in _get_cve_ids
          for string in string_list:
                        ^^^^^^^^^^^
        TypeError: 'Mock' object is not iterable
      
      2. fixVersion is initialized as MagicMock(name='...'), which doesn't
      create and set name attribute. So when code tries to use it,
      it finds another MagicMock object and fails at:
        File "/home/jstancek/src/kernel-workflow-git/webhook/rhissue.py", line 566, in _find_ji_project_branch
          if not self.ji or not self.ji_fix_version:
                                ^^^^^^^^^^^^^^^^^^^
        File "/home/jstancek/src/kernel-workflow-git/webhook/rhissue.py", line 246, in ji_fix_version
          return defs.FixVersion(fix_versions[0].name)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/jstancek/src/kernel-workflow/venv_webhooks/lib64/python3.12/site-packages/kwf_lib/common.py", line 102, in __init__
          if fv_match := CENTOS_FIX_VERSION_REGEX.match(fv_string):
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        TypeError: expected string or bytes-like object, got 'MagicMock'
      
      Use already created FakeJI instead of Mock and initialize fixVersion name attribute explicitly.
      
      Signed-off-by: Jan Stancek's avatarJan Stancek <jstancek@redhat.com>
      
      See merge request !1740
      eeb62cd2
    • Patrick Talbert's avatar
      Merge: cache owners in BaseMR · d5e27502
      Patrick Talbert authored
      
      This speeds up tests and ack_nack webhook, because owners isn't reloaded all the time.
      
      Signed-off-by: Jan Stancek's avatarJan Stancek <jstancek@redhat.com>
      
      See merge request !1736
      d5e27502
    • Patrick Talbert's avatar
      session: fix tests to use BaseEvent as handler keys · 55d03416
      Patrick Talbert authored
      
      This was missed from !1632.
      
      Signed-off-by: Patrick Talbert's avatarPatrick Talbert <ptalbert@redhat.com>
      55d03416
    • Jan Stancek's avatar
      tests_common: fix mock objects for JI and fixversion · fb67aef7
      Jan Stancek authored
      
      There are 2 issues:
      
      1. Mock says that mock_ji has alias attribute, because it says
      so for any attribute you check. When webhook code tries to iterate
      over CVEs, it finds another Mock object, and it fails at:
        File "/home/jstancek/src/kernel-workflow-git/webhook/rhissue.py", line 465, in is_cve_tracker
          return bool(self.cve_ids)
                      ^^^^^^^^^^^^
        File "/home/jstancek/src/kernel-workflow-git/webhook/rhissue.py", line 428, in cve_ids
          return self._get_cve_ids(self.ji.alias) \
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/jstancek/src/kernel-workflow-git/webhook/rhissue.py", line 591, in _get_cve_ids
          for string in string_list:
                        ^^^^^^^^^^^
        TypeError: 'Mock' object is not iterable
      
      2. fixVersion is initialized as MagicMock(name='...'), which doesn't
      create and set name attribute. So when code tries to use it,
      it finds another MagicMock object and fails at:
        File "/home/jstancek/src/kernel-workflow-git/webhook/rhissue.py", line 566, in _find_ji_project_branch
          if not self.ji or not self.ji_fix_version:
                                ^^^^^^^^^^^^^^^^^^^
        File "/home/jstancek/src/kernel-workflow-git/webhook/rhissue.py", line 246, in ji_fix_version
          return defs.FixVersion(fix_versions[0].name)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/jstancek/src/kernel-workflow/venv_webhooks/lib64/python3.12/site-packages/kwf_lib/common.py", line 102, in __init__
          if fv_match := CENTOS_FIX_VERSION_REGEX.match(fv_string):
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        TypeError: expected string or bytes-like object, got 'MagicMock'
      
      Use already created FakeJI instead of Mock and initialize fixVersion name attribute explicitly.
      
      Signed-off-by: Jan Stancek's avatarJan Stancek <jstancek@redhat.com>
      fb67aef7
  3. Feb 11, 2025
  4. Feb 10, 2025
  5. Feb 06, 2025
  6. Feb 05, 2025
  7. Feb 04, 2025
  8. Feb 03, 2025
  9. Feb 01, 2025
  10. Jan 30, 2025
Loading