Aller au contenu
login
arrow_backRetour aux issues
Wayfare-labs/wayfare #65

Add tests for checks package: runner, transport, and individual checks

ecoDébutant help wanted good first issue area:tests difficulty:medium

descriptionDescription

## What The `checks/` package has zero test files. This is the second-largest package by LOC and is responsible for qualifying every corridor's headline integrity and verdict. It is entirely untested. ## Why it matters If a check produces incorrect output, the headline integrity or verdict may be wrong. Without tests, regressions are invisible. The checks are also the primary integration point between corridor data and the final measurement — they exercise HTTP calls, TOML parsing, and Stellar state. ## Current behaviour No test files exist under `checks/`. Coverage is 0%. ## Desired behaviour Every check should have at minimum: - A test for the happy path (valid input → expected output) - A test for the "unknown" path (missing/unavailable input → unknown output) - A test for malformed input (where applicable) The runner (`checks/runner.go`) should be tested with a mock check that returns each integrity and verdict state. ## Where the code lives - `checks/checks.go` — check interface, integrity/verdict types - `checks/runner.go` — parallel check runner - `checks/engine.go` — check composition engine - `checks/issuer_auth_flags.go` — auth_immutable check - `checks/transport.go` — HTTP transport wrapper - `checks/sep10_endpoint.go` — SEP-10 endpoint check - `checks/toml_anchor_asset.go` — TOML anchor asset check ## What "unknown" means here A check that cannot determine its result should return `unknown`, never a default value. Tests must verify this behaviour. ## Acceptance criteria - [ ] `checks/checks_test.go` exists with tests for integrity/verdict types - [ ] `checks/runner_test.go` exists testing parallel execution and error handling - [ ] `checks/engine_test.go` exists testing check composition (checks qualify headline, don't change it) - [ ] Individual checks have at least happy-path and unknown-path tests - [ ] `go test ./checks/...` passes - [ ] No check silently changes the headline integrity or verdict ## Out of scope Do not change check logic. Do not add new checks. Do not modify the runner. ## How to verify ```bash go test -v ./checks/... go test -cover ./checks/... ```
codeOuvre sur GitHub