lava_wait_jobs.py: Initialize and use logging
How this works now, that there're visible build progress during compilation,
etc., but then jobs hang literally for hours in a call to lava_wait_jobs.py.
That's not ok, there should be regular processing updates visible to a human
operator, so they understand what happens, be able to debug issues, and look
for ways to improve. As the output from the script contains job results and
being parsed like that, an easy way to output diagnostics would be to stderr.
This is automatically achieved with Python logging module, so just use that.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Change-Id: I44d11fbc95848d9cdd652e1cb0602e3ed0da09ec
diff --git a/lava_helper/lava_wait_jobs.py b/lava_helper/lava_wait_jobs.py
index 30d49bb..ed8d0e6 100755
--- a/lava_helper/lava_wait_jobs.py
+++ b/lava_helper/lava_wait_jobs.py
@@ -21,12 +21,16 @@
import argparse
import shutil
import traceback
+import logging
from jinja2 import Environment, FileSystemLoader
from lava_helper import test_lava_dispatch_credentials
from lava_submit_jobs import submit_lava_jobs
import codecov_helper
+_log = logging.getLogger("lavaci")
+
+
def wait_for_jobs(user_args):
job_list = user_args.job_ids.split(",")
job_list = [int(x) for x in job_list if x != '']
@@ -46,6 +50,7 @@
codecov_helper.coverage_reports(finished_jobs, user_args)
def get_finished_jobs(job_list, user_args, lava):
+ _log.info("Waiting for %d LAVA jobs", len(job_list))
finished_jobs = lava.block_wait_for_jobs(job_list, user_args.dispatch_timeout, 5)
unfinished_jobs = [item for item in job_list if item not in finished_jobs]
for job in unfinished_jobs:
@@ -224,4 +229,5 @@
if __name__ == "__main__":
+ logging.basicConfig(level=logging.INFO)
main(get_cmd_args())