Skip to content

[quality] test: cover pkg/turn store/envelope/journal error branches (FileStore.Persist/Load, Validate, Journal.Ambiguous, JournaledExecutor.now) - #6189

Open
kubestellar-hive[bot] wants to merge 1 commit into
v4from
quality/test-turn-store-errors
Open

[quality] test: cover pkg/turn store/envelope/journal error branches (FileStore.Persist/Load, Validate, Journal.Ambiguous, JournaledExecutor.now)#6189
kubestellar-hive[bot] wants to merge 1 commit into
v4from
quality/test-turn-store-errors

Conversation

@kubestellar-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds src/pkg/turn/store_error_test.go covering previously untested error and fallback branches in the RFC #4002 re-entrant turn prototype (pkg/turn):

  • FileStore.Persist (store.go): missing containing directory → CreateTemp failure; commit (rename) failure when the destination is an occupied directory, asserting the .turn-envelope-*.tmp file is removed on failure
  • FileStore.Load (store.go): missing envelope file → read error
  • SessionEnvelope.Validate / ParseEnvelope (envelope.go): envelope version mismatch rejection
  • Journal.Ambiguous (journal.go): returns only OpIntended entries in order; nil on an empty journal
  • JournaledExecutor.now (runner.go): wall-clock UTC fallback when Now is nil, and UTC normalization of an injected clock

Coverage

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 claims pkg/turn.


Filed by quality agent (hold-gated mode). Human review required.

— hive: agent=quality backend=copilot model=claude-fable-5

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>
@kubestellar-hive kubestellar-hive Bot added the hold label Sep 7, 2026
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Sep 7, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Changelog: this PR changes code but carries no changelog entry
(no changelog.d/ fragment and no CHANGELOG.md edit).

If it is user-visible — a feature, a fix an operator would notice, a
security change, a migration, a deprecation, or anything breaking —
please add a fragment file changelog.d/<category>-<pr-or-slug>.md
containing exactly your entry (see changelog.d/README.md; the
category is one of added/changed/deprecated/fixed/security). Please
do not append to CHANGELOG.md's ## Unreleased directly — that
shared section is the merge-conflict generator fragments replaced
(#5675). If it is a refactor, a test-only change, or dependency
churn, no entry is needed and you can ignore this.

This is a reminder, not a gate; it never blocks a merge.

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 7, 2026
@kubestellar-hive kubestellar-hive Bot added quality testing agent/quality Approved by a Hive merger/owner for auto-merge on green CI hive/hosted-available-oke-11-placeholder-r05x Approved by a Hive merger/owner for auto-merge on green CI labels Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent/quality Approved by a Hive merger/owner for auto-merge on green CI copilot dco-signoff: yes Indicates the PR's author has signed the DCO. hive/hosted-available-oke-11-placeholder-r05x Approved by a Hive merger/owner for auto-merge on green CI hold quality size/L Denotes a PR that changes 100-499 lines, ignoring generated files. testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants