test: raise coverage toward 98% (task 4.5) - #191
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #191 +/- ##
==========================================
+ Coverage 93.04% 97.39% +4.35%
==========================================
Files 24 24
Lines 3578 3915 +337
==========================================
+ Hits 3329 3813 +484
+ Misses 249 102 -147 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…4.5) Coverage was 93.04%; the largest uncovered blocks were all invocable directly once targeted: - rust2go-gen: integration tests run generate() end-to-end on the cgo, mem (shm), and g2r example fixtures with varied GenArgs (go118, without_main, package name, no_fmt). In real builds generate() only runs inside build scripts, which coverage instrumentation never sees. - rust2go-cli: unit tests for the clap Args -> GenArgs conversion and a CARGO_BIN_EXE end-to-end test covering main.rs. - mem-ring: Notifier::notify error return after peer close (EPIPE), Awaiter::new/wait roundtrip under both runtimes, WriteQueue::meta fd ownership semantics after write(), and the tokio read_with_tokio_handle/write_with_tokio_handle/run_handler-with-handle variants.
lirenjie95
force-pushed
the
refactor/4.5-coverage-98
branch
from
September 8, 2026 01:12
7c9127c to
4b47d55
Compare
- common.rs: tuple-struct rejection in both struct converters, unknown heck type rejection, the five ParamType::try_from error paths, all six 'unrecognized rust primitive type' panic arms (driven by a manually built u128 ParamType), and the list-shape panic arms - r2g/mod.rs: nine try_from rejection tests plus an attribute-matrix happy path (mem/shm ids, cgo aliases, go_pass_struct, drop_safe variants, send, ret_static reference flip) - g2r/mod.rs: five rejection tests plus cgo alias, ffi_param_cnt and has_ret coverage - rust2go: direct c_rust2go_internal_drop round-trip test
- unstuck flush: a still-full queue keeps remaining items pending (Err -> push_front -> break, stuck re-arm) - working handler exits via the stop channel when its Guard is dropped; later pushes stay queued and the notify EPIPE is swallowed - drain/yield/re-notify stress for the working handler loop Note: the unstuck handler's own stop branch is unreachable by design (the stop receiver lives in the shared WriteQueueInner that the handler clone keeps alive) and is intentionally not tested here; tracked as a known issue in the refactor plan.
The working handler drops the read queue when it exits; if the read queue owned the shared memory, the buffer would be freed while the write queue still points at it (glibc tcache corruption at teardown). Swap the roles so the write side owns the memory.
Project status check with target 97% and threshold 0.5%, ratcheting the coverage reached by this branch (97.39%). No patch gate, so adding defensive or platform-specific code is never blocked. docs/ci.md documents the gate and why the remaining misses are out of reach.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First half of refactor-plan task 4.5 (coverage 93.04% -> 98% target). This PR targets the three largest zero/low-coverage blocks; the remaining error paths in rust2go-common/rust2go-macro and the Codecov threshold gate land in 4.5b.
generate(), 82 lines at 0%): integration tests run the full pipeline on the cgo/mem/g2r example fixtures with variedGenArgsand assert on generated-content markers (imports, shm templates, internal drop, package/main emission, go118 reflect helpers, thego fmtsubprocess branch).Args->GenArgs, plus aCARGO_BIN_EXE_rust2go-cliend-to-end test coveringmain.rs.notifyEPIPE error path after peer close,Awaiter::new/waitroundtrip (monoio + tokio),WriteQueue::metafd-ownership semantics, and the tokio handle variants (read_with_tokio_handle/write_with_tokio_handle/run_handlerwith explicit handle).