test(gmail): close #1503's patch-coverage gaps in sync's live-progress and reconciliation paths - #1506
Open
newhoggy wants to merge 1 commit into
Open
test(gmail): close #1503's patch-coverage gaps in sync's live-progress and reconciliation paths#1506newhoggy wants to merge 1 commit into
newhoggy wants to merge 1 commit into
Conversation
…corrupt state.json, and streaming id dedup PR #1503's coverage bot flagged four patch-coverage gaps in the pipelined sync (gmail/sync.rs, gmail/sync/engine.rs), now merged into main uncovered: - run_sync_command's show_progress branch was structurally untestable — it called std::io::stderr().is_terminal() directly instead of taking it as a parameter the way should_show_progress already does. Threaded stderr_is_terminal through so a test can force the live-progress path. - LoadOutcome::Present + --full (forces reconciliation despite a valid watermark) was untested. - LoadOutcome::Corrupt (malformed state.json triggers reconciliation rather than a hard error) was untested. - fetch_and_archive_messages_streaming's duplicate-id dedup (a page-boundary race in the live-streamed listing) was untested.
CoverageTotal: 97.33% 🟢 0.03 pp vs Comparing
Patch coveragePatch: 100% (160/160 new lines covered)
Indirect coverage changes🔴 0 lines lost coverage, 🟢 34 lines gained coverage on unchanged code. Indirect changes
|
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.
Summary
run_sync_command'sshow_progressbranch (sync.rs:130-142) was structurally untestable — it calledstd::io::stderr().is_terminal()directly instead of taking it as a parameter, unlikeshould_show_progresswhich already does this for exactly this reason. Threaded astderr_is_terminal: boolparam through so a test can force the live-progress path.LoadOutcome::Present+opts.full == true(engine.rs:159-168, forces reconciliation despite a valid watermark) was untested.LoadOutcome::Corrupt(engine.rs:186-195, a malformedstate.jsontriggers reconciliation rather than a hard error) was untested.fetch_and_archive_messages_streaming's duplicate-id dedup (engine.rs:458, a page-boundary race in the live-streamed listing) was untested.engine.rs:579-582(insidefetch_and_archive_messages, used only byrun_incremental) as losing coverage on code feat(gmail): pipeline sync's listing/fetch phases and add live multi-bar progress #1503 never touched, with no test removed either — most likely CI measurement noise rather than a real gap, so left as-is.Test plan
cargo build --lib --tests --features mcpcargo test --features mcp --lib cli::gmail::sync::(77 passed)cargo clippy --tests --features mcp -- -D warnings