Refactor some test fixtures for better reuse so we can test loading Scheduler config examples#981
Conversation
…cheduler config examples.
There was a problem hiding this comment.
Pull Request Overview
Refactors test fixtures to improve reuse and introduces tests for loading Scheduler configuration examples.
- Centralizes the temporary file–based SQLite storage fixture (
sqlite_storage) for reuse. - Consolidates optimizer fixtures into a single module and re-exports them in
conftest.py. - Adds end-to-end tests to verify loading of Scheduler config examples with the new fixtures.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| mlos_bench/mlos_bench/tests/storage/test_storage_pickling.py | Updated to use the new sqlite_storage fixture; removed inline tempfile logic. |
| mlos_bench/mlos_bench/tests/storage/sql/fixtures.py | Added sqlite_storage fixture for file-based SQLite storage. |
| mlos_bench/mlos_bench/tests/storage/conftest.py | Exposed sqlite_storage fixture for pytest. |
| mlos_bench/mlos_bench/tests/optimizers/fixtures.py | New module centralizing all optimizer fixtures. |
| mlos_bench/mlos_bench/tests/optimizers/conftest.py | Re-exported optimizer fixtures from the new module. |
| mlos_bench/mlos_bench/tests/config/schedulers/test_load_scheduler_config_examples.py | Introduced tests for loading Scheduler config examples. |
| mlos_bench/mlos_bench/tests/config/schedulers/conftest.py | Added fixtures for mock environment config path and trial runners. |
| mlos_bench/mlos_bench/tests/config/schedulers/init.py | Added package docstring for scheduler config tests. |
Comments suppressed due to low confidence (1)
mlos_bench/mlos_bench/tests/storage/test_storage_pickling.py:22
- pytest is not imported in this file, causing a NameError for @pytest.mark.skipif. Add
import pytestat the top.
@pytest.mark.skipif(
|
That's an interesting error. It looks like in one of the unit tests ( @bpkroth can you please take a look? Thank you! |
|
Yeah, since this is just for test loading the configs, I switched it to using an in memory storage. |
Pull Request
Title
Refactor some test fixtures for better reuse so we can test loading Scheduler config examples
Description
Type of Change
Testing
Additional Notes (optional)