Skip to content

Conversation

@d-v-b
Copy link
Contributor

@d-v-b d-v-b commented Sep 16, 2025

This change declares the minio and mysql docker services as pytest fixtures, which allows running the test suite without invoking docker-compose.

It also declares a test dependency group in pyproject.toml, so that tests can be run with uv sync --group test && pytest tests

@github-actions github-actions bot added enhancement Indicates new improvements feature Indicates new features labels Sep 16, 2025
@d-v-b d-v-b marked this pull request as ready for review September 16, 2025 12:22
@d-v-b
Copy link
Contributor Author

d-v-b commented Sep 16, 2025

@dimitri-yatsenko have a look. some tests are failing, which means the services are not exactly configured correctly, but I think this is a promising workflow

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the test infrastructure to use pytest fixtures for managing Docker containers (MySQL and MinIO) instead of relying on docker-compose. This enables running tests with a simpler uv sync --group test && pytest tests command and provides better container lifecycle management within the pytest framework.

Key changes:

  • Replace docker-compose based test execution with pytest-managed Docker containers
  • Add comprehensive Docker container management with proper cleanup mechanisms
  • Update test dependencies to use new dependency groups format

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/conftest.py Adds Docker container fixtures for MySQL and MinIO with lifecycle management
tests/test_json.py Converts module-level MySQL version check to pytest fixture
src/datajoint/settings.py Adds support for DJ_PORT environment variable configuration
pyproject.toml Updates dependency structure and adds test dependencies
docker-compose.yaml Updates comments to reflect new pytest-based testing approach
.github/workflows/test.yaml Simplifies CI workflow to use pytest instead of docker-compose

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@d-v-b
Copy link
Contributor Author

d-v-b commented Sep 16, 2025

The graphviz dependency is outside of what pypi can provide, so I brought in pixi to declare that dependency from conda-forge. All tests are passing for me locally now.

You can try this with

pixi run -e test pytest tests

To see the logs related to the standup / shutdown of the docker container images, run

pixi run -e test pytest tests/ --log-cli-level INFO

@d-v-b
Copy link
Contributor Author

d-v-b commented Sep 16, 2025

@dimitri-yatsenko it would be great to get tests running as part of CI. Should I open a new ticket for this?

@dimitri-yatsenko dimitri-yatsenko merged commit 896e6cd into datajoint:pre/v2.0 Sep 19, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Indicates new improvements feature Indicates new features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants