Skip to content

test: sync status command coverage#39

Merged
mdheller merged 3 commits into
mainfrom
test/sync-status-cli
Jun 16, 2026
Merged

test: sync status command coverage#39
mdheller merged 3 commits into
mainfrom
test/sync-status-cli

Conversation

@mdheller

Copy link
Copy Markdown
Contributor

Summary

  • 12 test cases for sourceos-syncd sync status in tests/test_cli_sync_status.py
  • Covers: empty store, healthy/unhealthy daemon states, all four good outcomes (applied/dry_run/planned/no_change), failed outcome, inactive daemon, receipt age calculation, malformed timestamp graceful handling, multi-receipt count, compact vs pretty output

Test plan

  • python -m pytest tests/test_cli_sync_status.py -v → 12 passed
  • Full suite python -m pytest -q → 107 passed (no regressions)

mdheller added 3 commits June 16, 2026 13:17
sourceos-syncd sync status shows daemon and sync health at a glance:
- daemon field: active | inactive | unknown (via systemctl is-active)
- currentVersion: last applied content view version from ReceiptStore
- lastReceipt: issuedAt, outcome, ageSeconds since issuedAt
- storeReceipts: total receipt count
- healthy: true iff daemon==active and last outcome in approved set

Exit 0 if healthy, 1 if not. Accepts --store-root and --compact.
Used by scripts/doctor.sh in source-os for the full health check.
@mdheller mdheller merged commit 7653d42 into main Jun 16, 2026
4 checks passed
@mdheller mdheller deleted the test/sync-status-cli branch June 16, 2026 17:45
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