@@ -12,7 +12,7 @@ Thank you for your interest in contributing to Scrutiny! This is an actively mai
1212
1313We use a Gitflow-style workflow:
1414
15- - ` main ` - Production-ready code (protected)
15+ - ` master ` - Production-ready code (protected)
1616- ` develop ` - Integration branch for features
1717- ` feature/SCR-{id}-description ` - New features
1818- ` fix/SCR-{id}-description ` - Bug fixes
@@ -23,7 +23,7 @@ We use a Gitflow-style workflow:
23231 . Fork the repository and create your branch from ` develop `
24242 . Follow the commit convention: ` type(scope): description `
25253 . Ensure all tests pass
26- 4 . Submit a PR to ` develop ` (or ` main ` for hotfixes)
26+ 4 . Submit a PR to ` develop ` (or ` master ` for hotfixes)
2727
2828## Code Style
2929
@@ -207,6 +207,10 @@ ghcr.io/starosdev/scrutiny:local
207207
208208# Running Tests
209209
210+ ## Backend Tests
211+
212+ Backend tests require a running InfluxDB container:
213+
210214```bash
211215docker run -p 8086:8086 -d --rm \
212216-e DOCKER_INFLUXDB_INIT_MODE=setup \
@@ -216,6 +220,36 @@ docker run -p 8086:8086 -d --rm \
216220-e DOCKER_INFLUXDB_INIT_BUCKET=metrics \
217221-e DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=my-super-secret-auth-token \
218222influxdb:2.2
219- go test ./...
220223
224+ go test ./... # Run all tests
225+ go test -v ./webapp/backend/pkg/web/... # Run tests in specific package
226+ go test -v -run TestFunctionName ./path/to/pkg/ # Run specific test by name
227+ go test -coverprofile=coverage.txt ./... # Run with coverage
221228```
229+
230+ ## Frontend Tests
231+
232+ ``` bash
233+ cd webapp/frontend
234+ npm test # Run tests with watch mode
235+ npm test -- --watch=false # Run tests once
236+ npm test -- --watch=false --browsers=ChromeHeadless # Headless CI mode
237+ npx ng test --watch=false --code-coverage # Run with coverage
238+ ```
239+
240+ # API Endpoints
241+
242+ | Endpoint | Method | Description |
243+ | ----------| --------| -------------|
244+ | ` /api/health ` | GET | Health check |
245+ | ` /api/health/notify ` | POST | Test notifications |
246+ | ` /api/summary ` | GET | Dashboard summary of all devices |
247+ | ` /api/summary/temp ` | GET | Temperature history for dashboard |
248+ | ` /api/devices/register ` | POST | Register new devices (used by collector) |
249+ | ` /api/device/:wwn/details ` | GET | Get device with S.M.A.R.T history |
250+ | ` /api/device/:wwn/smart ` | POST | Upload S.M.A.R.T metrics (used by collector) |
251+ | ` /api/device/:wwn/selftest ` | POST | Upload self-test results |
252+ | ` /api/device/:wwn/archive ` | POST | Archive a device |
253+ | ` /api/device/:wwn/unarchive ` | POST | Unarchive a device |
254+ | ` /api/device/:wwn ` | DELETE | Delete a device |
255+ | ` /api/settings ` | GET/POST | Application settings |
0 commit comments