fix(tests): tolerate new cardano-cli 'Missing:' spacing - #3605
Merged
Conversation
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.
Contributor
There was a problem hiding this comment.
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
--feemissing-argument assertion to accept both legacy and updatedcardano-clioutputs. - 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_idto 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.