#7 Make multi-builds working with the runner
Merged 4 years ago by asaleh. Opened 4 years ago by pingou.

file modified
+1
@@ -308,6 +308,7 @@ 

              )

  

      utils.finalize(start)

+     return utils.logs

  

  

  if __name__ == "__main__":

@@ -228,6 +228,7 @@ 

              )

  

      utils.finalize(start)

+     return utils.logs

  

  

  if __name__ == "__main__":

file modified
+4 -1
@@ -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"

file modified
+24 -1
@@ -16,6 +16,7 @@ 

  import toml

  

  import monitor_gating

+ import monitor_gating_multi_builds

  

  s = sched.scheduler(time.time, time.sleep)

  conf = toml.load
@@ -54,7 +55,7 @@ 

      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,9 +74,31 @@ 

                  "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}")

+         print(sys.exc_info()[0])

      print(f"Next run in: {delay} seconds")

      s.enter(delay, 1, schedule, argument=(conf,))

  

no initial comment

Pull-Request has been merged by asaleh

4 years ago