From ee5ca7337efb76d89fbd87a9f2d58dfe5b01e9d6 Mon Sep 17 00:00:00 2001 From: "Mikhail f. Shiryaev" Date: Fri, 16 Jun 2023 12:51:31 +0200 Subject: [PATCH 1/2] Add reset to Stopwatch, improve codebrowser report --- tests/ci/codebrowser_check.py | 36 +++++++++++++++++++++++------------ tests/ci/stopwatch.py | 7 +++++-- 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/tests/ci/codebrowser_check.py b/tests/ci/codebrowser_check.py index 2dba5176c8b..a3414156bba 100644 --- a/tests/ci/codebrowser_check.py +++ b/tests/ci/codebrowser_check.py @@ -87,25 +87,37 @@ def main(): report_path = result_path / "html_report" logging.info("Report path %s", report_path) + s3_path_prefix = "codebrowser" + index_template = ( + f'' + "{}" + ) + additional_logs = [path.absolute() for path in result_path.glob("*.log")] + test_results = [ + TestResult( + index_template.format("Generate codebrowser site"), + state, + stopwatch.duration_seconds, + additional_logs, + ) + ] + if state == "success": + stopwatch.reset() _ = s3_helper.fast_parallel_upload_dir( report_path, s3_path_prefix, S3_TEST_REPORTS_BUCKET ) - - index_html = ( - f'' - "Generate codebrowser site" - ) - - additional_logs = [path.absolute() for path in result_path.glob("*.log")] - - test_results = [ - TestResult(index_html, state, stopwatch.duration_seconds, additional_logs) - ] + test_results.append( + TestResult( + index_template.format("Upload codebrowser site"), + state, + stopwatch.duration_seconds, + ) + ) # Check if the run log contains `FATAL Error:`, that means the code problem - stopwatch = Stopwatch() + stopwatch.reset() fatal_error = "FATAL Error:" logging.info("Search for '%s' in %s", fatal_error, run_log_path) with open(run_log_path, "r", encoding="utf-8") as rlfd: diff --git a/tests/ci/stopwatch.py b/tests/ci/stopwatch.py index 1ab6737530c..a63eb954a4d 100644 --- a/tests/ci/stopwatch.py +++ b/tests/ci/stopwatch.py @@ -5,8 +5,7 @@ import datetime class Stopwatch: def __init__(self): - self.start_time = datetime.datetime.utcnow() - self.start_time_str_value = self.start_time.strftime("%Y-%m-%d %H:%M:%S") + self.reset() @property def duration_seconds(self) -> float: @@ -15,3 +14,7 @@ class Stopwatch: @property def start_time_str(self) -> str: return self.start_time_str_value + + def reset(self) -> None: + self.start_time = datetime.datetime.utcnow() + self.start_time_str_value = self.start_time.strftime("%Y-%m-%d %H:%M:%S") From 5e3233f0e47d659035175d87d87a09825dbadc85 Mon Sep 17 00:00:00 2001 From: "Mikhail f. Shiryaev" Date: Fri, 16 Jun 2023 12:57:03 +0200 Subject: [PATCH 2/2] Increase woboq job timeout --- .github/workflows/woboq.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/woboq.yml b/.github/workflows/woboq.yml index bdfbc8fef9c..1ef729af30a 100644 --- a/.github/workflows/woboq.yml +++ b/.github/workflows/woboq.yml @@ -12,6 +12,7 @@ jobs: # don't use dockerhub push because this image updates so rarely WoboqCodebrowser: runs-on: [self-hosted, style-checker] + timeout-minutes: 420 # the task is pretty heavy, so there's an additional hour steps: - name: Set envs run: |