Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revamp mock testing artifacts in the ibc-testkit #677

Closed
Tracked by #554
Farhad-Shabani opened this issue May 12, 2023 · 0 comments · Fixed by #1109
Closed
Tracked by #554

Revamp mock testing artifacts in the ibc-testkit #677

Farhad-Shabani opened this issue May 12, 2023 · 0 comments · Fixed by #1109
Assignees
Labels
O: testing Objective: aims to improve testing coverage

Comments

@Farhad-Shabani
Copy link
Member

Farhad-Shabani commented May 12, 2023

Summary

We need a new, more flexible mock testing artifacts exposed by ibc-testkit so can cover a wider range of testing scenarios and achieve a better coverage of recent updates to IBC-rs (Instead of constantly tweaking the existing abstractions). That being said, we may be able to repurpose certain components and abstraction from the existing one.

Proposal

Some points might worth to consider:

  • Abstract real-life interactions between components
    A proposal is to break down the elements within the current MockContext and abstract each chain's component separately (including a synthetic block generator as our consensus engine simulator, an in-memory storage, a minimal app with a single IBC module, and some functions to mimic a relayer). With these individual components, we can shape a minimal mock chain struct that closely resemble a real one, easier to understand how the system behaves, more extensible which enables us to define mock chains with different characteristics and test scenarios may require multiple chains.

  • Incorporate an AVL store
    Enables us to better cover Tendermint-specific and proof verification parts. This could be achieved by importing needed types from Basecoin repo (Though some adjustments possibly needed there), which supersedes existing MockIbcStore

  • Remove unnecessary HostType enum
    Looking at the functionality both Mock and SyntheticTendermint serve, we can merge both and leave with a single mock host.

Tracked in #1109

Remarks

  • This issue can be seen part of a broader theme surfaced in Define testing strategy #433. Here, we should eventually clarify which tests can be covered by the new mock artifacts and which will remain out of the scope to be dealt with in other locations like basecoin-rs. However, for the new mock development, some preliminary work may be needed around defining testing strategy

  • Additionally, the outcome of this work would facilitate the resolution of concerns raised in Refactor unit tests #429

@Farhad-Shabani Farhad-Shabani added the O: testing Objective: aims to improve testing coverage label May 12, 2023
@Farhad-Shabani Farhad-Shabani moved this to 📥 To Do in ibc-rs May 12, 2023
@rnbguy rnbguy self-assigned this May 16, 2023
@Farhad-Shabani Farhad-Shabani changed the title [Mock] Develop a new mock module Revamp mock testing artifacts in the ibc-testkit Jan 3, 2024
@github-project-automation github-project-automation bot moved this from 📥 To Do to ✅ Done in ibc-rs May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O: testing Objective: aims to improve testing coverage
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants