imp(tests): refactor table driven tests #881
Labels
A: blocked
Admin: blocked by another (internal/external) issue or PR
O: code-hygiene
Objective: aims to improve code hygiene
O: maintainability
Objective: cause to ease modification, fault corrections and improve code understanding
O: testing
Objective: aims to improve testing coverage
Improvement Summary
Currently, some of the rust tests contain a group of table/data-driven tests. These tests will fail if one in the group fails.
ibc-rs/crates/ibc/src/applications/transfer/coin.rs
Lines 125 to 148 in c83f26a
We want to treat each testcases individually. If one fails, the others in the group may continue.
Proposal
The current Rust release doesn't support this feature. The common opinion in the Rust community is to keep each testcases in a separate test method, potentially using a macro.
We don't want to implement/maintain our macro. So we will use
rstest
as a solution. The following is a refactored code of the above example usingrstest
.ibc-rs/crates/ibc/src/applications/transfer/coin.rs
Lines 144 to 159 in 1aa853b
The text was updated successfully, but these errors were encountered: