4e2edb1d93
- Add backend API for git repository CRUD (create, list, delete) - Support bare repository initialization and mirror cloning - Add cascade delete for repositories when project is deleted - Add frontend page for repository management per project - Update project page with link to repositories - Add repo_base_path to config - Quality gates: ruff, mypy, typecheck, lint, build all pass
2.4 KiB
2.4 KiB
Why
The current test infrastructure has several issues that slow development and reduce confidence:
- Mixed test types in single directory: Unit, integration, and system tests are all mixed together in
apps/api/tests/, making it hard to run fast unit tests independently. - Duplicate fixture code: Database setup/teardown is duplicated across multiple test files instead of using a shared
conftest.py. - Inconsistent test patterns: 4 different patterns exist for database setup (sync helpers, async fixtures, module reloads, autouse env vars).
- No test database isolation: Tests truncate tables manually instead of using transaction rollback, leading to potential data leakage.
- Backend tests require live PostgreSQL: Unit tests that test pure logic still connect to a real database.
- No E2E/system tests: There's no automated way to test the full stack (frontend + API + database) together.
- Import errors in local environment: Tests depend on packages not in
devdependencies (e.g.,python-jose).
What Changes
- Restructure backend tests into
unit/,integration/, andsystem/directories. - Create shared fixtures in
conftest.pyfor database sessions, test client, and authentication. - Add SQLite in-memory support for fast unit tests that don't need PostgreSQL.
- Implement transaction rollback isolation using
begin_nested()for integration tests. - Add missing test dependencies to
pyproject.toml. - Create E2E test setup using Playwright for critical user journeys.
- Add test markers (
@pytest.mark.unit,@pytest.mark.integration,@pytest.mark.system) to enable selective test runs. - Update Makefile with
test-unit,test-integration,test-system, andtest-e2etargets.
Capabilities
New Capabilities
test-organization: Structured test directories with clear separation of concerns.test-isolation: Transaction rollback and SQLite support for fast, isolated tests.e2e-testing: Playwright-based end-to-end tests for critical user journeys.
Modified Capabilities
docker-infrastructure: Add test database service and test runner configuration.
Impact
apps/api/tests/: Restructured into subdirectories.apps/api/pyproject.toml: New test dependencies added.apps/api/conftest.py: New shared fixtures file.Makefile: New test targets.- New
e2e/directory for Playwright tests. - CI pipeline may need updates to run new test categories.