mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-14 19:45:11 +00:00
Merge pull request #51077 from ClickHouse/woboq-report-improvement
Improve woboq browser report
This commit is contained in:
commit
1bdf35e6cb
1
.github/workflows/woboq.yml
vendored
1
.github/workflows/woboq.yml
vendored
@ -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: |
|
||||
|
@ -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'<a href="{S3_DOWNLOAD}/{S3_TEST_REPORTS_BUCKET}/{s3_path_prefix}/index.html">'
|
||||
"{}</a>"
|
||||
)
|
||||
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'<a href="{S3_DOWNLOAD}/{S3_TEST_REPORTS_BUCKET}/codebrowser/index.html">'
|
||||
"Generate codebrowser site</a>"
|
||||
)
|
||||
|
||||
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:
|
||||
|
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user