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

Error message could be in simpler English for incorrect syntax in test names #4449

Open
slevis-lmwg opened this issue Jun 27, 2023 · 2 comments

Comments

@slevis-lmwg
Copy link

slevis-lmwg commented Jun 27, 2023

./create_test SMS_L10d_D_Mmpi-serial.CLM_USRDAT.I1PtClm51Bgc.izumi_nag.clm-default--clm-NEON-NIWO
gave me this error:

Finished XML for test SMS_L10d_D_Mmpi-serial.CLM_USRDAT.I1PtClm51Bgc.izumi_nag.clm-default--clm-NEON-NIWO in 0.232909 seconds (FAIL). [COMPLETED 1 of 1]
    Case dir: /scratch/cluster/slevis/SMS_L10d_D_Mmpi-serial.CLM_USRDAT.I1PtClm51Bgc.izumi_nag.clm-default--clm-NEON-NIWO.20230627_133512_wvaqn7
    Errors were:
        Test 'SMS_L10d_D_Mmpi-serial.CLM_USRDAT.I1PtClm51Bgc.izumi_nag.clm-default--clm-NEON-NIWO' failed in phase 'XML' with exception ''NoneType' object has no attribute 'group''
          File "/fs/cgd/data0/slevis/git/add_xs_ground_ice_pr1787/cime/CIME/test_scheduler.py", line 1093, in _run_catch_exceptions
            return run(test)
          File "/fs/cgd/data0/slevis/git/add_xs_ground_ice_pr1787/cime/CIME/test_scheduler.py", line 885, in _xml_phase
            opt = match.group(1)

For the test to work, @ekluzek and I discovered that we needed to replace L10d with Ld10 in the test name.

Relates to ESCOMP/CTSM#2043

@ekluzek
Copy link
Contributor

ekluzek commented Jun 27, 2023

The part of the code is here:

                elif opt.startswith("L"):
                    match = re.match("L([A-Za-z])([0-9]*)", opt)
                    stop_option = {
                        "y": "nyears",
                        "m": "nmonths",
                        "d": "ndays",
                        "h": "nhours",
                        "s": "nseconds",
                        "n": "nsteps",
                    }
                    opt = match.group(1)

What should happen is that match should be queried to ensure it's a valid match. If it isn't it should return a sensible error to explain what went wrong. This same sort of thing should be added to other such matches for test types. This would allow the user to debug the problem on their own, rather than having to struggle to figure it out.

An interesting thing here is that the above actually worked for me even though it probably shouldn't have. So a better error check would be better for everyone.

@ekluzek ekluzek changed the title Error message could be in simpler English for incorrect syntax in CTSM test name Error message could be in simpler English for incorrect syntax in test names Aug 3, 2023
Copy link
Contributor

github-actions bot commented Nov 2, 2023

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants