Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moves check_input_data to SystemTestsCommon when running a test #4481

Merged
merged 3 commits into from
Sep 8, 2023
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
9 changes: 9 additions & 0 deletions CIME/SystemTests/system_tests_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,15 @@ def run_indv(
stop_option = self._case.get_value("STOP_OPTION")
run_type = self._case.get_value("RUN_TYPE")
rundir = self._case.get_value("RUNDIR")
try:
self._case.check_all_input_data()
except CIMEError:
caseroot = self._case.get_value("CASEROOT")
raise CIMEError(
"Could not find all inputdata on any server, try "
"manually running `./check_input_data --download "
f"--versbose` from {caseroot!r}."
) from None
if submit_resubmits is None:
do_resub = self._case.get_value("BATCH_SYSTEM") != "none"
else:
Expand Down
3 changes: 2 additions & 1 deletion CIME/case/case_submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,8 @@ def check_case(self, skip_pnl=False, chksum=False):
if not skip_pnl:
self.create_namelists() # Must be called before check_all_input_data
logger.info("Checking that inputdata is available as part of case submission")
self.check_all_input_data(chksum=chksum)
if not self.get_value("TEST"):
self.check_all_input_data(chksum=chksum)

if self.get_value("COMP_WAV") == "ww":
# the ww3 buildnml has dependencies on inputdata so we must run it again
Expand Down
10 changes: 10 additions & 0 deletions CIME/tests/test_unit_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,20 @@ def make_valid_case(path):
class TestCaseSubmit(unittest.TestCase):
def test_check_case(self):
case = mock.MagicMock()
# get_value arguments TEST, COMP_WAV, COMP_INTERFACE, BUILD_COMPLETE
case.get_value.side_effect = [False, "", "", True]
case_submit.check_case(case, chksum=True)

case.check_all_input_data.assert_called_with(chksum=True)

def test_check_case_test(self):
case = mock.MagicMock()
# get_value arguments TEST, COMP_WAV, COMP_INTERFACE, BUILD_COMPLETE
case.get_value.side_effect = [True, "", "", True]
case_submit.check_case(case, chksum=True)

case.check_all_input_data.assert_not_called()

@mock.patch("CIME.case.case_submit.lock_file")
@mock.patch("CIME.case.case_submit.unlock_file")
@mock.patch("os.path.basename")
Expand Down
Loading