Skip to content

refactor: split lib.rs, add rustdoc and enforce 90% coverage - #3

Merged
egorsmkv merged 1 commit into
masterfrom
refactor/modules-rustdoc-coverage
Oct 7, 2026
Merged

egorsmkv merged 1 commit into
masterfrom
refactor/modules-rustdoc-coverage

Conversation

@egorsmkv

@egorsmkv egorsmkv commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Split the extension into api, config, checker, worker and stream modules; lib.rs now only registers the existing Python API. Document module responsibilities and functions, and validate rustdoc with warnings denied. Preserve proxy handling, timeouts, concurrency and body-read semantics.

Expand testing to 11 Rust tests and 8 Python API/integration tests. Cover malformed/unsupported proxies, HTTP 200/503 and both body modes, truncated bodies, transport failures, optional result fields and elapsed saturation, queue item/error/end messages and malformed messages, event-loop failures, worker initialization errors, empty streams and bounded concurrency. All network tests use local servers.

Add the CI check Coverage (>=90%). scripts/coverage.sh uses LLVM instrumentation across Rust unit tests and Python tests against the built wheel, then enforces --fail-under-lines 90. No production module is excluded; test files and dependencies are excluded. The job summary includes a progress bar, and rust-coverage artifacts include measured SVG/JSON/HTML reports. Move the PyO3 extension-module feature to Maturin so Rust tests can embed Python while wheels retain extension-module mode.

Validation: cargo clippy --locked --all-targets -- -D warnings, formatting/diff checks, rustdoc with -D warnings, 11 Rust tests, 8 Python tests, and the complete coverage script passed locally on CPython 3.12. Production Rust line coverage: 98.15% (319/325 lines); region coverage 93.35%. This threshold covers lines, not branch coverage. CI also retains Python 3.10/3.15 API jobs.

@egorsmkv
egorsmkv merged commit 0e2fa3e into master Oct 7, 2026
3 of 4 checks passed
@egorsmkv
egorsmkv deleted the refactor/modules-rustdoc-coverage branch October 7, 2026 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant