summaryrefslogtreecommitdiffstats
path: root/meta/lib/patchtest/tests
diff options
context:
space:
mode:
authorTrevor Gamblin <tgamblin@baylibre.com>2024-09-24 07:54:59 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-09-30 17:00:50 +0100
commitd6ede9c73b44062d8831a08f522d519591bf29c2 (patch)
tree17711c77f409da9d7ed38361c9551e6bb6f967dd /meta/lib/patchtest/tests
parentbb0f1625d7655d04c6df3c144e488f676ff2f762 (diff)
downloadpoky-d6ede9c73b44062d8831a08f522d519591bf29c2.tar.gz
patchtest: mbox.py: new data implementation
Consolidate and improve some objects: - absorb utils.py functionality - repo.py: use mbox.py - repo.py: remove some cruft - utils.py: replace with logs.py - utils.py: delete - patch.py: delete - scripts/patchtest: use logging directly - general cleanup (From OE-Core rev: d4fbdb1d15f281b236137d63710c73bca8911a36) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/patchtest/tests')
-rw-r--r--meta/lib/patchtest/tests/base.py5
-rw-r--r--meta/lib/patchtest/tests/test_metadata.py2
2 files changed, 3 insertions, 4 deletions
diff --git a/meta/lib/patchtest/tests/base.py b/meta/lib/patchtest/tests/base.py
index 424e61b5be..911addb199 100644
--- a/meta/lib/patchtest/tests/base.py
+++ b/meta/lib/patchtest/tests/base.py
@@ -37,7 +37,6 @@ class Base(unittest.TestCase):
37 endcommit_messages_regex = re.compile(r'\(From \w+-\w+ rev:|(?<!\S)Signed-off-by|(?<!\S)---\n') 37 endcommit_messages_regex = re.compile(r'\(From \w+-\w+ rev:|(?<!\S)Signed-off-by|(?<!\S)---\n')
38 patchmetadata_regex = re.compile(r'-{3} \S+|\+{3} \S+|@{2} -\d+,\d+ \+\d+,\d+ @{2} \S+') 38 patchmetadata_regex = re.compile(r'-{3} \S+|\+{3} \S+|@{2} -\d+,\d+ \+\d+,\d+ @{2} \S+')
39 39
40
41 @staticmethod 40 @staticmethod
42 def msg_to_commit(msg): 41 def msg_to_commit(msg):
43 payload = msg.get_payload() 42 payload = msg.get_payload()
@@ -66,13 +65,13 @@ class Base(unittest.TestCase):
66 def setUpClass(cls): 65 def setUpClass(cls):
67 66
68 # General objects: mailbox.mbox and patchset 67 # General objects: mailbox.mbox and patchset
69 cls.mbox = mailbox.mbox(PatchTestInput.repo.patch) 68 cls.mbox = mailbox.mbox(PatchTestInput.repo.patch.path)
70 69
71 # Patch may be malformed, so try parsing it 70 # Patch may be malformed, so try parsing it
72 cls.unidiff_parse_error = '' 71 cls.unidiff_parse_error = ''
73 cls.patchset = None 72 cls.patchset = None
74 try: 73 try:
75 cls.patchset = unidiff.PatchSet.from_filename(PatchTestInput.repo.patch, encoding=u'UTF-8') 74 cls.patchset = unidiff.PatchSet.from_filename(PatchTestInput.repo.patch.path, encoding=u'UTF-8')
76 except unidiff.UnidiffParseError as upe: 75 except unidiff.UnidiffParseError as upe:
77 cls.patchset = [] 76 cls.patchset = []
78 cls.unidiff_parse_error = str(upe) 77 cls.unidiff_parse_error = str(upe)
diff --git a/meta/lib/patchtest/tests/test_metadata.py b/meta/lib/patchtest/tests/test_metadata.py
index 8c2305a184..d7e5e187f6 100644
--- a/meta/lib/patchtest/tests/test_metadata.py
+++ b/meta/lib/patchtest/tests/test_metadata.py
@@ -168,7 +168,7 @@ class TestMetadata(base.Metadata):
168 def test_cve_check_ignore(self): 168 def test_cve_check_ignore(self):
169 # Skip if we neither modified a recipe or target branches are not 169 # Skip if we neither modified a recipe or target branches are not
170 # Nanbield and newer. CVE_CHECK_IGNORE was first deprecated in Nanbield. 170 # Nanbield and newer. CVE_CHECK_IGNORE was first deprecated in Nanbield.
171 if not self.modified or PatchTestInput.repo.branch == "kirkstone" or PatchTestInput.repo.branch == "dunfell": 171 if not self.modified or PatchTestInput.repo.patch.branch == "kirkstone" or PatchTestInput.repo.patch.branch == "dunfell":
172 self.skip('No modified recipes or older target branch, skipping test') 172 self.skip('No modified recipes or older target branch, skipping test')
173 for pn in self.modified: 173 for pn in self.modified:
174 # we are not interested in images 174 # we are not interested in images