-
Notifications
You must be signed in to change notification settings - Fork 73
Refactor storage tests to support testing multiple backends on schema changes #983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Refactors the storage test suite to enable running MySQL and PostgreSQL backends alongside SQLite, updates schema-reset helpers, and aligns config files accordingly
- Adds session‐scoped fixtures and helper functions for MySQL/PostgreSQL servers via
pytest-docker
- Introduces
_reset_schema
anddrop_all_tables
methods to clear test schemas after each run - Provides Docker Compose files, up/down scripts, and updates JSONC storage configs to use the
mlos_bench
database
Reviewed Changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
tests/storage/sql/fixtures.py | Added MySQL/Postgres fixtures and context manager |
tests/storage/sql/docker-compose.yml | Defined MySQL/Postgres services for testing |
tests/storage/sql/down.sh | Manual teardown script for SQL test containers |
tests/storage/sql/init.py | Declared server names and SqlTestServerInfo class |
tests/storage/conftest.py | Exposed new storage fixtures in the root conftest |
tests/conftest.py | Added docker_hostname fixture and included SQL compose file |
storage/sql/storage.py | Added _reset_schema for test cleanup |
storage/sql/schema.py | Made col‐length constants instance attributes; added drop_all_tables |
storage/sql/alembic/README.md / alembic.ini | Expanded Alembic workflow for multiple backends |
config/storage/mysql.jsonc / postgresql.jsonc | Corrected database name to mlos_bench |
tests/services/remote/ssh/… | Switched SSH fixtures to use docker_hostname and wait_docker_service_socket |
Comments suppressed due to low confidence (4)
mlos_bench/mlos_bench/tests/storage/sql/fixtures.py:118
- The
json
module is not imported in this file; addimport json
at the top.
global_configs=[json.dumps(global_config)],
mlos_bench/mlos_bench/tests/storage/sql/fixtures.py:154
- The docstring refers to "MySQL" for the
postgres_storage
fixture; update it to PostgreSQL.
"""
Fixture of a MySQL backed SqlStorage engine.
"""
mlos_bench/mlos_bench/tests/storage/sql/init.py:55
- The docstring in
get_port
mentions SSH; adjust to reference the SQL test server.
"""
Gets the port that the SSH test server is listening on.
"""
mlos_bench/mlos_bench/tests/conftest.py:38
- The
sys
module is used but not imported; addimport sys
at the top of this file.
if sys.platform != "win32" and resolve_host_name(HOST_DOCKER_NAME):
# Pull Request ## Title MySQL schema change to support fractional time ______________________________________________________________________ ## Description - Changes the storage schema to support a variant for MySQL that can handle fractional time. - Adds a custom column comparator to be able to pick that up by default in the future. - Adjusts tests to check for fractional time support. ______________________________________________________________________ ## Type of Change - 🛠️ Bug fix - ✨ New feature - 🔄 Refactor - 🧪 Tests ______________________________________________________________________ ## Testing - A lot of manual testing with docker. - Additional CI tests - Existing CI tests ______________________________________________________________________ ## Additional Notes (optional) Part of a series of changes, should be merged after #983 ______________________________________________________________________ --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Pull Request
Title
Refactor storage tests to support testing multiple backends on schema changes
Description
Type of Change
Testing
Additional Notes (optional)
Part of a series of changes to help improve testing for schedulers.
Next will be schema changes to allow storing fractional seconds in MySQL.
Merge after #987