mozilla-ai / lumigator

Source code for Mozilla.ai's Lumigator platform
https://mozilla-ai.github.io/lumigator/
Apache License 2.0
63 stars 7 forks source link

Partial fix for local hanging integration tests #411

Open veekaybee opened 1 day ago

veekaybee commented 1 day ago

What's changing

We currently don't instantiate a real Lumigator client when running integration tests for the SDK; i.e. we use a real client but then inject it with mocks which results in a mixed state for testing. This test introduces a real client that is yielded per-session for the SDK and simplifies the healthcheck test, which now doesn't need to wait for the client to start, as it's injected on a per-session basis.

This should address at least the FAILED tests/int_test_datasets.py::test_sdk_healthcheck_ok - assert False piece for local testing mentioned in this PR. https://github.com/mozilla-ai/lumigator/issues/403

Also adds changes from the linter in the new precommit hook.

How to test it

  1. Get branch
  2. Bring down any existing containers
  3. make start-lumigator-build
  4. cd lumigator/python/mzai/sdk; uv run pytest -o python_files="test_*.py int_test_*.py"

Additional notes for reviewers

A follow-up PR to this will be to add the instructions in "how to test it" to a separate integration test which should be located in tests/integration and run separately both manually via make and in CI.

I already...