Skip to content

Commit

Permalink
Merge pull request #196 from nusbaume/build_cache_tests
Browse files Browse the repository at this point in the history
Implement new  build cache unit tests
  • Loading branch information
nusbaume authored Feb 14, 2023
2 parents a6f9d49 + b4eada5 commit 101fd31
Show file tree
Hide file tree
Showing 16 changed files with 1,362 additions and 267 deletions.
13 changes: 1 addition & 12 deletions .github/workflows/python_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,7 @@ jobs:
- name: python unit tests
run: |
# Run all python doctests in cime_config:
# CAM config classes doctests:
pytest cime_config/cam_config_classes.py --doctest-modules
# CAM config doctests:
pytest cime_config/cam_config.py --doctest-modules
# CAM autogen doctests:
pytest cime_config/cam_autogen.py --doctest-modules
# CAM build cache doctests:
python cime_config/cam_build_cache.py
# Namelist reader generator doctests:
pytest cime_config/create_readnl_files.py --doctest-modules
# ParamGen atm_in namelist writer doctests:
pytest cime_config/atm_in_paramgen.py --doctest-modules
pytest cime_config --doctest-modules
# Run all python doctests in src/data:
pytest src/data --doctest-modules
Expand Down
2 changes: 1 addition & 1 deletion cime_config/buildlib
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ from cam_config import ConfigCAM # CAM's configure structure
__CIMEROOT = os.environ.get("CIMEROOT")
if __CIMEROOT is None:
raise SystemExit("ERROR: must set CIMEROOT environment variable")
sys.path.append(os.path.join(__CIMEROOT, "scripts", "lib"))
sys.path.append(os.path.join(__CIMEROOT, "CIME", "Tools"))

#pylint: disable=wrong-import-position
# CIME imports
Expand Down
2 changes: 1 addition & 1 deletion cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ _CIMEROOT = os.environ.get("CIMEROOT")
if _CIMEROOT is None:
raise SystemExit("ERROR: must set CIMEROOT environment variable")

_LIBDIR = os.path.join(_CIMEROOT, "scripts", "Tools")
_LIBDIR = os.path.join(_CIMEROOT, "CIME", "Tools")
sys.path.append(_LIBDIR)
# pylint: disable=wildcard-import, wrong-import-position
# pylint: disable=unused-wildcard-import
Expand Down
13 changes: 9 additions & 4 deletions cime_config/cam_autogen.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,14 +533,19 @@ def generate_physics_suites(build_cache, preproc_defs, host_name,
nl_groups = namelist_obj.groups()
# include generated metadata files
scheme_nl_meta_files = namelist_obj.meta_files()
# Finally, make sure the CCPP caps are grenerated
# (although this may not really be necessary):
do_gen_ccpp = True

else:
# Not running namelist generator, collect metadata files and
# namelist group names from the build cache
nl_groups = build_cache.scheme_nl_groups()
# Not running namelist generator, collect metadata files
# and namelist group names from the build cache
scheme_nl_meta_files = build_cache.scheme_nl_metadata()
nl_groups = build_cache.scheme_nl_groups()
# end if
#Add the namelist meta files to the host files list
#if present:
if scheme_nl_meta_files:
do_gen_ccpp = True
host_files.extend(scheme_nl_meta_files)
# end if (no else)

Expand Down
Loading

0 comments on commit 101fd31

Please sign in to comment.