From 05bdcea1763e12ea82996bb2b4fa0bfb2fe5dcdf Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Sat, 8 Nov 2025 05:56:10 -0700 Subject: [PATCH 1/2] Add a system test that runs the CESM_share unit tests Requires the CIME changes in https://github.com/ESMCI/cime/pull/4895. --- cime_config/SystemTests/funitshare.py | 26 ++++++++++++++++++++++++++ cime_config/config_tests.xml | 18 ++++++++++++++++++ cime_config/testlist_allactive.xml | 9 +++++++++ 3 files changed, 53 insertions(+) create mode 100644 cime_config/SystemTests/funitshare.py create mode 100644 cime_config/config_tests.xml diff --git a/cime_config/SystemTests/funitshare.py b/cime_config/SystemTests/funitshare.py new file mode 100644 index 000000000..7d28f75c8 --- /dev/null +++ b/cime_config/SystemTests/funitshare.py @@ -0,0 +1,26 @@ +""" +Implementation of the share code FUNIT test. + +This "system" test runs the share code's Fortran unit tests. We're abusing the system test +infrastructure to run these, so that a run of the test suite can result in the unit tests +being run as well. + +Grid and compset are irrelevant for this test type. +""" + +import os +from CIME.SystemTests.funit import FUNIT +from CIME.XML.standard_module_setup import * + +logger = logging.getLogger(__name__) + + +class FUNITSHARE(FUNIT): + def __init__(self, case): + FUNIT.__init__(self, case) + + def get_test_spec_dir(self): + return os.path.join(self._case.get_value("SRCROOT"), "share") + + def get_extra_run_tests_args(self): + return '--cmake-args " -DUNITTESTS=ON -DUSE_CIME_MACROS=ON"' diff --git a/cime_config/config_tests.xml b/cime_config/config_tests.xml new file mode 100644 index 000000000..4b14b8676 --- /dev/null +++ b/cime_config/config_tests.xml @@ -0,0 +1,18 @@ + + + + + + + + Run the share code's Fortran unit tests. Grid and compset (and most case settings) are ignored. + 1 + ndays + 11 + FALSE + FALSE + + + diff --git a/cime_config/testlist_allactive.xml b/cime_config/testlist_allactive.xml index 4c6878a7e..9c7952484 100644 --- a/cime_config/testlist_allactive.xml +++ b/cime_config/testlist_allactive.xml @@ -251,4 +251,13 @@ + + + + + + + + + From e9249aecd4a33d3373ace9973ca73571cbf4b954 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Sun, 9 Nov 2025 13:08:06 -0700 Subject: [PATCH 2/2] FUNITSHARE test needs to be mpi-serial to load the necessary modules --- cime_config/SystemTests/funitshare.py | 7 +++++++ cime_config/testlist_allactive.xml | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/cime_config/SystemTests/funitshare.py b/cime_config/SystemTests/funitshare.py index 7d28f75c8..8f6a8f76c 100644 --- a/cime_config/SystemTests/funitshare.py +++ b/cime_config/SystemTests/funitshare.py @@ -19,6 +19,13 @@ class FUNITSHARE(FUNIT): def __init__(self, case): FUNIT.__init__(self, case) + # The CMake build for the share unit tests uses the MPISERIAL env var to find the + # mpi-serial library. On derecho, MPISERIAL is not set even if the mpi-serial + # module is loaded; instead, there is an NCAR_ROOT_MPI_SERIAL variable. Set the + # needed MPISERIAL env var for this test. + if "NCAR_ROOT_MPI_SERIAL" in os.environ: + os.environ["MPISERIAL"] = os.environ["NCAR_ROOT_MPI_SERIAL"] + def get_test_spec_dir(self): return os.path.join(self._case.get_value("SRCROOT"), "share") diff --git a/cime_config/testlist_allactive.xml b/cime_config/testlist_allactive.xml index 9c7952484..95a993f4f 100644 --- a/cime_config/testlist_allactive.xml +++ b/cime_config/testlist_allactive.xml @@ -251,13 +251,13 @@ - + - +