Support custom environment in E2E tests#1645
Conversation
SkymanOne
left a comment
There was a problem hiding this comment.
README of the example contracts needs an update; and just few neatpicks from me.
Otherwise, looks good :)
[ink_e2e]: support custom environment
Codecov Report
@@ Coverage Diff @@
## master #1645 +/- ##
==========================================
- Coverage 70.72% 70.69% -0.03%
==========================================
Files 206 206
Lines 6404 6416 +12
==========================================
+ Hits 4529 4536 +7
- Misses 1875 1880 +5
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
HCastano
left a comment
There was a problem hiding this comment.
Only took a quick look, will review again tomorrow
|
Are block_time in this llink which is |
|
@ganesh1233456 these are very different things; |
| } | ||
|
|
||
| #[test] | ||
| fn duplicate_environment_fails() { |
There was a problem hiding this comment.
Would also be cool to see some UI tests for the E2E macros, but that would be for a future PR
examples/custom-environment/lib.rs
Outdated
| } | ||
| } | ||
|
|
||
| #[cfg(all(test, feature = "e2e-tests", feature = "permissive-node"))] |
There was a problem hiding this comment.
I'd also be curious to know what happens if we try and run an E2E test with a custom env on a node that doesn't use one
|
@SkymanOne since you requested changes we still need another review from you before merging |
This PR allows specifying a custom environment for an e2e test with:
For an example, see
examples/custom-environment.Message building
Currently,
ink_e2eexposes two APIs for message building:MessageBuilderthat is already generic over environmentbuild_messagethat preparesMessageBuilderforDefaultEnvironmentGenerally,
build_messageis nothing more thanMessageBuilder::<DefaultEnvironment, Ref>::from_account_id(account_id). Therefore, I wasn't sure whether we want do anything about it in the context of this PR - I'm open to any suggestion :)