Testing and local verification¶
Feedback ladder¶
Run the narrowest command that can disprove the change, then widen before handoff.
| Scope | Command | Use it for |
|---|---|---|
| One test or module | make test-focused TEST=tests/path.py::test_name |
Red-green development and failure reproduction |
| Formatting and lint | make lint |
Python style, imports, and correctness rules |
| Types | make type-check |
Public and internal type contracts |
| Repository structure | make docs-check architecture-check |
Documentation links, command surface, imports, and package cycles |
| Documentation site | make docs-site |
Strict MkDocs build and site link validation |
| Unit | make test-unit |
Schema, configuration, lifecycle, and pure Collector helpers |
| Contract and delivery | make test-integration |
SDK/framework behavior, packaging policy, CI, and evidence schemas |
| Non-Docker suite | make test |
Normal pre-handoff verification |
| Installed artifact | make smoke |
Source-independent base-wheel behavior |
| Collector end to end | make test-docker |
YAML changes, container behavior, delivery, failure, and recovery |
| Complete local | make verify |
Release-oriented local handoff |
All commands return nonzero on failure and identify the failing file, test, scenario, or contract.
Docker output and the bounded verification report are retained under .build/collector/.
Published documentation¶
make docs-site builds .build/docs-site/ with pinned MkDocs and Material versions. The builder
stages selected root Markdown, the docs/ tree, and the Collector guide. Links to source files
outside the site open the corresponding file on GitHub. Mermaid blocks render as diagrams.
The documentation site workflow builds pull requests and deploys documentation changes from
main to Cloudflare Pages. Create a Cloudflare Pages Direct Upload project named
telemetry-docs, then configure GitHub Actions secrets CLOUDFLARE_API_TOKEN (Pages Edit
permission) and CLOUDFLARE_ACCOUNT_ID. The workflow uploads only the generated site and uses a
GitHub-hosted runner. The intended public URL is https://telemetry-docs.pages.dev/.
Test layers and fixtures¶
tests/unit/exercises validation and lifecycle behavior without live network services.tests/contract/exercises public SDK and framework boundaries using in-memory exporters and local SQLite.tests/delivery/treats repository scripts, docs, CI, packaging, and operational files as executable contracts.collector/tests/contains verification-only Collector overlays. They are not supported deployment profiles.scripts/verify_collector_local.pycreates unique Docker networks, containers, ports, and temporary directories. It uses synthetic canaries and removes its resources on exit, allowing concurrent runs without shared databases or queues.
There is no persistent application state to seed or reset. Unit and contract tests construct their state per test; Collector scenarios construct isolated state per run.
Regression discipline¶
For a meaningful defect, first identify a focused command that fails on the defective behavior. Add a regression test that demonstrates that failure, apply the fix, and rerun the same command before widening the suite. Record both states in the handoff. A passing test written after the fix without red-state evidence is weaker evidence and must be supplemented by an existing contract or an explicit review of the failure mechanism.
Quarantine is not a silent skip. Track a flaky test in Linear team PL, state the observed failure
rate and suspected layer, and keep the issue linked from any temporary skip. Infrastructure
failures and product defects use different issue diagnoses even when they fail the same CI job.
Generated artifacts¶
The repository has no generated source files. build/, dist/, .build/, artifacts/, coverage,
and tool caches are generated outputs and are excluded from source and Docker context. Regenerate
packages with make build; regenerate local Collector evidence with make test-docker. Do not edit
those outputs as source.