-
Notifications
You must be signed in to change notification settings - Fork 321
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
Add run_neon SystemTest #2345
Draft
samsrabin
wants to merge
3
commits into
ESCOMP:master
Choose a base branch
from
samsrabin:run-neon-systest
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Add run_neon SystemTest #2345
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
""" | ||
CTSM-specific test that uses the run_neon.py methods for setting up, building, and running a NEON | ||
site | ||
""" | ||
|
||
import os | ||
import sys | ||
from CIME.SystemTests.system_tests_common import SystemTestsCommon | ||
|
||
_CTSM_PYTHON = os.path.join( | ||
os.path.dirname(os.path.realpath(__file__)), os.pardir, os.pardir, "python" | ||
) | ||
sys.path.insert(1, _CTSM_PYTHON) | ||
import ctsm.site_and_regional.run_neon as rn # python: disable=wrong-import-position | ||
|
||
|
||
class RUNNEON(SystemTestsCommon): | ||
# pylint: disable=too-many-instance-attributes | ||
""" | ||
CTSM-specific test that uses the run_neon.py methods for setting up, building, and running a | ||
NEON site | ||
""" | ||
|
||
def __init__(self, case): | ||
# initialize an object interface to the SMS system test | ||
SystemTestsCommon.__init__(self, case) | ||
|
||
caseroot = self._case.get_value("CASEROOT") | ||
argv = [ | ||
"run_neon", | ||
"--neon-sites", | ||
"ABBY", | ||
"--output-root", | ||
caseroot, | ||
] | ||
|
||
( | ||
self._cesmroot, | ||
site_list, | ||
self._output_root, | ||
self._run_type, | ||
self._experiment, | ||
self._prism, | ||
self._overwrite, | ||
self._run_length, | ||
self._base_case_root, | ||
run_from_postad, | ||
self._setup_only, | ||
self._no_batch, | ||
self._rerun, | ||
self._user_version, | ||
available_list, | ||
self._res, | ||
self._compset, | ||
) = rn.setup(description="", argv=argv) | ||
|
||
if not available_list: | ||
raise RuntimeError("available_list not defined") | ||
self._neon_site = None | ||
for neon_site in available_list: | ||
if neon_site.name in site_list: | ||
self._neon_site = neon_site | ||
break | ||
if self._neon_site is None: | ||
raise RuntimeError( | ||
f"available_list does not contain any member of site_list: {site_list}" | ||
) | ||
|
||
if run_from_postad: | ||
self._neon_site.finidat = None | ||
|
||
def build_phase(self, sharedlib_only=False, model_only=False): | ||
""" | ||
Builds the case | ||
""" | ||
if not model_only: | ||
self._base_case_root = self._neon_site.build_base_case( | ||
self._cesmroot, | ||
self._output_root, | ||
self._res, | ||
self._compset, | ||
self._overwrite, | ||
self._setup_only, | ||
) | ||
|
||
def run_phase(self): | ||
""" | ||
Runs the case | ||
""" | ||
self._neon_site.run_case( | ||
self._base_case_root, | ||
self._run_type, | ||
self._prism, | ||
self._run_length, | ||
self._user_version, | ||
self._overwrite, | ||
self._setup_only, | ||
self._no_batch, | ||
self._rerun, | ||
self._experiment, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried with
if sharedlib_only
,if model_only
, etc., as well as with no conditional here. I get the same build error no matter what.