Skip to content

test(cli): cover ancestry --json rejections in CLI tests - #38

Merged
samjay8 merged 1 commit into
Externalize-Labs:mainfrom
comandanto:test/ancestry-json-coverage
Oct 29, 2026
Merged

samjay8 merged 1 commit into
Externalize-Labs:mainfrom
comandanto:test/ancestry-json-coverage

Conversation

@comandanto

Copy link
Copy Markdown
Contributor

Summary

Adds integration tests in crates/externalize-cli/tests/cli.rs covering rejection paths when running ancestry --json.

Scope Covered

  1. ancestry_json_without_older_file_reports_rejection:
    • Runs ancestry --json with only ledger-03dca33f.xdr.gz.
    • Asserts exit status code is 1.
    • Parses stdout as JSON and asserts verified is false.
    • Asserts the error message contains header missing.
  2. ancestry_json_for_certified_ledger_reports_not_older_rejection:
    • Runs ancestry --json targeting the certified ledger (64791359).
    • Asserts exit status code is 1.
    • Parses stdout as JSON and asserts verified is false.
    • Asserts the error message contains not older.

Verification

  • cargo fmt --all -- --check: Clean.
  • cargo clippy -p externalize-cli -- -D warnings: Clean (0 warnings).
  • cargo test -p externalize-cli: All 18 tests passed.

Closes #23

Add integration tests verifying that ancestry --json outputs valid JSON with verified: false and the expected error message, and exits with code 1 when an older header file is missing and when the target ledger is the certified ledger itself.

Closes Externalize-Labs#23
@comandanto
comandanto requested a review from samjay8 as a code owner October 29, 2026 04:33
@samjay8
samjay8 merged commit 95c933f into Externalize-Labs:main Oct 29, 2026
22 of 23 checks passed
@samjay8

samjay8 commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Merged — thanks for your contribution! 🎉

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.

[test]: cover ancestry --json rejections in the CLI tests

2 participants