Skip to content

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

Closed

Description

@samjay8

Context

crates/externalize-cli/tests/cli.rs checks externalize ancestry when it succeeds (text and --json), and when a header file is missing (text). A script reading --json gets no test for the failure shape.

Scope

Add tests that run ancestry --json and parse stdout as JSON:

  • with only ledger-03dca33f.xdr.gz: verified is false, error mentions header missing, exit status 1;
  • with --ledger 64791359 (the certified ledger itself): error mentions not older, exit status 1.

Done when

  • Both tests pass with cargo test -p externalize-cli.
  • They fail if ancestry printed a rejection as text in --json mode.

Comment to be assigned before starting. Read CONTRIBUTING.md for the checks this repository runs.

Activity

  1. added
    good first issue
    complexity:trivial
    Stellar Wave
    test
    on Oct 26, 2026
  2. added a commit that references this issue on Oct 26, 2026
    5b0eda4
  3. comandanto commented on Oct 28, 2026

    @comandanto
    Contributor

    I would like to work on this issue.

    Implementation Plan:

    1. Tests in crates/externalize-cli/tests/cli.rs:
      • Add integration test invoking ancestry --json with only ledger-03dca33f.xdr.gz:
        • Assert exit status is 1.
        • Parse stdout as JSON and assert verified is false, and error field contains header missing.
      • Add integration test invoking ancestry --json with --ledger 64791359:
        • Assert exit status is 1.
        • Parse stdout as JSON and assert verified is false, and error field contains not older.
    2. Structured JSON Validation:
      • Ensure assertions fail if the rejection was emitted as plain text instead of valid JSON in --json mode.
    3. Verification:
      • Run cargo test -p externalize-cli to verify all CLI tests pass (18/18).
      • Run cargo fmt --check and cargo clippy -p externalize-cli -- -D warnings.

    Ready to implement and open a pull request promptly upon assignment.

  4. samjay8 commented on Oct 29, 2026

    @samjay8
    ContributorAuthor

    @comandanto assigned to you, go ahead. Open a PR that says Closes #23; once CI and the checks pass it will be reviewed and merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar Wavearea/clicomplexity:trivialgood first issuetest

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions