From f79eb34a507d98034f0bef5e094e91e0d1feb4d5 Mon Sep 17 00:00:00 2001 From: andrussal Date: Sun, 8 Mar 2026 14:00:34 +0100 Subject: [PATCH] Hide raw scenario sources behind semantic accessors --- testing-framework/core/src/scenario/definition.rs | 6 ++++++ .../src/scenario/runtime/orchestration/source_resolver.rs | 2 +- .../deployers/compose/src/deployer/orchestrator.rs | 2 +- .../deployers/k8s/src/deployer/orchestrator.rs | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/testing-framework/core/src/scenario/definition.rs b/testing-framework/core/src/scenario/definition.rs index 9739141..56190db 100644 --- a/testing-framework/core/src/scenario/definition.rs +++ b/testing-framework/core/src/scenario/definition.rs @@ -113,6 +113,7 @@ impl Scenario { } #[must_use] + #[doc(hidden)] pub fn sources(&self) -> &ScenarioSources { &self.sources } @@ -122,6 +123,11 @@ impl Scenario { self.sources.existing_cluster() } + #[must_use] + pub const fn uses_existing_cluster(&self) -> bool { + self.sources.uses_existing_cluster() + } + #[must_use] #[doc(hidden)] pub fn attached_source(&self) -> Option<&AttachSource> { diff --git a/testing-framework/core/src/scenario/runtime/orchestration/source_resolver.rs b/testing-framework/core/src/scenario/runtime/orchestration/source_resolver.rs index ebf2d2d..d6f822b 100644 --- a/testing-framework/core/src/scenario/runtime/orchestration/source_resolver.rs +++ b/testing-framework/core/src/scenario/runtime/orchestration/source_resolver.rs @@ -41,7 +41,7 @@ pub enum SourceResolveError { pub fn build_source_orchestration_plan( scenario: &Scenario, ) -> Result { - SourceOrchestrationPlan::try_from_sources(scenario.sources()) + Ok(scenario.source_orchestration_plan().clone()) } /// Resolves runtime source nodes via unified providers from orchestration plan. diff --git a/testing-framework/deployers/compose/src/deployer/orchestrator.rs b/testing-framework/deployers/compose/src/deployer/orchestrator.rs index 9619e86..ef93c7f 100644 --- a/testing-framework/deployers/compose/src/deployer/orchestrator.rs +++ b/testing-framework/deployers/compose/src/deployer/orchestrator.rs @@ -71,7 +71,7 @@ impl DeploymentOrchestrator { } })?; - if scenario.sources().uses_existing_cluster() { + if scenario.uses_existing_cluster() { return self .deploy_attached_only::(scenario, source_plan) .await diff --git a/testing-framework/deployers/k8s/src/deployer/orchestrator.rs b/testing-framework/deployers/k8s/src/deployer/orchestrator.rs index a41e8d5..1565a40 100644 --- a/testing-framework/deployers/k8s/src/deployer/orchestrator.rs +++ b/testing-framework/deployers/k8s/src/deployer/orchestrator.rs @@ -179,7 +179,7 @@ where let observability = resolve_observability_inputs(scenario.capabilities())?; - if scenario.sources().uses_existing_cluster() { + if scenario.uses_existing_cluster() { let runner = deploy_attached_only::(scenario, source_plan, observability).await?; return Ok((runner, attached_metadata(scenario))); }