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
Get branch
Bring down any existing containers
make start-lumigator-build
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...
[X] added some tests for any new functionality
[ ] updated the documentation
[ ] checked if a (backend) DB migration step was required and included it if required
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/403Also adds changes from the linter in the new precommit hook.
How to test it
make start-lumigator-build
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...