Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces comprehensive testing infrastructure and linting workflows to the SBP Portal Backend. The changes modernize the codebase with Python 3.10+ type hints, add extensive test coverage across all service layers, and establish CI/CD pipelines for automated quality checks.
Key Changes:
- Added comprehensive test suite with 90% coverage requirement across services, routes, schemas, and main application
- Introduced GitHub Actions workflows for linting (ruff, black, mypy) and test coverage with Codecov integration
- Modernized type hints from
Optional[X],Dict,Listto Python 3.10+ syntax (X | None,dict,list)
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/conftest.py | Adds shared test fixtures including mock clients, sample data, and environment setup for all tests |
| tests/test_main.py | Tests FastAPI app creation, health endpoint, CORS configuration, and router inclusion |
| tests/test_schemas.py | Validates Pydantic schema validation, field requirements, and data transformations |
| tests/test_services_seqera.py | Tests Seqera Platform integration including workflow launches, error handling, and API interactions |
| tests/test_services_datasets.py | Tests dataset creation, upload, CSV conversion, and form data handling |
| tests/test_routes_workflows.py | Tests workflow API endpoints including launch, cancel, list, logs, and details |
| tests/test_additional_coverage.py | Provides additional tests to meet coverage thresholds for edge cases |
| tests/init.py | Marks the tests directory as a Python package |
| pytest.ini | Configures pytest with async mode, test paths, and marker definitions |
| pyproject.toml | Defines project metadata and configuration for coverage, ruff, black, and mypy |
| requirements-dev.txt | Specifies development dependencies for testing and linting |
| .pre-commit-config.yaml | Configures pre-commit hooks for automated code quality checks |
| .github/workflows/lint.yml | CI workflow for running ruff, black, and mypy linters |
| .github/workflows/test-coverage.yml | CI workflow for running tests with coverage reporting to Codecov |
| .github/PULL_REQUEST_TEMPLATE.md | Template to standardize pull request descriptions |
| app/main.py | Updates type hints to modern Python 3.10+ syntax |
| app/services/seqera.py | Modernizes type hints and improves code formatting consistency |
| app/services/datasets.py | Updates type hints to Python 3.10+ syntax and improves readability |
| app/schemas/workflows.py | Converts all type hints to modern syntax (pipe union notation) |
| app/routes/workflows.py | Updates type hints and adds proper exception chaining with from exc |
| README.md | Adds CI badges, updates Python version requirement, and documents testing/linting procedures |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
marius-mather
left a comment
There was a problem hiding this comment.
The tests and CI checks look great, just a few suggestions on project and testing setup that will hopefully make things easier down the line.
You don't have to use the testing/mocking libraries like respx or polyfactory - just wanted to point them out as I find them useful for my own testing.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Hiiii @marius-mather, thank you for such informative comments hehe. I got some new updates regarding of new environment manager. |
marius-mather
left a comment
There was a problem hiding this comment.
This is looking great now - just a few small things to look at
marius-mather
left a comment
There was a problem hiding this comment.
Looking great now, thanks
Pull Request
SBP-232 Enable BindFlow Workflow Execution from Input Workflow Page
Summary
This PR introduces comprehensive testing infrastructure and automated quality checks to the SBP Portal Backend, establishing a solid foundation for maintainability and code quality. The changes include 93% test coverage (exceeding the 90% requirement), modern Python 3.10+ type hints, and CI/CD pipelines for automated testing and linting.
Changes
Testing Infrastructure (70 tests, 93.14% coverage)
CI/CD Workflows
release-simple.yml:Project Configuration
Coverage by Module
How to Test
Running Tests Locally
Running Linters
Pre-commit Hooks
CI/CD Validation
Type of change
Checklist