0001-check-sr-results-Return-non-zero-exit-code-on-failur.patch 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. From ad8f2826f6e2cefb630f7fc2c7c99857f224e109 Mon Sep 17 00:00:00 2001
  2. From: Debbie Martin <Debbie.Martin@arm.com>
  3. Date: Tue, 5 Sep 2023 21:37:46 +0100
  4. Subject: [PATCH] check-sr-results: Return non-zero exit code on failure
  5. Return a non-zero exit code if there are any warnings or errors found.
  6. Upstream-Status: Pending
  7. Signed-off-by: Debbie Martin <Debbie.Martin@arm.com>
  8. ---
  9. check-sr-results.py | 6 ++++++
  10. 1 file changed, 6 insertions(+)
  11. diff --git a/check-sr-results.py b/check-sr-results.py
  12. index 12b89cd..48658f0 100755
  13. --- a/check-sr-results.py
  14. +++ b/check-sr-results.py
  15. @@ -185,6 +185,9 @@ class Stats:
  16. def inc_error(self):
  17. self._inc('error')
  18. + def has_warnings_or_errors(self):
  19. + return self.data['warning'] or self.data['error']
  20. +
  21. # Download (possibly large) file from URL.
  22. # We raise an exception in case of issue.
  23. @@ -1519,3 +1522,6 @@ if __name__ == '__main__':
  24. if args.print_meta:
  25. print()
  26. print_meta()
  27. +
  28. + if stats.has_warnings_or_errors():
  29. + exit(1)
  30. --
  31. 2.25.1