cosmos / ibc-rs

Rust implementation of the Inter-Blockchain Communication (IBC) protocol.
Apache License 2.0
182 stars 74 forks source link

docs: ADR-009 to revamp testing framework #1157

Closed rnbguy closed 2 months ago

rnbguy commented 3 months ago

Part of #1109

Rendered

Description


PR author checklist:

Reviewer checklist:

Farhad-Shabani commented 2 months ago

As a general note

While we're at it, it would be good to improve the namings, establish a clear convention, and describe this convention somewhere, for example, in the lib.rs of the ibc-testkit. We've discussed this before, but it's evident that we use Test*** in some places and Mock*** in others. I was thinking of something like this (Take it as a suggestion):

The traits and structs that allow users to introduce their artifacts/implementation can follow the Test*** pattern, as it is with the TestHost and TestBlock, and the object that implements these traits or derived from this struct can follow Mock***. Therefore e.g. :

Perhaps would be more efficient to specify the generic H for the MockContext<H> too, as below:

@seanchen1991 would be great to have your opinion in this regard.

seanchen1991 commented 2 months ago

@Farhad-Shabani I agree with your assessment that we should document the conventions and semantics of ibc-testkit post-refactor in the crate's root 👍

I also like your suggesting about aliasing the different TestContexts.

rnbguy commented 2 months ago

Agree with @Farhad-Shabani ! Let me make these changes on #1109 directly.

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 66.38%. Comparing base (6e7172d) to head (cb8e706). Report is 4 commits behind head on feat/refactor-testkit.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## feat/refactor-testkit #1157 +/- ## ========================================================= - Coverage 66.38% 66.38% -0.01% ========================================================= Files 235 235 Lines 23367 23347 -20 ========================================================= - Hits 15512 15498 -14 + Misses 7855 7849 -6 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.