Skip to content

test(python): Make run_ctsm_py_tests.py glob for CTSM test files relative to its own location rather than caller's arbitrary cwd - #4253

Merged
ekluzek merged 1 commit into
ESCOMP:b4b-devfrom
johnpaulalex:run-ctsm-py-tests-cwd-fix
Oct 12, 2026
Merged

ekluzek merged 1 commit into
ESCOMP:b4b-devfrom
johnpaulalex:run-ctsm-py-tests-cwd-fix

Conversation

@johnpaulalex

Copy link
Copy Markdown
Contributor

Description of changes

Make run_ctsm_py_tests.py glob for CTSM test files relative to its own location rather than caller's arbitrary cwd.

This feels similar to other current-dir-dependent code fixed in Issue #2167: run_ctsm_py_tests failures at os.getcwd().

Description of generative AI usage:
Google Antigravity was used to write the code and tests, followed by human-guided verification.

Specific notes

Contributors other than yourself, if any:

  • None

CTSM issues resolved or otherwise addressed, if any:

  • None

Any user interface changes (namelist or namelist defaults changes)?
None.

Testing planned or performed, if any:

  • Tested running ./python/run_ctsm_py_tests -u from CTSM root dir, python/ dir, and src/ dir and verified it consistently collects all 35 tests.

Requirements before merge:

  • I have followed the CTSM contribution guidelines.
  • The code in this PR branch builds with no errors.
  • The code in this PR branch runs with no errors. Briefly describe tested configuration(s): Python unit tests collection via pytest locally.
  • This either (a) does not change answers, (b) it only changes answers at roundoff level, or (c) I have performed a scientific evaluation of the answer changes. Which?: (a)
  • I have reviewed relevant parts of the CLM documentation Tech Note or User's Guide to determine if anything needs to be changed or added. If it does, describe: None needed.
  • This PR either (a) does not create a need to update the documentation or (b) includes required documentation updates (see guidelines for contributing documentation). Which?: (a)

…n location rather than caller's arbitrary cwd
@johnpaulalex
johnpaulalex force-pushed the run-ctsm-py-tests-cwd-fix branch from 12e85fc to c6fa52f Compare October 9, 2026 18:26
@johnpaulalex
johnpaulalex changed the base branch from master to b4b-dev October 9, 2026 18:26
@ekluzek ekluzek self-assigned this Oct 12, 2026

@ekluzek ekluzek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always a good capability for scripts to be able to be launched anywhere.

@ekluzek ekluzek added enhancement new capability or improved behavior of existing capability testing additions or changes to tests b4b bit-for-bit usability Improve or clarify user-facing options size: small labels Oct 12, 2026
@ekluzek

ekluzek commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

@johnpaulalex ran testing, and this change is small and safe. So I'm merging to b4b-dev.

@ekluzek
ekluzek merged commit 20e9b42 into ESCOMP:b4b-dev Oct 12, 2026
6 checks passed
@samsrabin samsrabin mentioned this pull request Oct 16, 2026
9 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

b4b bit-for-bit enhancement new capability or improved behavior of existing capability size: small testing additions or changes to tests usability Improve or clarify user-facing options

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants