Whilst the script needs to continue if we fail to generate a regression report,
set the exit code accordingly so our CI can flag the issue.

Signed-off-by: Richard Purdie <[email protected]>
---
 scripts/send_qa_email.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/scripts/send_qa_email.py b/scripts/send_qa_email.py
index 8f913a6..d113377 100755
--- a/scripts/send_qa_email.py
+++ b/scripts/send_qa_email.py
@@ -15,6 +15,8 @@ import logging
 
 import utils
 
+exitcode = 0
+
 def is_release_version(version):
     p = re.compile('\d{8}-\d+')
     return version is not None and p.match(version) is None
@@ -74,6 +76,7 @@ def generate_regression_report(querytool, targetrepodir, 
base, target, resultdir
            f.write(regreport)
     except subprocess.CalledProcessError as e:
         error = str(e)
+        exitcode = 1
         log.error(f"Error while generating report between {target} and {base} 
: {error}")
 
 def send_qa_email():
@@ -177,7 +180,7 @@ def send_qa_email():
 
     if args.send.lower() != 'true' or not args.publish_dir or not args.release:
         utils.printheader("Not sending QA email")
-        sys.exit(0)
+        sys.exit(exitcode)
 
     utils.printheader("Generating QA email")
 
@@ -225,6 +228,7 @@ def send_qa_email():
     # Many distros have sendmail in */sbin
     env["PATH"] = env["PATH"] + ":/usr/sbin:/sbin"
     subprocess.check_call('echo "' + email +' " | sendmail -t', shell=True, 
env=env)
+    sys.exit(exitcode)
 
 if __name__ == "__main__":
     send_qa_email()
-- 
2.39.2

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#61125): https://lists.yoctoproject.org/g/yocto/message/61125
Mute This Topic: https://lists.yoctoproject.org/mt/101592516/21656
Group Owner: [email protected]
Unsubscribe: 
https://lists.yoctoproject.org/g/yocto/leave/6691583/21656/737036229/xyzzy 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to