d185471802
- Remove duplicate fixtures from all integration tests - Add SQLite support for unit tests (generic Uuid/JSON types) - Verify unit tests run without PostgreSQL (5/8 passing) - Verify integration tests collect successfully (44 tests) - README already documents testing strategy, categories, and fixtures
1.9 KiB
1.9 KiB
1. Restructure backend tests
- 1.1 Create
apps/api/tests/unit/directory and move pure logic tests - 1.2 Create
apps/api/tests/integration/directory and move API tests - 1.3 Create
apps/api/tests/system/directory for full stack tests - 1.4 Update
pytest.iniorpyproject.tomlwith test markers
2. Create shared fixtures
- 2.1 Create
apps/api/tests/conftest.pywith shared fixtures - 2.2 Implement SQLite in-memory engine fixture for unit tests
- 2.3 Implement PostgreSQL session fixture with transaction rollback
- 2.4 Implement authenticated TestClient fixture
- 2.5 Remove duplicate fixture code from existing test files
3. Add SQLite support for unit tests
- 3.1 Add
aiosqlitedependency topyproject.toml - 3.2 Update SQLAlchemy configuration to support SQLite
- 3.3 Verify unit tests run without PostgreSQL
4. Update dependencies and configuration
- 4.1 Add missing test dependencies (
python-jose[cryptography]) - 4.2 Configure
pytest-asynciowithasyncio_mode=auto - 4.3 Add
addopts = -m "not system"to default test run
5. Create E2E test setup
- 5.1 Initialize Playwright in
e2e/directory - 5.2 Add Playwright configuration (
playwright.config.ts) - 5.3 Create first E2E test (login flow)
- 5.4 Add
make test-e2etarget to Makefile
6. Update Makefile
- 6.1 Add
test-unittarget - 6.2 Add
test-integrationtarget - 6.3 Add
test-systemtarget - 6.4 Update
testtarget to run all categories
7. Migrate existing tests as examples
- 7.1 Migrate
test_config.pytotests/unit/ - 7.2 Migrate
test_auth_api.pytotests/integration/ - 7.3 Verify migrated tests still pass
8. Documentation
- 8.1 Update README with testing strategy
- 8.2 Document how to run specific test categories
- 8.3 Document fixture usage patterns