docs: update comprehensive API documentation and project guides
This commit updates all documentation files throughout the project: - Updated IMPLEMENTATION_PLAN.md with new implementation details - Updated PROJECT_GUIDELINES.md with coding standards and practices - Updated README.md with current project information - Updated SCREENSHOT_AUTOMATION.md with new automation details - Added TEST_DATA.md with test fixtures data - Updated cover_image_serving_plan.md with static URL patterns Documentation API updates: - Updated API reference documentation for all endpoints including: - Authentication (login, logout, register, refresh_token) - Book matching (auto_link, bulk_link, link_book, search) - Collections (CRUD operations, shelf mappings, auto-assign rules) - Conflicts (bulk operations, resolve/dismiss) - Devices (registration, approval, shelf management) - Highlights (create, update, delete, get) - Kobo sync (bookmark, markup, initialization, sync) - KOReader sync (library, metadata, bookmarks, progress) - Libraries (CRUD, folders, media items, stats) - Media items (bulk operations, CRUD) - Notes (CRUD operations) - OPDS (acquisition, feeds, publication) - Progress (reading progress tracking) - Queue (device queue management) - Ratings (star ratings) - Scanner (watch mode, scan operations) - Sync protocols (Kobo, KOReader) - Users (profile, password, admin operations) - WebSocket protocols - Updated user guides (admin, dashboard, settings, sync) - Updated device setup guides (Kobo, KOReader) - Updated developer guides (testing, contributing, operations) - Updated scripts/README.md
This commit is contained in:
@@ -9,6 +9,7 @@ This document describes how to run and write tests for Bookhoard.
|
||||
All integration tests use the email domain **`@tests.bookhoard.internal`** for test users. This domain is reserved exclusively for testing and will never be used in production.
|
||||
|
||||
**Why this domain?**
|
||||
|
||||
- Clear indication it's for testing only
|
||||
- Won't conflict with real user emails (which use real domains like `@gmail.com`, `@example.com`, etc.)
|
||||
- Safe cleanup: Tests can delete all users with this domain without risk to production data
|
||||
@@ -33,6 +34,7 @@ The test suite creates these standard users:
|
||||
### Test Lifecycle and Cleanup
|
||||
|
||||
Each test run:
|
||||
|
||||
1. **Deletes** all existing users with `@tests.bookhoard.internal` email
|
||||
2. **Creates** fresh standard test users
|
||||
3. **Runs** the test with clean state
|
||||
@@ -45,12 +47,14 @@ This ensures complete test isolation - no state leaks between tests.
|
||||
When writing new tests:
|
||||
|
||||
**✅ DO:**
|
||||
|
||||
- Use the standard test users from `setupTestServer(t)`
|
||||
- Use `createRegularUserOnce(t, setup.DB)` for additional test users
|
||||
- Let the test framework handle cleanup
|
||||
- Use the `@tests.bookhoard.internal` domain if creating custom test users
|
||||
|
||||
**❌ DON'T:**
|
||||
|
||||
- Use real email domains like `@example.com` or `@gmail.com`
|
||||
- Manually manage test user deletion (unless absolutely necessary)
|
||||
- Assume test users persist between test runs
|
||||
@@ -59,21 +63,25 @@ When writing new tests:
|
||||
## Running Tests
|
||||
|
||||
### Run All Tests
|
||||
|
||||
```bash
|
||||
make test
|
||||
```
|
||||
|
||||
### Run Integration Tests Only
|
||||
|
||||
```bash
|
||||
make test-integration
|
||||
```
|
||||
|
||||
### Run Specific Test
|
||||
|
||||
```bash
|
||||
go test -v -run TestUpdateProfile ./cmd/server/tests/
|
||||
```
|
||||
|
||||
### Run with Race Detection
|
||||
|
||||
```bash
|
||||
go test -race ./cmd/server/tests/
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user