[quality] test: cover pkg/turn store/envelope/journal error branches (FileStore.Persist/Load, Validate, Journal.Ambiguous, JournaledExecutor.now) - #6189
Conversation
Cover previously untested branches in the RFC #4002 turn prototype: - FileStore.Persist: missing containing directory (CreateTemp failure) and failed rename commit, asserting the temp file is cleaned up - FileStore.Load: missing envelope file read error - SessionEnvelope.Validate / ParseEnvelope: envelope version mismatch - Journal.Ambiguous: returns only OpIntended entries, nil when empty - JournaledExecutor.now: wall-clock UTC fallback when Now is nil pkg/turn coverage: 91.3% -> 94.7%. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: sec-check <sec-check@hive.kubestellar.io>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Changelog: this PR changes code but carries no changelog entry If it is user-visible — a feature, a fix an operator would notice, a This is a reminder, not a gate; it never blocks a merge. |
Test Improvement
Adds
src/pkg/turn/store_error_test.gocovering previously untested error and fallback branches in the RFC #4002 re-entrant turn prototype (pkg/turn):.turn-envelope-*.tmpfile is removed on failureOpIntendedentries in order; nil on an empty journalNowis nil, and UTC normalization of an injected clockCoverage
pkg/turn: 91.3% → 94.7% of statements. Remaining Persist gaps are fault-injection-only branches (chmod/write/fsync failures on a healthy tmpfs).Scope / disjointness
Touches only
src/pkg/turn/store_error_test.go(new file). No open PR claimspkg/turn.Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5