From 4288c2a0f657a60e86c99390124da615b6ebe683 Mon Sep 17 00:00:00 2001 From: Soren Rasmussen Date: Fri, 9 Aug 2024 13:02:57 -0600 Subject: [PATCH 1/3] Print passing summary as well as the failing summary --- scm/src/run_scm.py | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/scm/src/run_scm.py b/scm/src/run_scm.py index 87d2020c5..520e1fb93 100755 --- a/scm/src/run_scm.py +++ b/scm/src/run_scm.py @@ -774,28 +774,36 @@ def print_report_line(case_s, suite, namelist, max_str_lens): logging.info(f"| {case_s:<{case_l}} | {suite:<{suite_l}} | {namelist:<{namelist_l}} |") -def print_error_report(error_logs, total_count, max_str_lens): +def print_report(logs, total_count, max_str_lens, + passing=False, failing=False): case_l = max_str_lens.case suite_l = max_str_lens.suite namelist_l = max_str_lens.namelist status_l = max_str_lens.status # error_log contains header, subtracting 1 from error - error_count = error_logs.shape[0] - 1 + error_count = logs.shape[0] - 1 passing_count = total_count - error_count header_printed = False column_width = (case_l + suite_l + namelist_l + status_l + 13) - # print formatted asummary - print("Failure Summary:") + # print formatted summary + print("") + if (passing): + print("Passing Summary:") + if (failing): + print("Failure Summary:") print("-" * column_width) - for error_log in error_logs: - case_s, suite, namelist, status = error_log + for log in logs: + case_s, suite, namelist, status = log print(f"| {case_s:<{case_l}} | {suite:<{suite_l}} | {namelist:<{namelist_l}} | {status:<{status_l}} |") if not header_printed: print("-" * column_width) header_printed = True print("-" * column_width) - print(f"[{error_count}/{total_count}] failed cases, [{passing_count}/{total_count}] passing cases") + if (passing): + print(f"[{passing_count}/{total_count}] passing cases") + if (failing): + print(f"[{error_count}/{total_count}] failed cases") class MaxStrLengths: @@ -827,7 +835,8 @@ def find_max_str_lengths(run_list): def main(): (file, case, sdf, namelist, tracers, use_gdb, runtime, runtime_mult, docker, \ verbose, levels, npz_type, vert_coord_file, case_data_dir, n_itt_out, \ - n_itt_diag, run_dir, bin_dir, timestep, mpi_command, stop_on_error) = parse_arguments() + n_itt_diag, run_dir, bin_dir, timestep, mpi_command, stop_on_error \ + ) = parse_arguments() setup_logging(verbose) @@ -883,6 +892,7 @@ def main(): # setup variables error_logs = [["Failed Case", "Suite", "Namelist", "Status"]] + pass_logs = [["Passing Case", "Suite", "Namelist", "Status"]] max_str_lens = find_max_str_lengths(run_list) failed_case = False irun = 0 @@ -959,6 +969,9 @@ def main(): if status == 0: logging.info('Process "(case={0}, suite={1}, namelist={2}" completed successfully'. \ format(run["case"], run["suite"], active_suite.namelist)) + pass_logs = np.append(pass_logs, + [[run["case"], run["suite"], active_suite.namelist, status]], + axis=0) else: failed_case = True error_str = 'Process "(case={0}, suite={1}, namelist={2}" exited with code {3}'. \ @@ -973,8 +986,9 @@ def main(): if docker: copy_outdir(exp_dir) + print_report(pass_logs, len(run_list), max_str_lens, passing=True) if (failed_case): - print_error_report(error_logs, len(run_list), max_str_lens) + print_report(error_logs, len(run_list), max_str_lens, failing=True) sys.exit(1) From c2447bb6403bd7d49ec9322e7314addcac2a4ad9 Mon Sep 17 00:00:00 2001 From: Soren Rasmussen Date: Fri, 9 Aug 2024 13:06:33 -0600 Subject: [PATCH 2/3] Adding merge pull request #1081 --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index e2f4a6368..7506fd110 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit e2f4a63682c679660f0fd334b34e7c5c8c4042d4 +Subproject commit 7506fd110dbeefca83ecc6ecd7f50c0b4989694a From 06ebb1761a5dbab4ccb6ae2658bc44c3cd0d80a2 Mon Sep 17 00:00:00 2001 From: Soren Rasmussen Date: Fri, 9 Aug 2024 13:50:50 -0600 Subject: [PATCH 3/3] fixing passing/failing counts in CI summary --- scm/src/run_scm.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scm/src/run_scm.py b/scm/src/run_scm.py index 520e1fb93..93f09435f 100755 --- a/scm/src/run_scm.py +++ b/scm/src/run_scm.py @@ -780,9 +780,6 @@ def print_report(logs, total_count, max_str_lens, suite_l = max_str_lens.suite namelist_l = max_str_lens.namelist status_l = max_str_lens.status - # error_log contains header, subtracting 1 from error - error_count = logs.shape[0] - 1 - passing_count = total_count - error_count header_printed = False column_width = (case_l + suite_l + namelist_l + status_l + 13) @@ -799,10 +796,14 @@ def print_report(logs, total_count, max_str_lens, if not header_printed: print("-" * column_width) header_printed = True + print("-" * column_width) if (passing): + # error_log contains header, subtracting 1 from error + passing_count = logs.shape[0] - 1 print(f"[{passing_count}/{total_count}] passing cases") if (failing): + error_count = logs.shape[0] - 1 print(f"[{error_count}/{total_count}] failed cases")