You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: TESTING.md
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ The Marchat test suite provides foundational coverage of the application's core
12
12
-**Database Tests**: Testing database operations and schema management
13
13
-**Server Tests**: Testing WebSocket handling, message routing, and user management
14
14
15
-
**Note**: When **`main`** has moved past the latest Git tag, a narrative summary may appear in **README.md** → **Latest Updates**. This is a foundational test suite with good coverage for smaller utility packages and significantly improved coverage for client and server components. **Overall statement coverage is 37.8%** across all packages in the main module, computed from the merged profile at the repo root (for example the `coverage` file or another path passed to `go test -coverprofile=... ./...`). Regenerate summaries with `go tool cover -func=<same-path>`. On **Windows PowerShell**, prefer a profile filename **without** a `.out` suffix (e.g. `mergedcoverage` or `coverage`) so the argument is not misparsed.
15
+
**Note**: When **`main`** has moved past the latest Git tag, a narrative summary may appear in **README.md** → **Latest Updates**. This is a foundational test suite with good coverage for smaller utility packages and significantly improved coverage for client and server components. **Overall statement coverage is 37.9%** across all packages in the main module, computed from the merged profile at the repo root (for example the `coverage` file or another path passed to `go test -coverprofile=... ./...`). Regenerate summaries with `go tool cover -func=<same-path>`. On **Windows PowerShell**, prefer a profile filename **without** a `.out` suffix (e.g. `mergedcoverage` or `coverage`) so the argument is not misparsed.
16
16
17
17
**Database backends:** Automated tests open **SQLite** (usually in-memory or a temp file). PostgreSQL and MySQL/MariaDB are supported at runtime via `MARCHAT_DB_PATH`. **GitHub Actions** runs an extra **`database-smoke`** job (see `.github/workflows/go.yml`) with Postgres 16 and MySQL 8 service containers: it sets `MARCHAT_CI_POSTGRES_URL` and `MARCHAT_CI_MYSQL_URL` and runs `TestPostgresInitDBAndSchemaSmoke` / `TestMySQLInitDBAndSchemaSmoke` in `server/db_ci_smoke_test.go` (`InitDB` + `CreateSchema` + table checks). Locally, those tests **skip** unless you export the same variables (for MySQL, use a `mysql:` or `mysql://` prefix on the DSN so it is not parsed as a SQLite path). Schema creation is dialect-aware (including MySQL/MariaDB rules for indexed text).
18
18
@@ -209,7 +209,7 @@ go test -cover ./...
209
209
|`config`| 73.2% | High | 339 | Small |
210
210
|`plugin/host`| 62.5% | Medium | 623 | Medium |
211
211
|`client/config`| 58.0% | Medium | 1993 | Medium |
212
-
|`internal/doctor`| 52.1% | Medium |802| Medium |
212
+
|`internal/doctor`| 52.5% | Medium |809| Medium |
213
213
|`plugin/store`| 47.0% | Medium | 552 | Medium |
214
214
|`cmd/license`| 42.2% | Medium | 160 | Small |
215
215
|`server`| 36.3% | Low | 7215 | Large |
@@ -220,7 +220,7 @@ go test -cover ./...
220
220
221
221
¹Non-test `.go` files only, physical line count (`wc -l` style), **only `.go` files in that package directory** (not subpackages such as `client/config` inside `client/`). Regenerate with the Python snippet in **Test Metrics** or `find` + `wc`.
222
222
223
-
**Overall coverage: 37.8%** (all packages in the main module; merged profile `coverage` or another `-coverprofile` path)
223
+
**Overall coverage: 37.9%** (all packages in the main module; merged profile `coverage` or another `-coverprofile` path)
224
224
225
225
### High Coverage (70%+)
226
226
-**Shared Package**: Cryptographic operations, data types, message handling, version utilities (88.1%)
@@ -231,7 +231,7 @@ go test -cover ./...
231
231
### Medium Coverage (40-70%)
232
232
-**Plugin Host Package**: Load/start/stop lifecycle, JSON IPC with a minimal test plugin, `ExecuteCommand` (62.5%)
|`server/health.go`| 89.3% | server | Health monitoring and status |
254
255
|`plugin/license/validator.go`| 87.1% | plugin/license | License validation and verification |
@@ -425,8 +426,8 @@ When adding new functionality to Marchat:
425
426
-**Top-level tests**: 348 `Test*` entrypoints from `go test -list . ./...` on the main module; the nested **`plugin/sdk`** module adds 10 more (`cd plugin/sdk && go test -list . ./...`).
426
427
-**Test files**: 42 tracked `_test.go` files (`git ls-files '*_test.go'`), including `plugin/sdk/plugin_test.go` in the nested SDK module.
427
428
-**Packages (`go list ./...`)**: 15 in the main module; `plugin/sdk` and `plugin/examples/echo` are nested modules with their own `go.mod` files (root `go test ./...` does not run their tests).
-**Overall Coverage**: **37.8%** across main-module packages (regenerate with `go test -coverprofile=mergedcoverage ./...` then `go tool cover -func=mergedcoverage`; on PowerShell avoid `-coverprofile=*.out`--see note above)
-**Overall Coverage**: **37.9%** across main-module packages (regenerate with `go test -coverprofile=mergedcoverage ./...` then `go tool cover -func=mergedcoverage`; on PowerShell avoid `-coverprofile=*.out`--see note above)
430
431
-**Lines of code (approx.)**: non-test `.go` lines per package directory, same totals as the **Current Coverage Status** table (e.g. `server` 7215, `client` 5555); re-count with:
431
432
`python -c "import os; ..."` walking the tree and skipping `*_test.go`, or equivalent `find` + `wc -l`.
432
433
-**Execution Time**: on the order of a few seconds for `go test ./...` on a typical dev machine
0 commit comments