feat: implement git repository management
- 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
This commit is contained in:
+35
@@ -0,0 +1,35 @@
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: E2E Test Framework
|
||||
|
||||
The system SHALL provide end-to-end tests using Playwright.
|
||||
|
||||
#### Scenario: Test setup
|
||||
- GIVEN the e2e test directory
|
||||
- THEN `e2e/` SHALL contain Playwright configuration
|
||||
- AND tests SHALL run against the full application stack
|
||||
|
||||
#### Scenario: Critical user journeys
|
||||
- GIVEN the e2e test suite
|
||||
- THEN it SHALL test:
|
||||
- User login flow
|
||||
- Project creation and listing
|
||||
- SSH key generation
|
||||
|
||||
#### Scenario: Test environment
|
||||
- GIVEN e2e tests are running
|
||||
- THEN they SHALL use a dedicated test database
|
||||
- AND tests SHALL clean up data after completion
|
||||
|
||||
### Requirement: Test Commands
|
||||
|
||||
The system SHALL provide Makefile targets for running different test categories.
|
||||
|
||||
#### Scenario: Make targets
|
||||
- GIVEN the Makefile
|
||||
- THEN these targets SHALL exist:
|
||||
- `make test-unit` - Run unit tests only
|
||||
- `make test-integration` - Run integration tests only
|
||||
- `make test-system` - Run system tests only
|
||||
- `make test-e2e` - Run Playwright E2E tests
|
||||
- `make test` - Run all backend tests
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: Shared Test Fixtures
|
||||
|
||||
The system SHALL provide shared fixtures in `conftest.py` for common test needs.
|
||||
|
||||
#### Scenario: Database session fixture
|
||||
- GIVEN an integration test
|
||||
- WHEN using the `db_session` fixture
|
||||
- THEN it SHALL provide an async SQLAlchemy session
|
||||
- AND the session SHALL use transaction rollback for isolation
|
||||
|
||||
#### Scenario: Test client fixture
|
||||
- GIVEN an API integration test
|
||||
- WHEN using the `client` fixture
|
||||
- THEN it SHALL provide an authenticated TestClient instance
|
||||
- AND the client SHALL have valid access and refresh tokens
|
||||
|
||||
#### Scenario: SQLite unit test database
|
||||
- GIVEN a unit test
|
||||
- WHEN the test uses the `db_engine` fixture
|
||||
- THEN it SHALL provide an in-memory SQLite engine
|
||||
- AND no PostgreSQL connection SHALL be required
|
||||
|
||||
### Requirement: Transaction Isolation
|
||||
|
||||
The system SHALL ensure integration tests don't pollute the database.
|
||||
|
||||
#### Scenario: Rollback after test
|
||||
- GIVEN an integration test creates data
|
||||
- WHEN the test completes
|
||||
- THEN all database changes SHALL be rolled back
|
||||
- AND subsequent tests SHALL see a clean database state
|
||||
|
||||
#### Scenario: Parallel test safety
|
||||
- GIVEN multiple integration tests run concurrently
|
||||
- WHEN each test uses transaction isolation
|
||||
- THEN tests SHALL not interfere with each other
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: Test Directory Structure
|
||||
|
||||
The system SHALL organize tests into unit, integration, and system directories.
|
||||
|
||||
#### Scenario: Directory layout
|
||||
- GIVEN the backend test suite
|
||||
- THEN `apps/api/tests/` SHALL contain:
|
||||
- `unit/` - Pure logic tests with no external dependencies
|
||||
- `integration/` - API endpoint tests with database
|
||||
- `system/` - Full stack tests with external services
|
||||
|
||||
#### Scenario: Running selective tests
|
||||
- GIVEN the test suite is organized
|
||||
- WHEN running `pytest -m unit`
|
||||
- THEN only unit tests SHALL execute
|
||||
- AND WHEN running `pytest -m integration`
|
||||
- THEN only integration tests SHALL execute
|
||||
|
||||
### Requirement: Test Markers
|
||||
|
||||
The system SHALL provide pytest markers for each test category.
|
||||
|
||||
#### Scenario: Marker registration
|
||||
- GIVEN pytest configuration
|
||||
- THEN `pyproject.toml` SHALL register markers:
|
||||
- `unit` - Fast tests with no external dependencies
|
||||
- `integration` - Tests with database and external services
|
||||
- `system` - End-to-end tests of the full stack
|
||||
|
||||
#### Scenario: Marker usage
|
||||
- GIVEN a test file
|
||||
- THEN unit tests SHALL be marked with `@pytest.mark.unit`
|
||||
- AND integration tests SHALL be marked with `@pytest.mark.integration`
|
||||
- AND system tests SHALL be marked with `@pytest.mark.system`
|
||||
Reference in New Issue
Block a user