summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorTrevor Gamblin <tgamblin@baylibre.com>2024-02-15 15:52:05 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-02-16 15:14:26 +0000
commit122401ce482fe8db9d83ccbe74e7beb9aa3f850a (patch)
treebee217ffcf2b2638db68020625bec4611377ec9f /scripts
parent6d6a9247186432214de507e46a284cd4ebc12932 (diff)
downloadpoky-122401ce482fe8db9d83ccbe74e7beb9aa3f850a.tar.gz
patchtest-send-results: add --debug option
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. (From OE-Core rev: e50827d23fd3789e7a13df6918a06b198bbf4f95) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/patchtest-send-results17
1 files changed, 11 insertions, 6 deletions
diff --git a/scripts/patchtest-send-results b/scripts/patchtest-send-results
index f65d862074..8a3dadbd11 100755
--- a/scripts/patchtest-send-results
+++ b/scripts/patchtest-send-results
@@ -38,6 +38,7 @@ def has_a_failed_test(raw_results):
38 38
39parser = argparse.ArgumentParser(description="Send patchtest results to a submitter for a given patch") 39parser = argparse.ArgumentParser(description="Send patchtest results to a submitter for a given patch")
40parser.add_argument("-p", "--patch", dest="patch", required=True, help="The patch file to summarize") 40parser.add_argument("-p", "--patch", dest="patch", required=True, help="The patch file to summarize")
41parser.add_argument("-d", "--debug", dest="debug", required=False, action='store_true', help="Print raw email headers and content, but don't actually send it")
41args = parser.parse_args() 42args = parser.parse_args()
42 43
43if not os.path.exists(args.patch): 44if not os.path.exists(args.patch):
@@ -94,12 +95,16 @@ if has_a_failed_test(testresult):
94 '\nMIME-Version: 1.0" + \ 95 '\nMIME-Version: 1.0" + \
95 "\nContent-type: Multipart/Mixed;boundary="NextPart"\n\n--NextPart\nContent-Type: text/plain\n\n' + \ 96 "\nContent-type: Multipart/Mixed;boundary="NextPart"\n\n--NextPart\nContent-Type: text/plain\n\n' + \
96 reply_contents + '\n\n--NextPart' 97 reply_contents + '\n\n--NextPart'
97 response = ses_client.send_raw_email( 98
98 Source="patchtest@automation.yoctoproject.org", 99 if args.debug:
99 RawMessage={ 100 print(f"RawMessage: \n\n{raw_data}")
100 "Data": raw_data, 101 else:
101 }, 102 response = ses_client.send_raw_email(
102 ) 103 Source="patchtest@automation.yoctoproject.org",
104 RawMessage={
105 "Data": raw_data,
106 },
107 )
103 108
104else: 109else:
105 print(f"No failures identified for {args.patch}.") 110 print(f"No failures identified for {args.patch}.")