test_mbox_bugzilla.py 735 B

1234567891011121314151617181920
  1. # Checks related to the patch's bugzilla tag
  2. #
  3. # Copyright (C) 2016 Intel Corporation
  4. #
  5. # SPDX-License-Identifier: GPL-2.0-only
  6. import pyparsing
  7. import base
  8. class Bugzilla(base.Base):
  9. rexp_detect = pyparsing.Regex('\[\s?YOCTO.*\]')
  10. rexp_validation = pyparsing.Regex('\[(\s?YOCTO\s?#\s?(\d+)\s?,?)+\]')
  11. def test_bugzilla_entry_format(self):
  12. for commit in Bugzilla.commits:
  13. if not self.rexp_detect.search_string(commit.commit_message):
  14. self.skip("No bug ID found")
  15. elif not self.rexp_validation.search_string(commit.commit_message):
  16. self.fail('Bugzilla issue ID is not correctly formatted - specify it with format: "[YOCTO #<bugzilla ID>]"', commit=commit)