From 5768a2dbb5808418afcb99e1d6e4dc9cdc414a76 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Feb 06 2020 15:40:38 +0000 Subject: [PATCH 1/3] Make the single build and multi builds script return their logs This way the runner can gather them and send them over via fedora-messaging. Signed-off-by: Pierre-Yves Chibon --- diff --git a/monitor_gating.py b/monitor_gating.py index 78a45b6..a7c1d64 100644 --- a/monitor_gating.py +++ b/monitor_gating.py @@ -308,6 +308,7 @@ def main(args): ) utils.finalize(start) + return utils.logs if __name__ == "__main__": diff --git a/monitor_gating_multi_builds.py b/monitor_gating_multi_builds.py index 5ff0769..64ebcbd 100644 --- a/monitor_gating_multi_builds.py +++ b/monitor_gating_multi_builds.py @@ -228,6 +228,7 @@ def main(args): ) utils.finalize(start) + return utils.logs if __name__ == "__main__": From 6512b65c42244fbd21375598b835d6dbd13cbcce Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Feb 06 2020 15:40:38 +0000 Subject: [PATCH 2/3] Add the multi-builds gating workflow to the runner Signed-off-by: Pierre-Yves Chibon --- diff --git a/runner.cfg b/runner.cfg index 36c2f1d..7a996c0 100644 --- a/runner.cfg +++ b/runner.cfg @@ -1,5 +1,8 @@ # Time between two runs in second delay = 3600 -# CLI arguments to give to the script testing the single package gating workflow +# CLI arguments to give to the script testing the single build gating workflow workflow_single_gating_args = "--conf monitor_gating_stg.cfg --auto-update --no-pr" + +# CLI arguments to give to the script testing the multi builds gating workflow +workflow_multi_gating_args = "--conf monitor_gating_stg.cfg" diff --git a/runner.py b/runner.py index 86e65ca..cb5fe2f 100644 --- a/runner.py +++ b/runner.py @@ -16,6 +16,7 @@ import fedora_messaging.exceptions import toml import monitor_gating +import monitor_gating_multi_builds s = sched.scheduler(time.time, time.sleep) conf = toml.load @@ -54,7 +55,7 @@ def schedule(conf): delay = conf["delay"] print("Tests started:", datetime.datetime.utcnow()) try: - #TEST HERE + # Single Build Gating single_args = conf["workflow_single_gating_args"].split() notify( topic=f"single-build.start", @@ -73,6 +74,27 @@ def schedule(conf): "success": success, } ) + + # Multi Build Gating + multi_args = conf["workflow_multi_gating_args"].split() + notify( + topic=f"multi-build.start", + message={ + "arguments": multi_args, + } + ) + output = monitor_gating_multi_builds.main(multi_args) + output_text="\n".join(output) + success="[FAILED]" not in output_text + notify( + topic=f"multi-build.end.{success}", + message={ + "output": output, + "output_text": output_text, + "success": success, + } + ) + print("Tests finished:", datetime.datetime.utcnow()) except Exception as err: print(f"Tests failed with: {err}") From 6f95c37ee2dd80f758331f96602e5533c3d45f35 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Feb 06 2020 15:40:38 +0000 Subject: [PATCH 3/3] Print the stacktrace when catching an exception This will help figuring out where things went wrong. Signed-off-by: Pierre-Yves Chibon --- diff --git a/runner.py b/runner.py index cb5fe2f..a4f69cd 100644 --- a/runner.py +++ b/runner.py @@ -98,6 +98,7 @@ def schedule(conf): print("Tests finished:", datetime.datetime.utcnow()) except Exception as err: print(f"Tests failed with: {err}") + print(sys.exc_info()[0]) print(f"Next run in: {delay} seconds") s.enter(delay, 1, schedule, argument=(conf,))