Skip to content

fix(tests): tolerate new cardano-cli 'Missing:' spacing - #3605

Merged
mkoura merged 1 commit into
masterfrom
fix_missing_arg_err_matching
Aug 11, 2026
Merged

fix(tests): tolerate new cardano-cli 'Missing:' spacing#3605
mkoura merged 1 commit into
masterfrom
fix_missing_arg_err_matching

Conversation

@mkoura

@mkoura mkoura commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

The cardano-cli optparse error output now pads 'Missing:' with variable whitespace (e.g. 'Missing: --socket-path SOCKET_PATH') and can render empty alternation groups inline
('Missing: ( ) ( ) --fee LOVELACE').

Replace exact substring assertions with regex matching in test_env_network_id, test_socket_path and test_missing_fee so both old and new formats match.

The cardano-cli optparse error output now pads 'Missing:' with
variable whitespace (e.g. 'Missing:  --socket-path SOCKET_PATH')
and can render empty alternation groups inline
('Missing:  ( )      (  )   --fee LOVELACE').

Replace exact substring assertions with regex matching in
test_env_network_id, test_socket_path and test_missing_fee so both
old and new formats match.
@mkoura
mkoura requested a review from saratomaz as a code owner August 11, 2026 16:17
@mkoura
mkoura requested a lite review from Copilot and removed request for saratomaz August 11, 2026 16:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates several negative-path E2E tests to be resilient to recent cardano-cli optparse formatting changes, specifically variable whitespace after Missing: and altered rendering of required-argument listings, by switching from exact substring checks to regex-based matching.

Changes:

  • Relax --fee missing-argument assertion to accept both legacy and updated cardano-cli outputs.
  • Switch socket-path and network-id missing-argument checks from substring matching to regex matching (including escaping where appropriate).
  • Update skip logic in test_env_network_id to detect the missing-network-id condition via regex.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
cardano_node_tests/tests/test_tx_negative.py Replaces a fragile exact missing-fee substring assertion with a regex-backed check while retaining legacy error variants.
cardano_node_tests/tests/test_socket_path.py Adds regex matching for optparse Missing: spacing changes and escapes literal patterns to keep behavior equivalent for non-optparse errors.
cardano_node_tests/tests/test_env_network_id.py Converts the missing network-id error detection from substring to regex (including in the skip-on-missing-env fixture).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@mkoura
mkoura merged commit 74350a1 into master Aug 11, 2026
4 checks passed
@mkoura
mkoura deleted the fix_missing_arg_err_matching branch August 11, 2026 16:25
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.

2 participants