diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index bb425bb602..9f4ea4b748 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -77,3 +77,4 @@ ac03492012837799b7111607188acff9f739044a d858665d799690d73b56bcb961684382551193f4 c0c6da391ee359f2765439426f3a2a4593a95343 598de2f05638286b3d99ac0ed120977cbc554c3d +5e7346ad28be374735ff9200861d9526d3dbbf53 diff --git a/.github/workflows/check-testlists.yml b/.github/workflows/check-testlists.yml new file mode 100644 index 0000000000..2dcc871974 --- /dev/null +++ b/.github/workflows/check-testlists.yml @@ -0,0 +1,37 @@ +name: Run checking of the testlist + +on: + push: + # Run when a change to these files is pushed to any branch. Without the "branches:" line, for some reason this will be run whenever a tag is pushed, even if the listed files aren't changed. + branches: ['*'] + paths: + - 'python/ctsm/add_supertestlists.py' + - 'cime_config/add_supertestlists' + - 'cime_config/testlist_clm.xml' + pull_request: + # Run on pull requests that change the listed files + paths: + - 'python/ctsm/add_supertestlists.py' + - 'cime_config/add_supertestlists' + - 'cime_config/testlist_clm.xml' + +jobs: + testlist-supertestlists: + runs-on: ubuntu-latest + steps: + # Checkout the code + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + # Set up the conda environment + - uses: conda-incubator/setup-miniconda@2defc80cc6f4028b1780c50faf08dd505d698976 # v3 + with: + activate-environment: ctsm_pylib + environment-file: python/conda_env_ctsm_py.yml + channels: conda-forge + auto-activate-base: false + + # Run add_supertestlists + - name: Run testlist checker for that lists that should be subsets of others are valid + run: | + cd cime_config/testdef + conda run -n ctsm_pylib ./add_super_testlists --silent --check-only diff --git a/.gitmodules b/.gitmodules index 3943014791..e1e534712e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -68,7 +68,7 @@ fxDONOTUSEurl = https://github.com/ESCOMP/mizuRoute [submodule "ccs_config"] path = ccs_config url = https://github.com/ESMCI/ccs_config_cesm.git -fxtag = ccs_config_cesm1.0.83 +fxtag = ccs_config_cesm1.0.88 fxrequired = ToplevelRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/ESMCI/ccs_config_cesm.git @@ -76,7 +76,7 @@ fxDONOTUSEurl = https://github.com/ESMCI/ccs_config_cesm.git [submodule "cime"] path = cime url = https://github.com/ESMCI/cime -fxtag = cime6.2.2 +fxtag = cime6.5.5 fxrequired = ToplevelRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/ESMCI/cime @@ -84,7 +84,7 @@ fxDONOTUSEurl = https://github.com/ESMCI/cime [submodule "cmeps"] path = components/cmeps url = https://github.com/ESCOMP/CMEPS.git -fxtag = cmeps1.1.47 +fxtag = cmeps1.1.64 fxrequired = ToplevelRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/ESCOMP/CMEPS.git @@ -92,7 +92,7 @@ fxDONOTUSEurl = https://github.com/ESCOMP/CMEPS.git [submodule "cdeps"] path = components/cdeps url = https://github.com/ESCOMP/CDEPS.git -fxtag = cdeps1.0.103 +fxtag = cdeps1.0.105 fxrequired = ToplevelRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/ESCOMP/CDEPS.git @@ -100,7 +100,7 @@ fxDONOTUSEurl = https://github.com/ESCOMP/CDEPS.git [submodule "share"] path = share url = https://github.com/ESCOMP/CESM_share -fxtag = share1.1.20 +fxtag = share1.1.21 fxrequired = ToplevelRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/ESCOMP/CESM_share diff --git a/ccs_config b/ccs_config index 39683243b4..7c8bd604c8 160000 --- a/ccs_config +++ b/ccs_config @@ -1 +1 @@ -Subproject commit 39683243b4e8e5b4576fd1b828c3ec4c9e15bc6b +Subproject commit 7c8bd604c818e4e832dda02b8584260fb7e22efc diff --git a/cime b/cime index 8961a11428..92ae0fd813 160000 --- a/cime +++ b/cime @@ -1 +1 @@ -Subproject commit 8961a11428891c96d7ed9390314c7dadc511e29f +Subproject commit 92ae0fd8133a3397a95f1cfcfa40dc138562f305 diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 6eb0b2fcdb..13d9c5495c 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -142,20 +142,6 @@ - - - FAIL - ESCOMP/CDEPS#3788 - - - - - - FAIL - ESCOMP/CDEPS#3788 - - - FAIL diff --git a/cime_config/testdefs/add_super_testlists b/cime_config/testdefs/add_super_testlists new file mode 100755 index 0000000000..917bc129f4 --- /dev/null +++ b/cime_config/testdefs/add_super_testlists @@ -0,0 +1,33 @@ +#!/usr/bin/env python3 +""" +This is a just top-level skeleton script that calls +add_super_testlists.py. +The original code (add_super_testlists.py) is located under the +python/ctsm folder. + +For full instructions on how to run the code and different options, +please check the python/ctsm/add_super_testlists.py file, or run this +script with --help. + +---------------------------------------------------------------- +Instructions for running using conda python environments: + +../../py_env_create +conda activate ctsm_py + +Utilities to ensure tests in `testlist_clm.xml` are included in +super-testlists (for example, `ctsm_release`). +""" +import os +import sys + +# -- add python/ctsm to path +_CTSM_PYTHON = os.path.join( + os.path.dirname(os.path.realpath(__file__)), os.pardir, os.pardir, "python" +) +sys.path.insert(1, _CTSM_PYTHON) + +from ctsm.add_super_testlists import main # pylint: disable=wrong-import-position + +if __name__ == "__main__": + main() diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 7e90993903..a5a19b0b92 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1,38 +1,76 @@ + @@ -42,6 +80,7 @@ + @@ -52,6 +91,7 @@ + @@ -63,6 +103,7 @@ + @@ -75,6 +116,7 @@ + @@ -86,6 +128,7 @@ + @@ -95,6 +138,7 @@ + @@ -104,6 +148,7 @@ + @@ -113,6 +158,7 @@ + @@ -123,6 +169,8 @@ + + @@ -133,6 +181,8 @@ + + @@ -143,6 +193,8 @@ + + @@ -153,6 +205,8 @@ + + @@ -163,6 +217,7 @@ + @@ -172,6 +227,7 @@ + @@ -181,6 +237,7 @@ + @@ -191,6 +248,7 @@ + @@ -200,6 +258,7 @@ + @@ -210,6 +269,7 @@ + @@ -220,6 +280,7 @@ + @@ -229,6 +290,7 @@ + @@ -239,6 +301,7 @@ + @@ -249,6 +312,7 @@ + @@ -258,6 +322,7 @@ + @@ -267,6 +332,7 @@ + @@ -276,6 +342,7 @@ + @@ -285,6 +352,7 @@ + @@ -294,6 +362,7 @@ + @@ -303,6 +372,7 @@ + @@ -312,6 +382,7 @@ + @@ -322,6 +393,7 @@ + @@ -331,6 +403,7 @@ + @@ -341,6 +414,7 @@ + @@ -350,6 +424,7 @@ + @@ -360,6 +435,7 @@ + @@ -369,6 +445,7 @@ + @@ -379,6 +456,7 @@ + @@ -388,6 +466,7 @@ + @@ -398,6 +477,7 @@ + @@ -407,6 +487,7 @@ + @@ -417,6 +498,7 @@ + @@ -426,6 +508,7 @@ + @@ -436,6 +519,7 @@ + @@ -445,6 +529,7 @@ + @@ -454,6 +539,7 @@ + @@ -464,6 +550,7 @@ + @@ -473,6 +560,7 @@ + @@ -483,6 +571,7 @@ + @@ -493,6 +582,7 @@ + @@ -502,34 +592,18 @@ + - - - - - - - - - - - - - - - - - - + @@ -539,6 +613,7 @@ + @@ -548,6 +623,7 @@ + @@ -557,6 +633,7 @@ + @@ -566,6 +643,7 @@ + @@ -576,6 +654,7 @@ + @@ -585,6 +664,7 @@ + @@ -595,6 +675,7 @@ + @@ -605,6 +686,7 @@ + @@ -615,6 +697,7 @@ + @@ -624,6 +707,7 @@ + @@ -632,6 +716,7 @@ + @@ -640,6 +725,7 @@ + @@ -649,6 +735,7 @@ + @@ -658,6 +745,7 @@ + @@ -667,6 +755,7 @@ + @@ -676,6 +765,7 @@ + @@ -685,6 +775,7 @@ + @@ -694,6 +785,7 @@ + @@ -703,6 +795,7 @@ + @@ -712,6 +805,7 @@ + @@ -721,6 +815,7 @@ + @@ -731,6 +826,8 @@ + + @@ -740,6 +837,7 @@ + @@ -750,6 +848,7 @@ + @@ -759,6 +858,7 @@ + @@ -768,6 +868,7 @@ + @@ -778,6 +879,7 @@ + @@ -787,6 +889,7 @@ + @@ -796,6 +899,7 @@ + @@ -806,6 +910,7 @@ + @@ -816,6 +921,7 @@ + @@ -825,6 +931,7 @@ + @@ -835,6 +942,8 @@ + + @@ -844,6 +953,7 @@ + @@ -854,6 +964,8 @@ + + @@ -864,6 +976,8 @@ + + @@ -873,6 +987,7 @@ + @@ -882,6 +997,7 @@ + @@ -892,6 +1008,7 @@ + @@ -901,6 +1018,7 @@ + @@ -911,6 +1029,7 @@ + @@ -920,6 +1039,7 @@ + @@ -929,6 +1049,7 @@ + @@ -938,6 +1059,7 @@ + @@ -947,6 +1069,7 @@ + @@ -955,6 +1078,7 @@ + @@ -965,6 +1089,7 @@ + @@ -974,6 +1099,7 @@ + @@ -984,6 +1110,7 @@ + @@ -993,6 +1120,7 @@ + @@ -1002,6 +1130,7 @@ + @@ -1011,6 +1140,7 @@ + @@ -1021,6 +1151,7 @@ + @@ -1030,6 +1161,7 @@ + @@ -1040,6 +1172,7 @@ + @@ -1049,6 +1182,7 @@ + @@ -1059,6 +1193,7 @@ + @@ -1068,6 +1203,7 @@ + @@ -1078,6 +1214,7 @@ + @@ -1087,6 +1224,7 @@ + @@ -1097,6 +1235,7 @@ + @@ -1106,6 +1245,7 @@ + @@ -1116,6 +1256,7 @@ + @@ -1125,6 +1266,7 @@ + @@ -1135,6 +1277,7 @@ + @@ -1144,6 +1287,7 @@ + @@ -1154,6 +1298,7 @@ + @@ -1163,6 +1308,7 @@ + @@ -1173,6 +1319,7 @@ + @@ -1182,6 +1329,7 @@ + @@ -1192,6 +1340,7 @@ + @@ -1201,6 +1350,7 @@ + @@ -1210,6 +1360,7 @@ + @@ -1220,6 +1371,7 @@ + @@ -1229,6 +1381,7 @@ + @@ -1238,6 +1391,7 @@ + @@ -1247,6 +1401,7 @@ + @@ -1256,6 +1411,7 @@ + @@ -1266,6 +1422,7 @@ + @@ -1275,6 +1432,7 @@ + @@ -1285,6 +1443,7 @@ + @@ -1294,6 +1453,7 @@ + @@ -1304,6 +1464,7 @@ + @@ -1316,6 +1477,8 @@ + + @@ -1325,6 +1488,7 @@ + @@ -1334,6 +1498,7 @@ + @@ -1343,6 +1508,7 @@ + @@ -1353,6 +1519,7 @@ + @@ -1363,6 +1530,7 @@ + @@ -1374,6 +1542,7 @@ + @@ -1384,6 +1553,7 @@ + @@ -1393,6 +1563,7 @@ + @@ -1402,6 +1573,7 @@ + @@ -1412,6 +1584,8 @@ + + @@ -1421,6 +1595,7 @@ + @@ -1430,6 +1605,7 @@ + @@ -1439,6 +1615,7 @@ + @@ -1448,6 +1625,7 @@ + @@ -1457,6 +1635,7 @@ + @@ -1467,6 +1646,7 @@ + @@ -1476,6 +1656,7 @@ + @@ -1486,6 +1667,7 @@ + @@ -1496,6 +1678,7 @@ + @@ -1506,6 +1689,7 @@ + @@ -1516,6 +1700,7 @@ + @@ -1525,6 +1710,7 @@ + @@ -1535,6 +1721,7 @@ + @@ -1544,6 +1731,7 @@ + @@ -1553,6 +1741,7 @@ + @@ -1566,6 +1755,8 @@ + + @@ -1577,6 +1768,7 @@ + @@ -1586,6 +1778,7 @@ + @@ -1595,6 +1788,7 @@ + @@ -1605,6 +1799,7 @@ + @@ -1615,6 +1810,7 @@ + @@ -1625,6 +1821,7 @@ + @@ -1635,6 +1832,7 @@ + @@ -1644,6 +1842,7 @@ + @@ -1654,6 +1853,7 @@ + @@ -1663,6 +1863,7 @@ + @@ -1673,6 +1874,7 @@ + @@ -1682,6 +1884,7 @@ + @@ -1692,6 +1895,8 @@ + + @@ -1701,6 +1906,7 @@ + @@ -1712,6 +1918,7 @@ + @@ -1721,6 +1928,7 @@ + @@ -1731,6 +1939,7 @@ + @@ -1741,6 +1950,7 @@ + @@ -1750,6 +1960,7 @@ + @@ -1759,6 +1970,7 @@ + @@ -1768,6 +1980,8 @@ + + @@ -1776,6 +1990,7 @@ + @@ -1784,6 +1999,7 @@ + @@ -1793,6 +2009,7 @@ + @@ -1802,6 +2019,7 @@ + @@ -1812,6 +2030,7 @@ + @@ -1821,6 +2040,7 @@ + @@ -1831,6 +2051,7 @@ + @@ -1840,6 +2061,7 @@ + @@ -1849,6 +2071,7 @@ + @@ -1859,6 +2082,7 @@ + @@ -1868,6 +2092,7 @@ + @@ -1877,6 +2102,7 @@ + @@ -1888,6 +2114,8 @@ + + @@ -1900,6 +2128,7 @@ + @@ -1911,6 +2140,7 @@ + @@ -1922,6 +2152,7 @@ + @@ -1933,6 +2164,7 @@ + @@ -1943,6 +2175,7 @@ + @@ -1953,6 +2186,7 @@ + @@ -1963,6 +2197,7 @@ + @@ -1973,6 +2208,7 @@ + @@ -1982,6 +2218,7 @@ + @@ -1992,6 +2229,7 @@ + @@ -2001,6 +2239,7 @@ + @@ -2010,6 +2249,7 @@ + @@ -2019,6 +2259,7 @@ + @@ -2027,27 +2268,28 @@ - - - - - - + + + + + + - - - - - - + + + + + + + @@ -2057,6 +2299,7 @@ + @@ -2066,6 +2309,7 @@ + @@ -2076,6 +2320,7 @@ + @@ -2085,6 +2330,7 @@ + @@ -2094,6 +2340,7 @@ + @@ -2103,6 +2350,7 @@ + @@ -2112,6 +2360,7 @@ + @@ -2121,6 +2370,7 @@ + @@ -2132,6 +2382,7 @@ + @@ -2144,6 +2395,8 @@ + + @@ -2152,6 +2405,7 @@ + @@ -2161,6 +2415,7 @@ + @@ -2171,6 +2426,7 @@ + @@ -2181,6 +2437,7 @@ + @@ -2191,6 +2448,7 @@ + @@ -2202,6 +2460,7 @@ + @@ -2212,6 +2471,7 @@ + @@ -2222,6 +2482,7 @@ + @@ -2232,6 +2493,7 @@ + @@ -2244,6 +2506,7 @@ + @@ -2254,6 +2517,7 @@ + @@ -2264,6 +2528,7 @@ + @@ -2273,6 +2538,7 @@ + @@ -2282,6 +2548,7 @@ + @@ -2292,6 +2559,7 @@ + @@ -2301,6 +2569,7 @@ + @@ -2311,6 +2580,8 @@ + + @@ -2320,6 +2591,7 @@ + @@ -2330,6 +2602,7 @@ + @@ -2342,6 +2615,7 @@ + @@ -2354,6 +2628,8 @@ + + @@ -2364,6 +2640,7 @@ + @@ -2374,6 +2651,7 @@ + @@ -2383,6 +2661,7 @@ + @@ -2393,6 +2672,7 @@ + @@ -2402,6 +2682,7 @@ + @@ -2412,6 +2693,7 @@ + @@ -2423,6 +2705,7 @@ + @@ -2433,6 +2716,7 @@ + @@ -2442,6 +2726,7 @@ + @@ -2451,6 +2736,7 @@ + @@ -2460,6 +2746,7 @@ + @@ -2469,6 +2756,7 @@ + @@ -2480,6 +2768,7 @@ + @@ -2492,6 +2781,9 @@ + + + @@ -2501,6 +2793,7 @@ + @@ -2511,6 +2804,7 @@ + @@ -2521,6 +2815,7 @@ + @@ -2530,6 +2825,7 @@ + @@ -2539,6 +2835,7 @@ + @@ -2549,6 +2846,7 @@ + @@ -2559,6 +2857,7 @@ + @@ -2569,6 +2868,7 @@ + @@ -2579,6 +2879,7 @@ + @@ -2589,6 +2890,7 @@ + @@ -2600,6 +2902,7 @@ + @@ -2611,6 +2914,7 @@ + @@ -2621,6 +2925,7 @@ + @@ -2630,6 +2935,7 @@ + @@ -2641,6 +2947,7 @@ + @@ -2652,6 +2959,7 @@ + @@ -2662,6 +2970,7 @@ + @@ -2671,6 +2980,7 @@ + @@ -2680,6 +2990,7 @@ + @@ -2689,6 +3000,7 @@ + @@ -2700,6 +3012,7 @@ + @@ -2710,6 +3023,7 @@ + @@ -2720,6 +3034,7 @@ + @@ -2730,6 +3045,7 @@ + @@ -2739,6 +3055,7 @@ + @@ -2750,6 +3067,7 @@ + @@ -2760,6 +3078,7 @@ + @@ -2769,6 +3088,7 @@ + @@ -2779,6 +3099,7 @@ + @@ -2788,6 +3109,7 @@ + @@ -2798,6 +3120,7 @@ + @@ -2807,6 +3130,7 @@ + @@ -2818,6 +3142,7 @@ + @@ -2832,6 +3157,10 @@ + + + + @@ -2840,6 +3169,7 @@ + @@ -2857,6 +3187,9 @@ + + + @@ -2865,6 +3198,7 @@ + @@ -2875,6 +3209,7 @@ + @@ -2885,6 +3220,7 @@ + @@ -2895,6 +3231,8 @@ + + @@ -2904,6 +3242,7 @@ + @@ -2913,6 +3252,7 @@ + @@ -2924,6 +3264,7 @@ + @@ -2939,6 +3280,8 @@ + + @@ -2954,6 +3297,8 @@ + + @@ -2967,6 +3312,8 @@ + + @@ -2980,6 +3327,8 @@ + + @@ -2995,6 +3344,8 @@ + + @@ -3010,6 +3361,8 @@ + + @@ -3025,6 +3378,8 @@ + + @@ -3039,6 +3394,7 @@ + @@ -3054,6 +3410,8 @@ + + @@ -3069,6 +3427,8 @@ + + @@ -3079,6 +3439,7 @@ + @@ -3089,6 +3450,7 @@ + @@ -3098,6 +3460,7 @@ + @@ -3107,6 +3470,7 @@ + @@ -3117,6 +3481,7 @@ + @@ -3127,6 +3492,7 @@ + @@ -3138,6 +3504,7 @@ + @@ -3148,6 +3515,7 @@ + @@ -3156,6 +3524,7 @@ + @@ -3165,6 +3534,7 @@ + @@ -3174,6 +3544,7 @@ + @@ -3182,6 +3553,7 @@ + @@ -3190,6 +3562,7 @@ + @@ -3199,6 +3572,7 @@ + @@ -3209,6 +3583,7 @@ + @@ -3218,6 +3593,7 @@ + @@ -3227,6 +3603,7 @@ + @@ -3236,6 +3613,7 @@ + @@ -3245,6 +3623,7 @@ + @@ -3255,6 +3634,7 @@ + @@ -3265,6 +3645,7 @@ + @@ -3274,6 +3655,8 @@ + + @@ -3284,6 +3667,7 @@ + @@ -3293,6 +3677,8 @@ + + @@ -3302,6 +3688,8 @@ + + @@ -3312,18 +3700,19 @@ - - - - - - + + + + + + + @@ -3333,6 +3722,7 @@ + @@ -3343,6 +3733,7 @@ + @@ -3353,6 +3744,7 @@ + @@ -3366,6 +3758,7 @@ + @@ -3375,6 +3768,7 @@ + @@ -3384,6 +3778,7 @@ + @@ -3394,6 +3789,7 @@ + @@ -3402,6 +3798,7 @@ + @@ -3410,6 +3807,7 @@ + @@ -3418,6 +3816,7 @@ + @@ -3429,6 +3828,9 @@ + + + @@ -3441,6 +3843,9 @@ + + + @@ -3450,6 +3855,7 @@ + @@ -3460,6 +3866,8 @@ + + @@ -3469,6 +3877,7 @@ + @@ -3478,6 +3887,7 @@ + @@ -3489,6 +3899,8 @@ + + @@ -3499,6 +3911,7 @@ + @@ -3508,6 +3921,7 @@ + @@ -3517,6 +3931,7 @@ + @@ -3528,6 +3943,8 @@ + + @@ -3538,6 +3955,8 @@ + + @@ -3546,6 +3965,7 @@ + @@ -3555,6 +3975,7 @@ + @@ -3567,6 +3988,8 @@ + + @@ -3577,6 +4000,7 @@ + @@ -3586,6 +4010,8 @@ + + @@ -3596,6 +4022,8 @@ + + @@ -3606,6 +4034,8 @@ + + @@ -3615,6 +4045,7 @@ + @@ -3624,6 +4055,7 @@ + @@ -3634,6 +4066,7 @@ + @@ -3646,6 +4079,7 @@ + @@ -3655,6 +4089,7 @@ + @@ -3666,6 +4101,9 @@ + + + @@ -3674,6 +4112,7 @@ + @@ -3683,6 +4122,7 @@ + @@ -3692,6 +4132,7 @@ + @@ -3701,6 +4142,7 @@ + @@ -3710,6 +4152,7 @@ + @@ -3720,6 +4163,7 @@ + @@ -3728,29 +4172,28 @@ - - - - - - + + + + + + - - - - - - - - + + + + + + + @@ -3760,6 +4203,7 @@ + @@ -3772,6 +4216,8 @@ + + @@ -3781,6 +4227,7 @@ + @@ -3790,6 +4237,7 @@ + @@ -3799,6 +4247,7 @@ + @@ -3808,6 +4257,7 @@ + @@ -3817,15 +4267,17 @@ + - + + @@ -3836,15 +4288,18 @@ + + - + + @@ -3854,6 +4309,7 @@ + @@ -3864,6 +4320,8 @@ + + @@ -3874,6 +4332,8 @@ + + @@ -3883,6 +4343,7 @@ + @@ -3892,6 +4353,7 @@ + @@ -3901,6 +4363,7 @@ + @@ -3911,6 +4374,8 @@ + + @@ -3920,6 +4385,7 @@ + @@ -3930,6 +4396,8 @@ + + @@ -3940,6 +4408,7 @@ + @@ -3952,6 +4421,8 @@ + + @@ -3962,6 +4433,8 @@ + + @@ -3971,6 +4444,7 @@ + @@ -3980,6 +4454,7 @@ + @@ -3989,6 +4464,7 @@ + @@ -3998,6 +4474,7 @@ + @@ -4007,6 +4484,7 @@ + @@ -4016,6 +4494,7 @@ + @@ -4024,6 +4503,7 @@ + @@ -4032,6 +4512,7 @@ + @@ -4040,6 +4521,7 @@ + @@ -4050,6 +4532,9 @@ + + + @@ -4060,6 +4545,7 @@ + @@ -4069,6 +4555,7 @@ + @@ -4079,6 +4566,7 @@ + @@ -4088,6 +4576,7 @@ + @@ -4097,6 +4586,7 @@ + @@ -4108,6 +4598,7 @@ + @@ -4117,6 +4608,7 @@ + @@ -4126,6 +4618,7 @@ + @@ -4135,6 +4628,7 @@ + @@ -4145,6 +4639,8 @@ + + @@ -4154,6 +4650,7 @@ + @@ -4164,6 +4661,7 @@ + @@ -4173,6 +4671,7 @@ + @@ -4183,6 +4682,7 @@ + @@ -4196,6 +4696,7 @@ + @@ -4209,6 +4710,8 @@ + + @@ -4218,6 +4721,7 @@ + @@ -4227,6 +4731,7 @@ + @@ -4239,6 +4744,7 @@ + @@ -4250,19 +4756,15 @@ - - - - - - - - - - - - + + + + + + + + @@ -4270,6 +4772,7 @@ + @@ -4284,6 +4787,7 @@ + @@ -4298,6 +4802,7 @@ + @@ -4311,6 +4816,7 @@ + @@ -4322,6 +4828,7 @@ + @@ -4337,6 +4844,9 @@ + + + @@ -4347,6 +4857,7 @@ + @@ -4357,6 +4868,7 @@ + @@ -4366,6 +4878,7 @@ + @@ -4375,6 +4888,7 @@ + @@ -4384,6 +4898,7 @@ + @@ -4393,6 +4908,7 @@ + @@ -4402,6 +4918,7 @@ + @@ -4411,6 +4928,7 @@ + @@ -4423,6 +4941,8 @@ + + @@ -4434,6 +4954,9 @@ + + + @@ -4443,6 +4966,7 @@ + @@ -4452,6 +4976,7 @@ + @@ -4461,6 +4986,7 @@ + @@ -4470,6 +4996,7 @@ + @@ -4479,6 +5006,7 @@ + @@ -4489,6 +5017,7 @@ + @@ -4498,6 +5027,7 @@ + @@ -4507,6 +5037,7 @@ + @@ -4517,6 +5048,7 @@ + @@ -4526,6 +5058,7 @@ + @@ -4536,6 +5069,7 @@ + @@ -4548,6 +5082,8 @@ + + @@ -4559,6 +5095,8 @@ + + @@ -4570,6 +5108,8 @@ + + @@ -4582,6 +5122,7 @@ + @@ -4593,6 +5134,7 @@ + @@ -4602,6 +5144,8 @@ + + @@ -4613,6 +5157,7 @@ + @@ -4623,6 +5168,8 @@ + + @@ -4634,6 +5181,7 @@ + @@ -4644,6 +5192,7 @@ + @@ -4654,6 +5203,7 @@ + @@ -4663,6 +5213,8 @@ + + @@ -4672,6 +5224,8 @@ + + @@ -4682,6 +5236,7 @@ + @@ -4692,6 +5247,7 @@ + @@ -4702,6 +5258,7 @@ + @@ -4712,6 +5269,8 @@ + + @@ -4721,6 +5280,8 @@ + + @@ -4730,6 +5291,8 @@ + + @@ -4739,6 +5302,8 @@ + + @@ -4749,6 +5314,7 @@ + @@ -4758,6 +5324,8 @@ + + @@ -4769,6 +5337,7 @@ + @@ -4780,6 +5349,7 @@ + @@ -4791,6 +5361,7 @@ + @@ -4802,6 +5373,7 @@ + @@ -4813,6 +5385,7 @@ + diff --git a/cime_config/testdefs/testmods_dirs/clm/DA_multidrv/shell_commands b/cime_config/testdefs/testmods_dirs/clm/DA_multidrv/shell_commands index fe3925c56e..6465a87345 100644 --- a/cime_config/testdefs/testmods_dirs/clm/DA_multidrv/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/DA_multidrv/shell_commands @@ -2,8 +2,8 @@ ./xmlchange LND_DATA_ASSIMILATION=TRUE ./xmlchange MULTI_DRIVER=TRUE -#Set DGLC coupling to half a day so 12hour tests can work -./xmlchange GLC_NCPL=24 +#Set DGLC coupling from once to twice a day so 12hour tests can work +./xmlchange GLC_NCPL=2 # Set calendar, just because Gregorian is ussually used for DA ./xmlchange CALENDAR=GREGORIAN diff --git a/cime_config/testdefs/testmods_dirs/clm/pauseResume/shell_commands b/cime_config/testdefs/testmods_dirs/clm/pauseResume/shell_commands index cb7a4b0c4d..296f9306af 100644 --- a/cime_config/testdefs/testmods_dirs/clm/pauseResume/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/pauseResume/shell_commands @@ -2,5 +2,5 @@ ./xmlchange LND_PAUSE_ACTIVE=TRUE # Set calendar, just because Gregorian is ussually used for DA ./xmlchange CALENDAR=GREGORIAN -#Set DGLC coupling to half a day so 12hour tests can work -./xmlchange GLC_NCPL=24 +#Set DGLC coupling from once to four times a day so 12hour/6hour tests can work +./xmlchange GLC_NCPL=4 diff --git a/components/cdeps b/components/cdeps index 49aa7a7971..af8c89fc02 160000 --- a/components/cdeps +++ b/components/cdeps @@ -1 +1 @@ -Subproject commit 49aa7a79710ddbc9ae3fd225cddf21c29a76da7c +Subproject commit af8c89fc027898ed4876ecec0b0f260661265ca6 diff --git a/components/cmeps b/components/cmeps index a0343bcb7c..2d9b7d25ec 160000 --- a/components/cmeps +++ b/components/cmeps @@ -1 +1 @@ -Subproject commit a0343bcb7c6016960facd6d7bb124223013446bd +Subproject commit 2d9b7d25ec415a43548ca212ec87e9f601e48ff4 diff --git a/doc/.ChangeLog_template b/doc/.ChangeLog_template index 8fb94c7fc6..7dd14135c1 100644 --- a/doc/.ChangeLog_template +++ b/doc/.ChangeLog_template @@ -76,7 +76,9 @@ here is guidance on different available levels of system testing: c) python only (for use where the only changes are in the python directory: run the python testing listed below) d) regular (regular tests on normal machines if CTSM source is modified) - e) release (regular tests plus the fates, ctsm_sci, mosart, mizu and rtm test lists + e) extended (regular tests plus ctsm_sci or other development testlists) + f) fates (regular tests plus fates testlist) + g) release (ctsm_release testlist (includes any test in the testlist), mosart, mizu and rtm test lists and normally all of the ancillary tests (build-namelist, python, etc.) would be run as well) @@ -121,6 +123,10 @@ infrastructure should be run when appropriate, as described below. ctsm_sci derecho ---- + ctsm_release + derecho ---- + izumi ------ + If the tag used for baseline comparisons was NOT the previous tag, note that here: diff --git a/doc/ChangeLog b/doc/ChangeLog index a4a41de6de..6f3e60d07b 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,123 @@ =============================================================== +Tag name: ctsm5.4.054 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Mon Aug 31 05:35:20 AM MDT 2026 +One-line Summary: Update submodules to the latest needed for cesm3_0_alpha10a + +Purpose and description of changes +---------------------------------- + +Update submodules: ccs_config, cime, cdeps, cmeps, share +Current latest submodules that will be coming in cesm3_0_beta10 + +cesm3_0_beta09 had: cime6.4.1, share1.0.21, cdeps1.0.101, cmeps1.1.54 + +Also fix the two multi-instance tests that were failing, by making sure DGLC couples less times than ROF. + +And add new ctsm_release testlist which runs every test. And make sure the list of tests that should be subsets of aux_clm or ctsm_sci are so (as well as fates, and crop_cal). And bring in a script that checks the testlist for these features and will also fix them. And bring that script into a github workflow so the testlist is checked for basic requirements. + +Bugs fixed +---------- + +List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: + Fixes Some multi-instance tests fail with DGLC #4161 + Fixes Add a new ctsm_release testlist that runs all other testlists #4157 + Fixes Have matrixcn, aux_clm_mpi_serial, prealpha, prebeta, clm_pymods, clm_short, aux_cime_baselines, subset_data testlists be subsets of the aux_clm testlist #4158 + Fixes Make: hillslope, fire, interim-restart, ssp, crop_calendars testlists a subset of ctsm_sci #4156 + +Notes of particular relevance for users +--------------------------------------- + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): + Highlights of a few changes with the submodule updates + + CIME: + create_test has new options: --no-batch-build, --ninja, --gmake + + ccs_config: + New MOM grid for 2-degree tx2_0v1, used in ne16pg3_t201 alias + + CMEPS: + move CALENDAR to env_run.xml + Reduce mediator memory + Fix single column logic + + CDEPS: + Confirm that mesh size matches expected size + Fix some single column logic + +Contributors: @slevis-lmwg + +Notes of particular relevance for developers: +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + The script that checks the testlists is called add_super_testslists and is in cime_config/testdef. + That script is in a github workflow that runs when the testlist changes. + If the workflow fails, you should run the script by hand, and then copy in the modified output file to testlist_clm.xml. + Verify the changes by hand and then check it in and push to ESCOMP. The workflow should run again and is hopefully fine, otherwise repeat the steps. + + The script is largely based on Regular Expression magic, and doesn't understand XML syntax. It makes + some assumptions about how the testlist XML file is put together, and would break if the structure of + the file is changed significantly (or XML tagnames changed). CIME allows for a little more variance in the structure than is tested for here. + + Assumptions made. There's a single block that contains a single line for each test. Options shouldn't be in the block, but only afterwards. It's also assumed there shouldn't be duplicate tests in the machines block, and that the machines block shouldn't be empty. + + Since, the testlist format seems unlikely to change, and deeper knowledge of the XML structure doesn't seem needed, this seems likely to be OK. It could be rewritten using XML readers in CIME for the entry_id testlist, which would be able to be updated if the testlist format changes with CIME. + + But, all in all the assumptions seem reasonable for now. + +Changes to tests or testing: + Ran add_super_testlists script to make sure all testlists are properly subsets of other testlists notably aux_clm or ctsm_sci + And that any test added is also added to ctsm_release + The checker for this also has a git workflow and will run when the testlist is updated + +Testing summary: extended +---------------- + [PASS means all tests PASS; OK means tests PASS other than expected fails.] + + python testing (if python code has changed; see instructions in python/README.md; document testing done): + + derecho - PASS + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + derecho ----- OK + izumi ------- OK + + fates tests: (give name of baseline if different from CTSM tagname, normally fates baselines are fates--) + derecho ----- OK + izumi ------- OK + + any other testing (give details below): + + ctsm_sci + derecho ---- OK + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: b4b + +Other details +------------- + +List any git submodules updated (cime, rtm, mosart, cism, fates, etc.): + ccs_config to -> ccs_config_cesm1.0.88 + cime to -> cime6.5.5 + cmeps to -> cmeps1.1.64 + cdeps to -> cdeps1.0.105 + share to -> share1.1.21 + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + - #4182 + +=============================================================== +=============================================================== Tag name: ctsm5.4.053 Originator(s): oleson (Keith Oleson,UCAR/TSS,303-497-1332) Date: Wed Aug 19 03:19:08 PM MDT 2026 diff --git a/doc/ChangeSum b/doc/ChangeSum index c6cf28fc77..e9c62924ba 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.4.054 erik 08/31/2026 Update submodules to the latest needed for cesm3_0_alpha10a ctsm5.4.053 oleson 08/18/2026 Resolve problems with running PLUMBER2 sites ctsm5.4.052 slevis 08/17/2026 Merge b4b-dev to master ctsm5.4.051 erik 08/17/2026 Update compsets to use DGLC adjust Fates compsets/tests, remove clm4_5/VIC/BGCDV/NWP%BGC compsets/tests diff --git a/python/Makefile b/python/Makefile index 5919ce2983..8b3e350572 100644 --- a/python/Makefile +++ b/python/Makefile @@ -21,7 +21,8 @@ endif PYLINT=pylint PYLINT_ARGS=-j 4 --rcfile=ctsm/.pylintrc PYLINT_SRC = \ - ctsm + ctsm \ + ../cime_config/testdefs/add_super_testlists # NOTE: These don't pass pylint checking and should be added when we put into effort to get them to pass # ../cime_config/SystemTests \ # ../cime_config/buildlib \ @@ -51,7 +52,7 @@ lint: FORCE # Run the black check on all of the python files here and undeneath. # Use the black configure file to explicitly set a few things and specifiy the exact files. black: FORCE - black --check --config pyproject.toml . ../cime_config/SystemTests ../cime_config/buildlib ../cime_config/buildnml + black --check --config pyproject.toml . ../cime_config/SystemTests ../cime_config/buildlib ../cime_config/buildnml ../cime_config/testdefs/add_super_testlists .PHONY: run_black # Run black on all of the python files here and undeneath. diff --git a/python/ctsm/add_super_testlists.py b/python/ctsm/add_super_testlists.py new file mode 100644 index 0000000000..32281c184e --- /dev/null +++ b/python/ctsm/add_super_testlists.py @@ -0,0 +1,349 @@ +"""add_super_testlists.py + +Utilities to ensure tests in a testlist XML file (e.g. `testlist_clm.xml`) are +included in super-testlists (for example, `ctsm_release`). + +Reads the testlist file, inserts missing `` entries +into `` blocks, and writes a modified file (by default +`.modified`). + +This script reads in the testlist and determines if new lines for testlists that are +supersets of other testlists need to be added. + +For example all tests need to be part of the ctsm_release test list. + +NOTE: This script was created by Co-Pilot (GPT-5 mini) in VS-Code with Erik Kluzek + +Usage: + add_super_testlists.py [--testlist-file testlist_clm.xml] [--output FILE] [--verbose] +""" + +import argparse +import logging +import re +from pathlib import Path + +from ctsm.ctsm_logging import ( + setup_logging_pre_config, + add_logging_args, + process_logging_args, +) +from ctsm.utils import abort + +logger = logging.getLogger(__name__) + +MACHINES_PATTERN = re.compile(r"(.*?)", re.S) + +# testlists that should be treated as a subset of the ctsm_sci super-testlist, +# unless they're already part of aux_clm +CTSM_SCI_TESTLISTS = ["hillslope", "fire", "ssp", "crop_calendars", "interim_restart"] + +# testlists that should be treated as a subset of the aux_clm super-testlist +AUX_CLM_TESTLISTS = [ + "clm_pymods", + "prealpha", + "prebeta", + "aux_cime_baselines", + "clm_short", + "matrixcn", + "aux_clm_mpi_serial", + "subset_data", +] + +# testlists that should be treated as a subset of the crop_calendars super-testlist +CROP_CAL_TESTLISTS = ["rxcropmaturity"] + +# testlists that should be treated as a subset of the fates super-testlist +FATES_TESTLISTS = ["fates-landuse"] + + +def get_parser(): + """ + Get the parser object for add_super_testlists.py. + + Returns: + parser (ArgumentParser): + ArgumentParser which includes all the parser information. + """ + parser = argparse.ArgumentParser( + description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter + ) + + parser.add_argument( + "--check-only", + help="Only check if the testlist is correct, don't write a new file " + + "even if it needs modifications", + action="store_true", + dest="check_only", + ) + parser.add_argument( + "--testlist-file", + help="Testlist XML file to read in and check for missing super-testlist entries.", + action="store", + dest="testlist_file", + type=str, + default="testlist_clm.xml", + ) + parser.add_argument( + "--output", + help="Filename to write the modified testlist to" + + " (only writes it if there are changes required)." + " Defaults to '.modified'." + " Set to None if the --check-only option is used", + action="store", + dest="output_file", + type=str, + default=None, + ) + + add_logging_args(parser) + return parser + + +def process_and_check_args(args): + """Process and check the arguments""" + args.testlist_file = Path(args.testlist_file) + if not args.testlist_file.is_file(): + abort(f"testlist file not found: {args.testlist_file}") + + if args.output_file is None: + args.output_file = Path(str(args.testlist_file) + ".modified") + else: + args.output_file = Path(args.output_file) + + return args + + +def get_machine_compiler_category_from_machine_line(attrs): + """Get the machine, compiler and category from a machine line + Args: + attrs (str): Attribute string extracted from an existing `` tag + (e.g. ' name="derecho" compiler="intel" category="aux_clm"'). + + Returns: + a tuple of name, compiler, category as strings + """ + # attrs is string like ' name="derecho" compiler="intel" category="aux_clm"' + name = re.search(r'name\s*=\s*"([^"]+)"', attrs) + comp = re.search(r'compiler\s*=\s*"([^"]+)"', attrs) + cat = re.search(r'category\s*=\s*"([^"]+)"', attrs) + if not name or not comp or not cat: + logger.error( + "Could not find name, compiler and/or category attributes in machine line: %s", + attrs, + ) + abort("This machine block doesn't have a name, compiler or category attributes for it") + return (name.group(1), comp.group(1), cat.group(1)) + + +def make_new_machine_line_for_supertestlist(attrs, indent, super_testlist="ctsm_release"): + """Create a `` XML line using attributes for super_testlist from an existing machine. + + Args: + attrs (str): Attribute string extracted from an existing `` tag + (e.g. ' name="derecho" compiler="intel" category="aux_clm"'). + indent (str): The whitespace indentation to prefix the new line with. + super_testlist (str): The testlist (i.e. category) to use for the new machine line. + + Returns: + str or None: The formatted `` line (without a trailing + newline) or `None` if required attributes are missing. + """ + (name, comp, _cat) = get_machine_compiler_category_from_machine_line(attrs) + attrs_str = f'name="{name}" compiler="{comp}" category="{super_testlist}"' + return f"{indent}" + + +def process_machines_block( + block, testlist=None, not_in_testlist=None, super_testlist="ctsm_release" +): + """Ensure a machines block contains an entry for the given super testlist. + + The function inspects the inner contents of a `...` + block and, if an entry for `super_testlist` is missing, creates and + inserts a new `` line using the machine entry's attributes + and indentation. The closing indentation before `` is preserved. + + When testlist is entered, check that the block has the testlist, before adding + the super_testlist machine for it to the block + When testlist is None, ignore it and add the super_testlist machine line for it + to every block and machine/compiler combination. + + Args: + block (str): The inner content between `` and ``. + testlist: The testlist to check for existance of, before adding super_testlist to the block + not_in_testlist: testlist to verify it's NOT in before adding super_testlist to the block + super_testlist (str): The testlist (i.e. category) to ensure is present. + + Returns: + str: The modified block with the added `` entries when needed. + """ + # block is the inner content between and + # find the matches for each machine line in the block + machine_lines = re.findall(r"(\n\s*)(]+)/>)", block) + if not machine_lines: + # cannot find machine, die with an error as this is a problem + logger.error( + "No line found in block, so cannot add a %s entry to it", super_testlist + ) + logger.error(block) + abort("block doesn't have a machine line for it, so aborting") + + # Ensure no duplicates + if len(machine_lines) != len(set(machine_lines)): + logger.error("There are duplicated tests in a machines block") + logger.error(block) + abort("block has duplicated tests, so aborting") + # + # Iterate over the machine lines to figure out, for each machine/compiler + # combination, the full set of categories (testlists) it's already in. + # Also remember one representative (indent, attrs) line per machine/compiler + # to use as a template if we need to add a new entry for it. + # + mach_comp_cat = {} + representative_line = {} + for this_machine_line in machine_lines: + indent = str(this_machine_line[0]) + attrs = str(this_machine_line[1]) + (name, comp, cat) = get_machine_compiler_category_from_machine_line(attrs) + mach_comp_cat.setdefault(name, {}).setdefault(comp, set()).add(cat) + representative_line.setdefault((name, comp), (indent, attrs)) + # + # Iterate over each unique machine/compiler combination to process the block + # + for (name, comp), (indent, attrs) in representative_line.items(): + categories = mach_comp_cat[name][comp] + + # If the super_testlist is already in the block for this machine/compiler, skip it + if super_testlist in categories: + continue + + # Check if the input testlist is in the block for this machine/compiler and if not skip it + if testlist is not None and testlist not in categories: + continue + + if not_in_testlist is not None and not_in_testlist in categories: + continue + + # strip the leading newline so indent contains only spaces + if indent.startswith("\n"): + indent = indent[1:] + new_line = make_new_machine_line_for_supertestlist( + attrs, indent, super_testlist=super_testlist + ) + if not new_line: + return block + + # Log about this block needing to be modified + logger.warning( + "Found a block that needs to be modified and %s added to it for %s_%s", + super_testlist, + name, + comp, + ) + logger.warning(block) + + # Preserve the existing XML formatting: add the new machine entry as a + # separate line with the same indentation as the surrounding entries, + # and preserve the original indentation that preceded the closing + # tag so the closing tag lines up as before. + closing_indent_m = re.search(r"(\n[ \t]*)\Z", block) + closing_indent = closing_indent_m.group(1) if closing_indent_m else "\n" + block = block.rstrip() + block = f"{block}\n{new_line}{closing_indent}" + + return block + + +def add_super_testlist(text, super_testlist, testlists=(None,), not_in_testlist=None): + """Add missing super_testlist machine entries to every `` block in text. + + Runs process_machines_block over every `` block in text once per entry in + testlists, accumulating the changes from each pass. + + Args: + text (str): Full contents of the testlist XML file. + super_testlist (str): The testlist (i.e. category) to ensure is present. + testlists: Iterable of testlists to check for existence of (one at a time) before + adding super_testlist to a given block. A single `(None,)` (the default) adds + super_testlist to every block. + not_in_testlist: Another testlist to verify a block is not in before adding + super_testlist to it. + + Returns: + str: The full, updated contents of the testlist XML file. + """ + for testlist in testlists: + text = MACHINES_PATTERN.sub( + lambda mo, testlist=testlist: "" + + process_machines_block( + mo.group(1), + testlist=testlist, + not_in_testlist=not_in_testlist, + super_testlist=super_testlist, + ) + + "", + text, + ) + return text + + +def main(): + """Main function: read a testlist file and add missing super-testlist machine entries""" + setup_logging_pre_config() + parser = get_parser() + args = parser.parse_args() + + process_logging_args(args) + + args = process_and_check_args(args) + + orig_text = args.testlist_file.read_text() + text = orig_text + + # ctsm_release should be in every block + text = add_super_testlist(text, "ctsm_release") + + # ctsm_sci: don't add it to a block already in the aux_clm testlist + text = add_super_testlist( + text, "ctsm_sci", testlists=CTSM_SCI_TESTLISTS, not_in_testlist="aux_clm" + ) + + text = add_super_testlist(text, "aux_clm", testlists=AUX_CLM_TESTLISTS) + text = add_super_testlist(text, "crop_calendars", testlists=CROP_CAL_TESTLISTS) + text = add_super_testlist(text, "fates", testlists=FATES_TESTLISTS) + + if text == orig_text: + logger.info("No changes needed, so output file NOT written to") + logger.info("Successfully validated that the testlist.xml file is correct") + return + # + # If changes are needed report on how it failed + # + + # Output modified file if the --check-only option wasn't used + if not args.check_only: + args.output_file.write_text(text) + logger.warning("WROTE %s", args.output_file) + logger.warning("Use %s to correct the testlist_clm.xml file", args.output_file) + # Otherwise: Document the steps to do to fix the problem + else: + logger.warning("Modified file was NOT written, because the --check-only option was used") + logger.warning("If this failed from a github workflow run -- do the following steps") + logger.warning( + "1.) Run %s To both see the fails and also create a modified file with the fixes", + __file__, + ) + logger.warning( + "2.) Copy the modified file to testlist_clm.xml and verify the changes are correct" + ) + logger.warning("3.) git commit and git push the changes") + logger.warning("4.) Verify the workflow runs correctly now -- or repeat the process") + + # Exit with an error + logger.warning("The testlist file had problems and needs some updates") + abort("The testlist didn't validate") + + +if __name__ == "__main__": + main() diff --git a/python/ctsm/test/test_unit_add_super_testlists.py b/python/ctsm/test/test_unit_add_super_testlists.py new file mode 100644 index 0000000000..f7c7ba2d6c --- /dev/null +++ b/python/ctsm/test/test_unit_add_super_testlists.py @@ -0,0 +1,206 @@ +#!/usr/bin/env python3 + +"""Unit tests for add_super_testlists""" + +import argparse +import os +import shutil +import tempfile +import unittest +from pathlib import Path + +from ctsm import unit_testing +from ctsm.add_super_testlists import ( + get_parser, + process_and_check_args, + make_new_machine_line_for_supertestlist, + process_machines_block, + add_super_testlist, +) + +# Allow names that pylint doesn't like, because otherwise I find it hard +# to make readable unit test names +# pylint: disable=invalid-name + + +class TestGetParser(unittest.TestCase): + """Tests of add_super_testlists: get_parser""" + + def test_get_parser_defaults(self): + """Tests that get_parser gives the expected defaults when no args are given""" + parser = get_parser() + args = parser.parse_args([]) + self.assertEqual(args.testlist_file, "testlist_clm.xml") + self.assertIsNone(args.output_file) + self.assertFalse(args.check_only) + + def test_get_parser_custom_args(self): + """Tests that get_parser correctly parses explicitly-given arguments""" + parser = get_parser() + args = parser.parse_args( + ["--testlist-file", "mylist.xml", "--output", "out.xml", "--check-only"] + ) + self.assertEqual(args.testlist_file, "mylist.xml") + self.assertEqual(args.output_file, "out.xml") + self.assertTrue(args.check_only) + + +class TestProcessAndCheckArgs(unittest.TestCase): + """Tests of add_super_testlists: process_and_check_args""" + + def setUp(self): + self._testdir = tempfile.mkdtemp() + + def tearDown(self): + shutil.rmtree(self._testdir, ignore_errors=True) + + def test_process_and_check_args_missing_file(self): + """Tests that process_and_check_args aborts if testlist_file doesn't exist""" + args = argparse.Namespace( + testlist_file=os.path.join(self._testdir, "does_not_exist.xml"), + output_file=None, + ) + with self.assertRaisesRegex(SystemExit, "testlist file not found"): + process_and_check_args(args) + + def test_process_and_check_args_default_output(self): + """Tests that output_file defaults to '.modified'""" + testlist_path = os.path.join(self._testdir, "testlist_clm.xml") + # pylint: disable=consider-using-with,unspecified-encoding + open(testlist_path, "x").close() + + args = argparse.Namespace(testlist_file=testlist_path, output_file=None) + args = process_and_check_args(args) + + self.assertEqual(args.testlist_file, Path(testlist_path)) + self.assertEqual(args.output_file, Path(testlist_path + ".modified")) + + def test_process_and_check_args_custom_output(self): + """Tests that an explicitly-given output_file is respected""" + testlist_path = os.path.join(self._testdir, "testlist_clm.xml") + # pylint: disable=consider-using-with,unspecified-encoding + open(testlist_path, "x").close() + output_path = os.path.join(self._testdir, "custom_output.xml") + + args = argparse.Namespace(testlist_file=testlist_path, output_file=output_path) + args = process_and_check_args(args) + + self.assertEqual(args.output_file, Path(output_path)) + + +class TestMakeNewMachineLineForSupertestlist(unittest.TestCase): + """Tests of add_super_testlists: make_new_machine_line_for_supertestlist""" + + def test_make_new_machine_line_basic(self): + """Tests that a new machine line is built correctly, defaulting to ctsm_release""" + attrs = ' name="derecho" compiler="intel" category="aux_clm"' + indent = " " + result = make_new_machine_line_for_supertestlist(attrs, indent) + expected = ' ' + self.assertEqual(result, expected) + + def test_make_new_machine_line_custom_super_testlist(self): + """Tests that a new machine line uses the given super_testlist as its category""" + attrs = ' name="izumi" compiler="gnu" category="aux_clm"' + indent = " " + result = make_new_machine_line_for_supertestlist(attrs, indent, super_testlist="ctsm_sci") + self.assertIn('category="ctsm_sci"', result) + self.assertIn('name="izumi"', result) + self.assertIn('compiler="gnu"', result) + + def test_make_new_machine_line_missing_name(self): + """Tests that missing a name attribute aborts""" + attrs = ' compiler="intel" category="aux_clm"' + with self.assertRaisesRegex(SystemExit, "doesn't have a name, compiler or category"): + make_new_machine_line_for_supertestlist(attrs, " ") + + def test_make_new_machine_line_missing_compiler(self): + """Tests that missing a compiler attribute aborts""" + attrs = ' name="derecho" category="aux_clm"' + with self.assertRaisesRegex(SystemExit, "doesn't have a name, compiler or category"): + make_new_machine_line_for_supertestlist(attrs, " ") + + +class TestProcessMachinesBlock(unittest.TestCase): + """Tests of add_super_testlists: process_machines_block""" + + def test_process_machines_block_already_present(self): + """Tests that a block already containing super_testlist is returned unchanged""" + block = ( + '\n ' + '\n \n ' + ) + result = process_machines_block(block, super_testlist="ctsm_release") + self.assertEqual(result, block) + + def test_process_machines_block_no_machine_found(self): + """Tests that a block with no line aborts""" + block = "\n \n " + with self.assertRaisesRegex(SystemExit, "block doesn't have a machine line"): + process_machines_block(block, super_testlist="ctsm_release") + + def test_process_machines_block_duplicate_machines(self): + """Tests that duplicated machine lines in a block abort""" + line = '\n ' + block = line + line + "\n " + with self.assertRaisesRegex(SystemExit, "block has duplicated tests"): + process_machines_block(block, super_testlist="ctsm_release") + + def test_process_machines_block_testlist_not_present(self): + """Tests that the block is left unchanged if the given testlist isn't in it""" + block = '\n \n ' + result = process_machines_block(block, testlist="hillslope", super_testlist="ctsm_sci") + self.assertEqual(result, block) + + def test_process_machines_block_not_in_testlist_present(self): + """Tests that the block is left unchanged if not_in_testlist is present""" + block = '\n \n ' + result = process_machines_block(block, not_in_testlist="aux_clm", super_testlist="ctsm_sci") + self.assertEqual(result, block) + + def test_process_machines_block_adds_missing_entry(self): + """Tests that a block missing super_testlist gets a new line added""" + + block = '\n \n ' + result = process_machines_block(block, super_testlist="ctsm_release") + print(result) + self.assertIn('category="ctsm_release"', result) + self.assertIn('category="aux_clm"', result) + + +class TestAddSuperTestlist(unittest.TestCase): + """Tests of add_super_testlists: add_super_testlist""" + + def test_add_super_testlist_no_change_needed(self): + """Tests that text is returned unchanged when every block already has super_testlist""" + xml = ( + "\n" + ' \n' + " \n" + ' \n' + " \n" + " \n" + "\n" + ) + result = add_super_testlist(xml, "ctsm_release") + self.assertEqual(result, xml) + + def test_add_super_testlist_adds_entry(self): + """Tests that a missing super_testlist entry gets added to a block""" + + xml = ( + "\n" + ' \n' + " \n" + ' \n' + " \n" + " \n" + "\n" + ) + result = add_super_testlist(xml, "ctsm_release") + self.assertIn('category="ctsm_release"', result) + + +if __name__ == "__main__": + unit_testing.setup_for_tests() + unittest.main() diff --git a/share b/share index f210ab4b32..5aa721c839 160000 --- a/share +++ b/share @@ -1 +1 @@ -Subproject commit f210ab4b326ce9da5f8b062953eef0bb023ec188 +Subproject commit 5aa721c839b6c39d182ab006fa6b9db5fe5cd15c