Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 27 additions & 16 deletions CIME/bless_test_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,15 @@ def bless_test_results(
check_memory=bless_mem,
)

# Report that we have discovered a case
logger.info(
"###############################################################################"
)
logger.info(
f"Blessing results for test: {test_name}, most recent result: {overall_result}"
)
logger.info(f"Case dir: {test_dir}")

# See if we need to bless namelist
if namelists_only or bless_all_non_perf:
if no_skip_pass:
Expand All @@ -382,15 +391,6 @@ def bless_test_results(
"Do not mix performance and non-performance blessing",
)

# Now, do the bless
logger.info(
"###############################################################################"
)
logger.info(
f"Blessing results for test: {test_name}, most recent result: {overall_result}"
)
logger.info(f"Case dir: {test_dir}")

if not nl_bless and not hist_bless and not tput_bless and not mem_bless:
logger.info(
" NOTHING to bless for test: {}, overall status: {}".format(
Expand All @@ -399,6 +399,7 @@ def bless_test_results(
)
else:

# Now, do the bless
logger.debug("Determined blesses for {!r}".format(test_name))
logger.debug("nl_bless = {}".format(nl_bless))
logger.debug("hist_bless = {}".format(hist_bless))
Expand Down Expand Up @@ -462,11 +463,21 @@ def bless_test_results(

# Make sure user knows that some tests were not blessed
success = True
if broken_blesses:
logger.warning(
"###############################################################################"
)
logger.warning("THERE WERE FAILED ATTEMPTS TO BLESS TESTS:")

for broken_bless, reason in broken_blesses:
logger.warning(
"FAILED TO BLESS TEST: {}, reason {}".format(broken_bless, reason)
" FAILED TO BLESS TEST: {}, reason {}".format(broken_bless, reason)
)
success = False

# If the user specifically requested this test be blessed OR
# if not but the reason was not a SKIP
if bless_tests or "(SKIP)" not in reason:
success = False

return success

Expand Down Expand Up @@ -594,13 +605,13 @@ def is_hist_bless_needed(
run_result = ts.get_status(RUN_PHASE)

if run_result is None:
broken_blesses.append((test_name, "no run phase"))
broken_blesses.append((test_name, "no run phase (SKIP)"))
logger.warning("Test '{}' did not make it to run phase".format(test_name))
needed = False
elif run_result != TEST_PASS_STATUS:
broken_blesses.append((test_name, "run phase did not pass"))
broken_blesses.append((test_name, "run phase did not pass (SKIP)"))
logger.warning(
"Test '{}' run phase did not pass, not safe to bless, test status = {}".format(
"Test '{}' run phase did not pass, not safe to bless, test status = ...\n{}".format(
test_name, ts.phase_statuses_dump()
)
)
Expand All @@ -621,9 +632,9 @@ def is_hist_bless_needed(
if only_failed_generate:
needed = True
else:
broken_blesses.append((test_name, "test did not pass"))
broken_blesses.append((test_name, "test did not pass (SKIP)"))
logger.warning(
"Test '{}' did not pass due to phase {}, not safe to bless, test status = {}".format(
"Test '{}' did not pass due to phase {}, not safe to bless, test status = ...\n{}".format(
test_name, phase, ts.phase_statuses_dump()
)
)
Expand Down
6 changes: 3 additions & 3 deletions CIME/tests/test_unit_bless_test_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@ def test_is_bless_needed_overall_fail(self):
)

assert not needed
assert broken_blesses == [("SMS.f19_g16.A", "test did not pass")]
assert broken_blesses == [("SMS.f19_g16.A", "test did not pass (SKIP)")]

def test_is_bless_needed_generate_fail(self):
ts = mock.MagicMock()
Expand Down Expand Up @@ -1064,7 +1064,7 @@ def test_is_bless_needed_run_phase_fail(self):
)

assert not needed
assert broken_blesses == [("SMS.f19_g16.A", "run phase did not pass")]
assert broken_blesses == [("SMS.f19_g16.A", "run phase did not pass (SKIP)")]

def test_is_bless_needed_no_run_phase(self):
ts = mock.MagicMock()
Expand All @@ -1077,7 +1077,7 @@ def test_is_bless_needed_no_run_phase(self):
)

assert not needed
assert broken_blesses == [("SMS.f19_g16.A", "no run phase")]
assert broken_blesses == [("SMS.f19_g16.A", "no run phase (SKIP)")]

def test_is_bless_needed(self):
ts = mock.MagicMock()
Expand Down
Loading