mirror of
https://github.com/pezkuwichain/revive-differential-tests.git
synced 2026-04-25 16:17:59 +00:00
Update tests stream func
This commit is contained in:
@@ -255,26 +255,28 @@ where
|
||||
}
|
||||
|
||||
stream::iter(tests.into_iter())
|
||||
.map(Ok::<_, anyhow::Error>)
|
||||
.try_filter_map(
|
||||
.filter_map(
|
||||
move |(metadata_file, case_idx, case, mode, reporter)| async move {
|
||||
let leader_compiler = <L::Compiler as SolidityCompiler>::new(
|
||||
args,
|
||||
mode.version.clone().map(Into::into),
|
||||
)
|
||||
.await
|
||||
.inspect_err(|err| error!(?err, "Failed to instantiate the leader compiler"))?;
|
||||
.inspect_err(|err| error!(?err, "Failed to instantiate the leader compiler"))
|
||||
.ok()?;
|
||||
|
||||
let follower_compiler = <F::Compiler as SolidityCompiler>::new(
|
||||
args,
|
||||
mode.version.clone().map(Into::into),
|
||||
)
|
||||
.await
|
||||
.inspect_err(|err| error!(?err, "Failed to instantiate the follower compiler"))?;
|
||||
.inspect_err(|err| error!(?err, "Failed to instantiate the follower compiler"))
|
||||
.ok()?;
|
||||
|
||||
let leader_node = leader_node_pool.round_robbin();
|
||||
let follower_node = follower_node_pool.round_robbin();
|
||||
|
||||
Ok(Some(Test::<L, F> {
|
||||
Some(Test::<L, F> {
|
||||
metadata: metadata_file,
|
||||
metadata_file_path: metadata_file.metadata_file_path.as_path(),
|
||||
mode: mode.clone(),
|
||||
@@ -285,10 +287,9 @@ where
|
||||
leader_compiler,
|
||||
follower_compiler,
|
||||
reporter,
|
||||
}))
|
||||
})
|
||||
},
|
||||
)
|
||||
.filter_map(|result| async move { result.ok() })
|
||||
.filter_map(move |test| async move {
|
||||
match test.check_compatibility() {
|
||||
Ok(()) => Some(test),
|
||||
|
||||
@@ -340,21 +340,13 @@ impl ReportAggregator {
|
||||
&mut self,
|
||||
event: PreLinkContractsCompilationFailedEvent,
|
||||
) {
|
||||
let include_input = self.report.config.report_include_compiler_input;
|
||||
|
||||
let execution_information = self.execution_information(&event.execution_specifier);
|
||||
|
||||
let compiler_input = if include_input {
|
||||
event.compiler_input
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
execution_information.pre_link_compilation_status = Some(CompilationStatus::Failure {
|
||||
reason: event.reason,
|
||||
compiler_version: event.compiler_version,
|
||||
compiler_path: event.compiler_path,
|
||||
compiler_input,
|
||||
compiler_input: event.compiler_input,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -362,21 +354,13 @@ impl ReportAggregator {
|
||||
&mut self,
|
||||
event: PostLinkContractsCompilationFailedEvent,
|
||||
) {
|
||||
let include_input = self.report.config.report_include_compiler_input;
|
||||
|
||||
let execution_information = self.execution_information(&event.execution_specifier);
|
||||
|
||||
let compiler_input = if include_input {
|
||||
event.compiler_input
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
execution_information.post_link_compilation_status = Some(CompilationStatus::Failure {
|
||||
reason: event.reason,
|
||||
compiler_version: event.compiler_version,
|
||||
compiler_path: event.compiler_path,
|
||||
compiler_input,
|
||||
compiler_input: event.compiler_input,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user