From fb4c58cc489ab17dca303ecd7471054cac70876e Mon Sep 17 00:00:00 2001 From: andrussal Date: Sun, 8 Mar 2026 13:20:12 +0100 Subject: [PATCH] Unify manual cluster control surface --- testing-framework/core/src/runtime/manual.rs | 12 ++--------- .../deployers/local/src/manual/mod.rs | 20 ++++++------------- 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/testing-framework/core/src/runtime/manual.rs b/testing-framework/core/src/runtime/manual.rs index dfa0292..4e8af53 100644 --- a/testing-framework/core/src/runtime/manual.rs +++ b/testing-framework/core/src/runtime/manual.rs @@ -1,15 +1,7 @@ use async_trait::async_trait; -use crate::scenario::{Application, DynError, NodeControlHandle, StartNodeOptions, StartedNode}; +use crate::scenario::{Application, ClusterWaitHandle, NodeControlHandle}; /// Interface for imperative, deployer-backed manual clusters. #[async_trait] -pub trait ManualClusterHandle: NodeControlHandle { - async fn start_node_with( - &self, - name: &str, - options: StartNodeOptions, - ) -> Result, DynError>; - - async fn wait_network_ready(&self) -> Result<(), DynError>; -} +pub trait ManualClusterHandle: NodeControlHandle + ClusterWaitHandle {} diff --git a/testing-framework/deployers/local/src/manual/mod.rs b/testing-framework/deployers/local/src/manual/mod.rs index 36a4019..028a690 100644 --- a/testing-framework/deployers/local/src/manual/mod.rs +++ b/testing-framework/deployers/local/src/manual/mod.rs @@ -1,8 +1,8 @@ use testing_framework_core::{ manual::ManualClusterHandle, scenario::{ - DynError, ExternalNodeSource, NodeClients, NodeControlHandle, ReadinessError, - StartNodeOptions, StartedNode, + ClusterWaitHandle, DynError, ExternalNodeSource, NodeClients, NodeControlHandle, + ReadinessError, StartNodeOptions, StartedNode, }, }; use thiserror::Error; @@ -157,19 +157,11 @@ impl NodeControlHandle for ManualCluster { } #[async_trait::async_trait] -impl ManualClusterHandle for ManualCluster { - async fn start_node_with( - &self, - name: &str, - options: StartNodeOptions, - ) -> Result, DynError> { - self.nodes - .start_node_with(name, options) - .await - .map_err(|err| err.into()) - } - +impl ClusterWaitHandle for ManualCluster { async fn wait_network_ready(&self) -> Result<(), DynError> { self.wait_network_ready().await.map_err(|err| err.into()) } } + +#[async_trait::async_trait] +impl ManualClusterHandle for ManualCluster {}