Skip to content

tests: re-enable caching tests and more cleanups in tests/dsl#175

Merged
romanc merged 7 commits into
NOAA-GFDL:developfrom
romanc:romanc/tests-cleanup
Jul 7, 2025
Merged

tests: re-enable caching tests and more cleanups in tests/dsl#175
romanc merged 7 commits into
NOAA-GFDL:developfrom
romanc:romanc/tests-cleanup

Conversation

@romanc
Copy link
Copy Markdown
Collaborator

@romanc romanc commented Jun 27, 2025

Description

This PR looks at tests under tests/dsl and does some cleanup work. In particular

  • Re-enable tests in tests_caches.py: They were skipped because MPI is always defined (since it's a non-optional import)
  • Fix tests in tests_caches.py: Tests haven't been running since we moved away from python 3.8 (because the python version was hard-coded in there ...)
  • Move make_storage into a utility module (used from two test modules)
  • Run tests in tests/dsl/test_stencil_factory.py with more than one backend
  • Adding type hints and "inlining" single parameter sets.

Just to disambiguate: Some tests (the ones inside tests/mpi) rely on MPI being changed to None in case of a serial run:

from mpi4py import MPI
if MPI.COMM_WORLD.Get_size() == 1:
# not run as a parallel test, disable MPI tests
MPI = None

Tests outside test/mpi import MPI from mpi4py directly and thus check the world size themselves. Might be worth cleaning this up anyway ... or - you know - use pytest.marker instead. Feel free to leave this open if you want to discuss this.

How Has This Been Tested?

Running tests locally.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas: N/A
  • I have made corresponding changes to the documentation: N/A
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules: N/A
  • New check tests, if applicable, are included: N/A

Copy link
Copy Markdown
Collaborator

@FlorianDeconinck FlorianDeconinck left a comment

Choose a reason for hiding this comment

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

LGTM

@FlorianDeconinck
Copy link
Copy Markdown
Collaborator

Issue logged for cleanup of serial test in mpi #178

@romanc romanc merged commit ae8be58 into NOAA-GFDL:develop Jul 7, 2025
5 checks passed
@romanc romanc deleted the romanc/tests-cleanup branch July 7, 2025 07:29
@romanc romanc mentioned this pull request Sep 22, 2025
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants