Skip to content

Commit

Permalink
Upload build statistics to the CI database
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-milovidov committed Jul 30, 2023
1 parent 91e67c1 commit 41ffc09
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion tests/ci/build_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
get_version_from_repo,
update_version_local,
)
from clickhouse_helper import (
ClickHouseHelper,
prepare_tests_results_for_clickhouse,
)
from stopwatch import Stopwatch

IMAGE_NAME = "clickhouse/binary-builder"
BUILD_LOG_NAME = "build_log.log"
Expand Down Expand Up @@ -268,6 +273,7 @@ def mark_failed_reports_pending(build_name: str, pr_info: PRInfo) -> None:
def main():
logging.basicConfig(level=logging.INFO)

stopwatch = Stopwatch()
build_name = sys.argv[1]

build_config = CI_CONFIG["build_config"][build_name]
Expand Down Expand Up @@ -394,7 +400,20 @@ def main():
)

upload_master_static_binaries(pr_info, build_config, s3_helper, build_output_path)
# Fail build job if not successeded

ch_helper = ClickHouseHelper()
prepared_events = prepare_tests_results_for_clickhouse(
pr_info,
[],
"success" if success else "failure",
stopwatch.duration_seconds,
stopwatch.start_time_str,
log_url,
f"Build ({build_name})",
)
ch_helper.insert_events_into(db="default", table="checks", events=prepared_events)

# Fail the build job if it didn't succeed
if not success:
sys.exit(1)

Expand Down

0 comments on commit 41ffc09

Please sign in to comment.