Skip to content

fix(cli): make JSON envelope contract tests fail on command breakage #589

Closed as not planned

Description

@Sinity

Summary

The JSON envelope contract helper skips when a command raises or exits nonzero, which can hide the same broad failure mode the contract should catch.

Evidence

  • tests/unit/cli/test_json_envelope_contract.py:67 defines _invoke_json_command.
  • tests/unit/cli/test_json_envelope_contract.py:76 enters the failure path on any nonzero exit.
  • tests/unit/cli/test_json_envelope_contract.py:82 through tests/unit/cli/test_json_envelope_contract.py:84 skip on any exception or nonzero exit, not only known fixture setup gaps.

Current helper behavior:

if result.exception:
    pytest.skip(f"{args[0]} --json raised ...")
pytest.skip(f"{args[0]} --json failed (exit {result.exit_code})")

Acceptance criteria

  • Contract tests fail when a JSON-capable command raises unexpectedly or exits nonzero without a valid machine-readable error envelope.
  • Skips are limited to narrow, explicitly detected fixture/environment preconditions.
  • Add a regression test proving an unexpected exception in a JSON command fails the contract suite rather than skipping.
  • The failure message includes the command, exit code, output, and exception type.

Activity

  1. added
    type:fix
    theme:verifiability
    on May 1, 2026
  2. Sinity commented on May 1, 2026

    @Sinity
    OwnerAuthor

    Superseded by #594. I consolidated this finding into the composite issue so the work can be handled as one coherent slice instead of as a tiny standalone ticket. The original evidence remains available in this issue history.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:clitheme:verifiabilitytool:codextype:fixtype:test

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions