]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
patchtest-send-results: add --debug option
authorTrevor Gamblin <tgamblin@baylibre.com>
Thu, 15 Feb 2024 20:52:05 +0000 (15:52 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 16 Feb 2024 15:13:16 +0000 (15:13 +0000)
Add a -d/--debug option to patchtest-send-results so that the contents
of the constructed raw email can be checked without actually sending
anything to the list or patch author.

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/patchtest-send-results

index f65d862074424129418f3b282f5ce15052ee8332..8a3dadbd111a0a29d0e0c422dbae50856419c3b9 100755 (executable)
@@ -38,6 +38,7 @@ def has_a_failed_test(raw_results):
 
 parser = argparse.ArgumentParser(description="Send patchtest results to a submitter for a given patch")
 parser.add_argument("-p", "--patch", dest="patch", required=True, help="The patch file to summarize")
+parser.add_argument("-d", "--debug", dest="debug", required=False, action='store_true', help="Print raw email headers and content, but don't actually send it")
 args = parser.parse_args()
 
 if not os.path.exists(args.patch):
@@ -94,12 +95,16 @@ if has_a_failed_test(testresult):
         '\nMIME-Version: 1.0" + \
         "\nContent-type: Multipart/Mixed;boundary="NextPart"\n\n--NextPart\nContent-Type: text/plain\n\n' + \
         reply_contents + '\n\n--NextPart'
-    response = ses_client.send_raw_email(
-        Source="patchtest@automation.yoctoproject.org",
-        RawMessage={
-            "Data": raw_data,
-        },
-    )
+
+    if args.debug:
+        print(f"RawMessage: \n\n{raw_data}")
+    else:
+        response = ses_client.send_raw_email(
+            Source="patchtest@automation.yoctoproject.org",
+            RawMessage={
+                "Data": raw_data,
+            },
+        )
 
 else:
     print(f"No failures identified for {args.patch}.")