Skip to contentSkip to conversation

patchtest: shorten patch signed-off-by test output

PATCH New Trevor Gamblin 1 participant 1 message Nov 29, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 patchtest: shorten patch signed-off-by test output

The patch Signed-off-by test's output line is excessively long, and can trigger a failsafe in the patchtest automated service's email content generation. Shorten the output by reducing redundant phrasing and using os.path.basename to get only the failing patch's name, not the entire path, as the submitter should have a good idea of where it is located regardless.

---
 meta/lib/patchtest/tests/test_patch.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/lib/patchtest/tests/test_patch.py +2 -1
index 65d0f930b05..d7187a0cb1b 100644
@@ -6,6 +6,7 @@
 #
 
 import base
+import os
 import parse_signed_off_by
 import parse_upstream_status
 import pyparsing
@@ -87,7 +88,7 @@ class TestPatch(base.Base):
                 if TestPatch.prog.search_string(payload):
                     break
             else:
-                self.fail('A patch file has been added without a Signed-off-by tag. Sign off the added patch file (%s)' % newpatch.path)
+                self.fail('A patch file has been added without a Signed-off-by tag: \'%s\'' % os.path.basename(newpatch.path))
 
     def test_cve_tag_format(self):
         for commit in TestPatch.commits:
Signature · 1 line
2.43.0