Skip to content

fix(tests): Correct core tests and consolidate test structure#18

Merged
abrichr merged 3 commits intomainfrom
fix/README
Mar 30, 2025
Merged

fix(tests): Correct core tests and consolidate test structure#18
abrichr merged 3 commits intomainfrom
fix/README

Conversation

@abrichr
Copy link
Member

@abrichr abrichr commented Mar 30, 2025

  • Fixes execution failures in tests/test_omnimcp_core.py by:

    • Correcting logic in VisualState.find_element to handle zero-score matches appropriately.
    • Casting NumPy boolean result to standard Python bool in OmniMCP._verify_action.
  • Consolidates test file structure and helper functions:

    • Moves helper functions (generate_test_ui, generate_action_test_pair) into omnimcp/testing_utils.py.
    • Updates imports in tests/test_omnimcp.py and tests/test_omnimcp_core.py to use omnimcp.testing_utils.
    • Removes the omnimcp/tests/ directory and the redundant tests/synthetic_ui_helpers.py file.
  • Moves CI testing strategy document to docs/testing_strategy.md.

Non-e2e tests (test_core.py, test_mapper.py, test_omnimcp_core.py) now pass. E2E tests remain skipped/commented out (tracked in separate TODOs).

abrichr added 3 commits March 30, 2025 19:25
- Fixes execution failures in `tests/test_omnimcp_core.py` by:
    - Correcting logic in `VisualState.find_element` to handle zero-score matches appropriately.
    - Casting NumPy boolean result to standard Python bool in `OmniMCP._verify_action`.

- Consolidates test file structure and helper functions:
    - Moves helper functions (`generate_test_ui`, `generate_action_test_pair`) into `omnimcp/testing_utils.py`.
    - Updates imports in `tests/test_omnimcp.py` and `tests/test_omnimcp_core.py` to use `omnimcp.testing_utils`.
    - Removes the `omnimcp/tests/` directory and the redundant `tests/synthetic_ui_helpers.py` file.

- Moves CI testing strategy document to `docs/testing_strategy.md`.

Non-e2e tests (`test_core.py`, `test_mapper.py`, `test_omnimcp_core.py`) now pass.
E2E tests remain skipped/commented out (tracked in separate TODOs).
- Fixes `ImportError: this platform is not supported` failure in `tests/test_omnimcp_core.py::test_action_verification` when run in headless environments (like CI).
- Mocks `MouseController` and `KeyboardController` using `@patch` during `OmniMCP` instantiation within this specific test.
- This prevents `pynput` initialization errors, as the test only verifies image diff logic and doesn't require real input control.
- All non-skipped tests collected by `pytest tests/` now pass.
@abrichr abrichr merged commit b75c022 into main Mar 30, 2025
1 check passed
@abrichr abrichr deleted the fix/README branch March 30, 2025 23:41
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