-
Notifications
You must be signed in to change notification settings - Fork 108
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
Improve runtime tests #1013
Improve runtime tests #1013
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1013 +/- ##
==========================================
- Coverage 81.27% 81.18% -0.09%
==========================================
Files 54 54
Lines 2238 2238
Branches 71 71
==========================================
- Hits 1819 1817 -2
- Misses 402 404 +2
Partials 17 17
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the goals of the PR, however, I think the implementation introduces a big problem - tight coupling between the runtime benchmark code and the runtime test code. In other words, the modularity & composability of the codebase has been compromised.
The main symptom is that the runtime tests now depend on the runtime-benchmarks
feature, which is not good.
This problem can be solved by some of the following approaches:
- Adding a
runtime-tests
feature to the inbound-queue crate - Move the fixture data to
pallets/inbound-queue/src/fixtures.rs
, and conditionally declare it as a module using#[cfg(any(feature = "runtime-tests", feature = "runtime-benchmarks))]
- Conditionally compile
Config::Helper
also using#[cfg(any(feature = "runtime-tests", feature = "runtime-benchmarks))]
09adbfa
to
3bfb3ec
Compare
The added unit test focus on the flow of submit inbound message(including proof verification logic) and check
MessageReceived
event with specifiedxcm_hash
as expected.Together with the previous emulated test then we have a basic ensurance that inbound flow always work as expected without runing e2e smoke test which is a bit too slow.