Skip to content

test(coverage): expand coverage for stream and lifecycle modules#21

Merged
mikehostetler merged 1 commit intomainfrom
test/coverage-followup
Feb 27, 2026
Merged

test(coverage): expand coverage for stream and lifecycle modules#21
mikehostetler merged 1 commit intomainfrom
test/coverage-followup

Conversation

@mikehostetler
Copy link
Contributor

Summary

  • add focused unit coverage for Jido.Shell.Exec (run/4, run_in_dir/5, and path escaping)
  • add streaming and fallback coverage for Jido.Shell.StreamJson, including:
    • session-server streaming path
    • JSON/raw line parsing (including trailing-buffer parsing)
    • timeout/cancel/crash/error handling
    • heartbeat callbacks
    • fallback eligibility behavior and callback safety
  • add provisioning and teardown coverage for Jido.Shell.SpriteLifecycle, including:
    • successful provisioning and teardown flows
    • retry/warning flows
    • missing API and missing client/sprite-name branches
  • ratchet CI coverage gate from 73.0 to 83.5 in .github/workflows/ci.yml

Validation

  • mix test test/jido/shell/exec_test.exs test/jido/shell/stream_json_test.exs test/jido/shell/sprite_lifecycle_test.exs --seed 0
  • mix test --seed 0
  • mix quality
  • mix coveralls
  • mix coveralls.json && MIX_ENV=test mix run -e 'minimum = 83.5; data = Jason.decode!(File.read!("cover/excoveralls.json")); coverages = data["source_files"] |> Enum.flat_map(& &1["coverage"]); relevant = Enum.count(coverages, &(!is_nil(&1))); missed = Enum.count(coverages, &(&1 == 0)); percent = (relevant - missed) * 100.0 / relevant; rounded = Float.round(percent, 2); IO.puts("Coverage gate: #{rounded}% (minimum #{minimum}%)"); if percent < minimum, do: System.halt(1)'

Coverage

  • total coverage improved from ~73.3% baseline to ~83.9-84.1% locally
  • module-level improvements:
    • lib/jido_shell/stream_json.ex: 0.0% -> 90.6%
    • lib/jido_shell/sprite_lifecycle.ex: 0.0% -> 80.2%
    • lib/jido_shell/exec.ex: 0.0% -> 88.8%

@mikehostetler mikehostetler merged commit 2002ced into main Feb 27, 2026
8 checks passed
@mikehostetler mikehostetler deleted the test/coverage-followup branch February 27, 2026 20:38
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