Skip to content

Commit 39a1cfd

Browse files
authored
Merge pull request ClickHouse#78659 from ClickHouse/ci_improve_job_summary_in_info
CI: Improve job summary in report
2 parents 1602ec8 + fe60901 commit 39a1cfd

File tree

7 files changed

+14
-22
lines changed

7 files changed

+14
-22
lines changed

ci/jobs/build_clickhouse.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,7 @@ def main():
211211
)
212212
res = results[-1].is_ok()
213213

214-
Result.create_from(results=results, stopwatch=stop_watch).add_job_summary_to_info(
215-
with_local_run_command=True
216-
).complete_job()
214+
Result.create_from(results=results, stopwatch=stop_watch).complete_job()
217215

218216

219217
if __name__ == "__main__":

ci/jobs/check_style.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,4 @@ def parse_args():
392392
)
393393
)
394394

395-
Result.create_from(results=results).add_job_summary_to_info(
396-
with_local_run_command=True, with_test_in_run_command=True
397-
).complete_job()
395+
Result.create_from(results=results).complete_job()

ci/jobs/fast_test.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,6 @@ def main():
267267

268268
Result.create_from(
269269
results=results, stopwatch=stop_watch, files=attach_files
270-
).add_job_summary_to_info(
271-
with_local_run_command=True, with_test_in_run_command=True
272270
).complete_job()
273271

274272

ci/jobs/performance_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ def too_many_slow(msg):
602602

603603
Result.create_from(
604604
results=results, stopwatch=stop_watch, files=files_to_attach, info=message
605-
).add_job_summary_to_info(with_local_run_command=True).complete_job()
605+
).complete_job()
606606

607607

608608
if __name__ == "__main__":

ci/jobs/unit_tests_job.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22

33
if __name__ == "__main__":
44
Result.from_gtest_run(
5-
name="",
65
unit_tests_path="./ci/tmp/unit_tests_dbms",
7-
).add_job_summary_to_info(with_local_run_command=True).complete_job()
6+
).complete_job()

ci/praktika/docker.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,8 @@ def merge_manifest(
9494
commands.append(f"docker manifest push {config.name}:{digests[config.name]}")
9595

9696
if add_latest:
97-
commands.append(
98-
"docker manifest create --amend "
99-
+ " ".join((f"{config.name}:{t}" for t in tags))
100-
)
101-
commands.append(f"docker manifest push {config.name}:latest")
97+
commands.append(f"docker tag {config.name}:{tags[0]} {config.name}:latest")
98+
commands.append(f"docker push {config.name}:latest")
10299

103100
return Result.from_commands_run(
104101
name=f"merge: {config.name}:{digests[config.name]} (latest={add_latest})",

ci/praktika/result.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,9 @@ def set_link(self, link) -> "Result":
193193
self.dump()
194194
return self
195195

196-
def add_job_summary_to_info(
197-
self, with_local_run_command=False, with_test_in_run_command=False
198-
):
196+
def _add_job_summary_to_info(self):
199197
subresult_with_tests = self
198+
with_test_in_run_command = False
200199

201200
# Use a specific sub-result if configured
202201
job_config = _Environment.get().JOB_CONFIG or {}
@@ -205,6 +204,7 @@ def add_job_summary_to_info(
205204
for r in self.results:
206205
if r.name == result_name_for_cidb:
207206
subresult_with_tests = r
207+
with_test_in_run_command = True
208208
if subresult_with_tests.info:
209209
self.set_info(subresult_with_tests.info)
210210
break
@@ -218,8 +218,8 @@ def add_job_summary_to_info(
218218

219219
if failed:
220220
if len(failed) < 10:
221-
failed_tcs = "\n".join(failed)
222-
self.set_info(f"Failed:\n{failed_tcs}")
221+
failed_tcs = ", ".join(failed)
222+
self.set_info(f"Failed: {failed_tcs}")
223223

224224
# Suggest local command to rerun
225225
if with_local_run_command:
@@ -454,7 +454,9 @@ def from_commands_run(
454454
files=[log_file] if with_log else None,
455455
)
456456

457-
def complete_job(self):
457+
def complete_job(self, with_job_summary_in_info=True):
458+
if with_job_summary_in_info:
459+
self._add_job_summary_to_info()
458460
self.dump()
459461
if not self.is_ok():
460462
print("ERROR: Job Failed")

0 commit comments

Comments
 (0)