f574f025a6
Trim AGENTS.md to whole-repo, every-session facts (154 -> 110 lines) and move subsystem guidance into docs/guides/*.md, each with paths: frontmatter and a one-line index entry in AGENTS.md. Symlink each guide from .claude/rules/ so Claude Code lazy-loads it by matching path; track those symlinks via a .gitignore exception (.claude/settings.local.json stays ignored).
60 lines
2.4 KiB
Markdown
60 lines
2.4 KiB
Markdown
---
|
|
paths:
|
|
- "licensing-service-startos/licensing-service/tests/**"
|
|
---
|
|
|
|
# Testing, lint & CI status
|
|
|
|
## Running
|
|
|
|
From `licensing-service-startos/licensing-service/`:
|
|
|
|
```
|
|
cargo test # all suites
|
|
cargo test --test api # one suite — suites: api crosscheck migrations subscriptions upgrades worker
|
|
cargo test <name> # single test by name pattern
|
|
cargo clippy --all-targets # ~6 style lints (e.g. unnecessary_map_or)
|
|
cargo fmt --check # reports formatting diffs (does not write)
|
|
```
|
|
|
|
## There is no CI
|
|
|
|
No `.github/workflows`, no Gitea/Woodpecker/Drone config. **Nothing is enforced** —
|
|
not `cargo test`, not `clippy`, not `fmt`. The release gate is `publish.sh`.
|
|
|
|
## Formatting is not clean and not enforced
|
|
|
|
The tree has never been run through `cargo fmt` (56 daemon files differ) or
|
|
`prettier` (37 wrapper files differ). `cargo check` and `tsc --noEmit` pass clean.
|
|
If you ever format, do it as a **standalone commit** so the mechanical churn
|
|
doesn't bury logic changes.
|
|
|
|
## Runtime-prepared SQL → tests are the only safety net
|
|
|
|
`db/repo.rs` queries are `sqlx::query(&format!(...))`, prepared at runtime, so bad
|
|
or ambiguous columns 500 only when executed. A real prod regression (every paid
|
|
purchase returning 500 on `:52`) shipped this way because the new merchant-profile
|
|
resolution path had no passing test. When adding/altering a repo query, add a test
|
|
that actually executes it. See [payments](payments.md).
|
|
|
|
## Known-failing tests (3 in tests/api.rs)
|
|
|
|
Test-debt from the `:52` payments transition; the backend is sound, these are a
|
|
test-strategy decision, not bugs:
|
|
|
|
- `paid_purchase_creates_invoice_via_provider`, `paid_purchase_in_usd_records_listed_currency_and_rate`
|
|
— fail with a legitimate 400 ("no payment providers connected"); the fixture
|
|
seeds no provider. Reaching 200 needs the mock wired through
|
|
`resolve_provider_for_profile_rail` (`build_provider` only makes real clients;
|
|
`#[cfg(test)]` does not apply to integration tests against the lib).
|
|
- `payment_provider_preference_round_trip` — inserts into the dropped
|
|
`btcpay_config`/`zaprite_config`; superseded by
|
|
`merchant_profile_provider_resolution_queries_round_trip` (delete or rewrite).
|
|
|
|
The other 43 api tests + all other suites pass.
|
|
|
|
## Cross-language wire-format tests
|
|
|
|
The LIC1 format is verified across SDKs separately — see
|
|
[crypto-wire-format](crypto-wire-format.md).
|