-
Notifications
You must be signed in to change notification settings - Fork 85
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
PoC: Integration tests with generic fudge environment #1578
Conversation
|
||
use crate::utils::{logs, time::START_DATE}; | ||
|
||
pub trait Config: |
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.
Common configuration between all our runtimes
Latest, | ||
} | ||
|
||
pub trait Environment { |
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.
The environment wraps different fudge::companion
structs to be used independently of the runtime
#[fudge::companion] | ||
pub struct AltairEnv { | ||
#[fudge::relaychain] | ||
pub relay: RelaychainBuilder<RelayBlock, RelayRtApi, RelayRt, RelayCidp, RelayDp>, | ||
#[fudge::parachain(PARA_ID)] | ||
pub parachain: ParachainBuilder<AltairBlock, AltairRtApi, AltairCidp, AltairDp>, | ||
nonce_manager: Arc<Mutex<NonceManager>>, | ||
pub events: Arc<Mutex<EventsStorage>>, | ||
} | ||
|
||
impl Environment for AltairEnv { | ||
// TODO... | ||
// implement non-default methods of Environment trait | ||
} | ||
|
||
impl Config for altair_runtime::Runtime { | ||
//type RelayApi = kusama_runtime::RuntimeApi; | ||
//type RelayRuntime = kusama_runtime::Runtime; | ||
|
||
const KIND: RuntimeKind = RuntimeKind::Altair; | ||
} |
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.
Each runtime should implement the Environment
and the Config
@mustermeiszer maybe the ideas from this PoC can be used to build the |
ec5c302
to
94341f6
Compare
I think my main problem is that And tests would be generic over |
Yes, the test would be generic over
Regarding this. The setup is the same only for those types you explicitly instantiate in For things like |
But I think, the big point of this PR (and challenge), is that the |
Closed in favor of: #1588 |
Description
Proof of concept to convert the
env
fudge module ofintegration-test
in aRuntime
independent way. So after this, test cases will be based on<T: Config>
whereT
is the current runtime.