Skip to content

Add extensive test suite for GPUMA#23

Merged
niklashoelter merged 1 commit intomasterfrom
extensive-test-suite-6643312877358509178
Feb 9, 2026
Merged

Add extensive test suite for GPUMA#23
niklashoelter merged 1 commit intomasterfrom
extensive-test-suite-6643312877358509178

Conversation

@niklashoelter
Copy link
Owner

This PR introduces a comprehensive test suite for the GPUMA repository. It addresses the lack of testing by enabling tests to run in environments without heavy dependencies installed (via robust, conditional mocking in conftest.py). The suite covers the full API, CLI, configuration, IO handling, and optimizer logic. Special care was taken to mock Fairchem and Torch-Sim models securely, handling HF_TOKEN requirements as requested.


PR created automatically by Jules for task 6643312877358509178 started by @niklashoelter

- Refactored `tests/conftest.py` to conditionally mock heavy dependencies (`torch`, `ase`, `fairchem`, `rdkit`, `morfeus`, `torch_sim`) using `sys.modules` injection. This allows tests to run in lightweight environments while supporting real dependencies if available.
- Updated `mock_atoms_factory` to dynamically return atomic coordinates and symbols matching the requested size, resolving issues with `zip` length mismatch in IO tests.
- Improved `MockConformerEnsemble` to correctly handle `from_rdkit` and return appropriate conformers (e.g., handling SMILES like "CCCC" to match test expectations).
- Expanded test coverage:
    - Added `tests/test_decorators.py`.
    - Added tests for `HF_TOKEN` configuration handling in `tests/test_models.py`.
    - Added tests for optimizer convergence warnings in `tests/test_optimizer.py`.
- Verified and fixed existing tests in `tests/test_api.py`, `tests/test_cli.py`, `tests/test_config.py`, `tests/test_io.py`, `tests/test_models.py`, `tests/test_optimizer.py`.
- Addressed all code review feedback, including cleaner environment variable handling with `monkeypatch` and better mocking strategies.

Co-authored-by: niklashoelter <83964137+niklashoelter@users.noreply.github.com>
@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@niklashoelter niklashoelter merged commit 0c457b2 into master Feb 9, 2026
1 check passed
@niklashoelter niklashoelter deleted the extensive-test-suite-6643312877358509178 branch February 9, 2026 18:14
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.

1 participant