From a5230242797380bacaf6263e12b5dadb5aa754ee Mon Sep 17 00:00:00 2001 From: andrussal Date: Sun, 8 Mar 2026 14:08:42 +0100 Subject: [PATCH] Hide raw source types behind semantic scenario API --- testing-framework/core/src/scenario/definition.rs | 15 +++++++++++++++ testing-framework/core/src/scenario/mod.rs | 4 ++-- .../core/src/scenario/sources/mod.rs | 4 ++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/testing-framework/core/src/scenario/definition.rs b/testing-framework/core/src/scenario/definition.rs index 83ebed1..fe6dad3 100644 --- a/testing-framework/core/src/scenario/definition.rs +++ b/testing-framework/core/src/scenario/definition.rs @@ -139,6 +139,21 @@ impl Scenario { self.sources.external_nodes() } + #[must_use] + pub const fn is_managed(&self) -> bool { + self.sources.is_managed() + } + + #[must_use] + pub const fn is_external_only(&self) -> bool { + self.sources.is_external_only() + } + + #[must_use] + pub fn has_external_nodes(&self) -> bool { + !self.sources.external_nodes().is_empty() + } + #[must_use] pub const fn source_orchestration_plan(&self) -> &SourceOrchestrationPlan { &self.source_orchestration_plan diff --git a/testing-framework/core/src/scenario/mod.rs b/testing-framework/core/src/scenario/mod.rs index 37dc1ef..5fcd013 100644 --- a/testing-framework/core/src/scenario/mod.rs +++ b/testing-framework/core/src/scenario/mod.rs @@ -52,8 +52,8 @@ pub use runtime::{ wait_http_readiness, wait_until_stable, }; #[doc(hidden)] -pub use sources::AttachSource; -pub use sources::{ExistingCluster, ExternalNodeSource, ScenarioSources}; +pub use sources::{AttachSource, ScenarioSources}; +pub use sources::{ExistingCluster, ExternalNodeSource}; pub use workload::Workload; pub use crate::env::Application; diff --git a/testing-framework/core/src/scenario/sources/mod.rs b/testing-framework/core/src/scenario/sources/mod.rs index 26075f2..15ddbf0 100644 --- a/testing-framework/core/src/scenario/sources/mod.rs +++ b/testing-framework/core/src/scenario/sources/mod.rs @@ -1,5 +1,5 @@ mod model; #[doc(hidden)] -pub use model::AttachSource; -pub use model::{ExistingCluster, ExternalNodeSource, ScenarioSources}; +pub use model::{AttachSource, ScenarioSources}; +pub use model::{ExistingCluster, ExternalNodeSource};