Closed ximinez closed 5 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 71.0%. Comparing base (
b84f7e7
) to head (f0dc9af
).
Proposed commit message:
test: Add RPC error checking support to unit tests (#4987)
High Level Overview of Change
Adds RPC error verification functionality to unit tests. There are two ways to specify the expected result:
error
string, and an optionalerror_exception
detail message. If the detail message is not specified, it will not be checked.These checks are not comprehensive (for example, nothing checks the optional
error_what
field), but I think they are sufficient for any expected test case results.Context of Change
PR #4887 introduced a new
TER
result code to indicate that an RPC request failed during transaction processing, but it does not indicate which RPC failure occurred. Inspired by a discussion on that PR, I added the ability to explicitly check the RPC result.(Props to @ckeshava for the pre-review.)
Type of Change
API Impact
None.
Test Plan
There should be no observable external effects for this change. This is a developer tool to help write more and better unit tests.
Future Tasks
Now that we can distinguish RPC failures, it might be useful to add more test cases that explicitly test the various combinations of failures. (Thanks to @ckeshava again for the suggestion.]