From 3ea3fffd1f2e11291bcb061719e48249e40d3d23 Mon Sep 17 00:00:00 2001 From: andrussal Date: Sun, 8 Mar 2026 13:45:39 +0100 Subject: [PATCH] Drop unused source readiness policy --- .../core/src/scenario/definition.rs | 43 +------------------ testing-framework/core/src/scenario/mod.rs | 2 +- .../source_orchestration_plan.rs | 16 +++---- .../runtime/orchestration/source_resolver.rs | 5 +-- .../core/src/scenario/sources/mod.rs | 2 +- .../core/src/scenario/sources/model.rs | 13 ------ 6 files changed, 10 insertions(+), 71 deletions(-) diff --git a/testing-framework/core/src/scenario/definition.rs b/testing-framework/core/src/scenario/definition.rs index f656a98..b16b6a7 100644 --- a/testing-framework/core/src/scenario/definition.rs +++ b/testing-framework/core/src/scenario/definition.rs @@ -6,7 +6,6 @@ use tracing::{debug, info}; use super::{ Application, AttachSource, DeploymentPolicy, DynError, ExternalNodeSource, HttpReadinessRequirement, NodeControlCapability, ObservabilityCapability, ScenarioSources, - SourceReadinessPolicy, builder_ops::CoreBuilderAccess, expectation::Expectation, runtime::{ @@ -44,7 +43,6 @@ pub struct Scenario { expectation_cooldown: Duration, deployment_policy: DeploymentPolicy, sources: ScenarioSources, - source_readiness_policy: SourceReadinessPolicy, source_orchestration_plan: SourceOrchestrationPlan, capabilities: Caps, } @@ -58,7 +56,6 @@ impl Scenario { expectation_cooldown: Duration, deployment_policy: DeploymentPolicy, sources: ScenarioSources, - source_readiness_policy: SourceReadinessPolicy, source_orchestration_plan: SourceOrchestrationPlan, capabilities: Caps, ) -> Self { @@ -70,7 +67,6 @@ impl Scenario { expectation_cooldown, deployment_policy, sources, - source_readiness_policy, source_orchestration_plan, capabilities, } @@ -116,15 +112,6 @@ impl Scenario { self.deployment_policy } - #[must_use] - /// Selected source readiness policy. - /// - /// This is currently reserved for future mixed-source orchestration and - /// does not change runtime behavior yet. - pub const fn source_readiness_policy(&self) -> SourceReadinessPolicy { - self.source_readiness_policy - } - #[must_use] pub fn sources(&self) -> &ScenarioSources { &self.sources @@ -151,7 +138,6 @@ pub struct Builder { expectation_cooldown: Option, deployment_policy: DeploymentPolicy, sources: ScenarioSources, - source_readiness_policy: SourceReadinessPolicy, capabilities: Caps, } @@ -256,11 +242,6 @@ macro_rules! impl_common_builder_methods { self.map_core_builder(|builder| builder.with_external_node(node)) } - #[must_use] - pub fn with_source_readiness_policy(self, policy: SourceReadinessPolicy) -> Self { - self.map_core_builder(|builder| builder.with_source_readiness_policy(policy)) - } - #[must_use] pub fn with_external_only_sources(self) -> Self { self.map_core_builder(|builder| builder.with_external_only_sources()) @@ -350,7 +331,6 @@ impl Builder { expectation_cooldown: None, deployment_policy: DeploymentPolicy::default(), sources: ScenarioSources::default(), - source_readiness_policy: SourceReadinessPolicy::default(), capabilities: Caps::default(), } } @@ -453,7 +433,6 @@ impl Builder { expectation_cooldown, deployment_policy, sources, - source_readiness_policy, .. } = self; @@ -466,7 +445,6 @@ impl Builder { expectation_cooldown, deployment_policy, sources, - source_readiness_policy, capabilities, } } @@ -579,16 +557,6 @@ impl Builder { self } - #[must_use] - /// Configure source readiness policy metadata. - /// - /// This is currently reserved for future mixed-source orchestration and - /// does not change runtime behavior yet. - pub fn with_source_readiness_policy(mut self, policy: SourceReadinessPolicy) -> Self { - self.source_readiness_policy = policy; - self - } - #[must_use] pub fn with_external_only_sources(mut self) -> Self { self.sources = self.sources.into_external_only(); @@ -612,8 +580,7 @@ impl Builder { let descriptors = parts.resolve_deployment()?; let run_plan = parts.run_plan(); let run_metrics = RunMetrics::new(run_plan.duration); - let source_orchestration_plan = - build_source_orchestration_plan(parts.sources(), parts.source_readiness_policy)?; + let source_orchestration_plan = build_source_orchestration_plan(parts.sources())?; initialize_components( &descriptors, @@ -640,7 +607,6 @@ impl Builder { run_plan.expectation_cooldown, parts.deployment_policy, parts.sources, - parts.source_readiness_policy, source_orchestration_plan, parts.capabilities, )) @@ -661,7 +627,6 @@ struct BuilderParts { expectation_cooldown: Option, deployment_policy: DeploymentPolicy, sources: ScenarioSources, - source_readiness_policy: SourceReadinessPolicy, capabilities: Caps, } @@ -676,7 +641,6 @@ impl BuilderParts { expectation_cooldown, deployment_policy, sources, - source_readiness_policy, capabilities, .. } = builder; @@ -690,7 +654,6 @@ impl BuilderParts { expectation_cooldown, deployment_policy, sources, - source_readiness_policy, capabilities, } } @@ -715,10 +678,8 @@ impl BuilderParts { fn build_source_orchestration_plan( sources: &ScenarioSources, - readiness_policy: SourceReadinessPolicy, ) -> Result { - SourceOrchestrationPlan::try_from_sources(sources, readiness_policy) - .map_err(source_plan_error_to_build_error) + SourceOrchestrationPlan::try_from_sources(sources).map_err(source_plan_error_to_build_error) } fn source_plan_error_to_build_error(error: SourceOrchestrationPlanError) -> ScenarioBuildError { diff --git a/testing-framework/core/src/scenario/mod.rs b/testing-framework/core/src/scenario/mod.rs index cc3b300..8b570ad 100644 --- a/testing-framework/core/src/scenario/mod.rs +++ b/testing-framework/core/src/scenario/mod.rs @@ -51,7 +51,7 @@ pub use runtime::{ wait_for_http_ports_with_host_and_requirement, wait_for_http_ports_with_requirement, wait_http_readiness, wait_until_stable, }; -pub use sources::{AttachSource, ExternalNodeSource, ScenarioSources, SourceReadinessPolicy}; +pub use sources::{AttachSource, ExternalNodeSource, ScenarioSources}; pub use workload::Workload; pub use crate::env::Application; diff --git a/testing-framework/core/src/scenario/runtime/orchestration/source_orchestration_plan.rs b/testing-framework/core/src/scenario/runtime/orchestration/source_orchestration_plan.rs index ed72ae3..f1dd9b9 100644 --- a/testing-framework/core/src/scenario/runtime/orchestration/source_orchestration_plan.rs +++ b/testing-framework/core/src/scenario/runtime/orchestration/source_orchestration_plan.rs @@ -1,4 +1,4 @@ -use crate::scenario::{AttachSource, ExternalNodeSource, ScenarioSources, SourceReadinessPolicy}; +use crate::scenario::{AttachSource, ExternalNodeSource, ScenarioSources}; /// Explicit descriptor for managed node sourcing. #[derive(Clone, Copy, Debug, Eq, PartialEq)] @@ -33,7 +33,6 @@ pub(crate) enum SourceOrchestrationMode { #[derive(Clone, Debug, Eq, PartialEq)] pub struct SourceOrchestrationPlan { mode: SourceOrchestrationMode, - readiness_policy: SourceReadinessPolicy, } /// Validation failure while building orchestration plan from sources. @@ -46,14 +45,10 @@ pub enum SourceOrchestrationPlanError { impl SourceOrchestrationPlan { pub fn try_from_sources( sources: &ScenarioSources, - readiness_policy: SourceReadinessPolicy, ) -> Result { let mode = mode_from_sources(sources); - Ok(Self { - mode, - readiness_policy, - }) + Ok(Self { mode }) } #[must_use] @@ -74,14 +69,13 @@ impl SourceOrchestrationPlan { #[cfg(test)] mod tests { use super::{SourceOrchestrationMode, SourceOrchestrationPlan}; - use crate::scenario::{AttachSource, ScenarioSources, SourceReadinessPolicy}; + use crate::scenario::{AttachSource, ScenarioSources}; #[test] fn attached_sources_are_planned() { let sources = ScenarioSources::attached(AttachSource::compose(vec!["node-0".to_string()])); - let plan = - SourceOrchestrationPlan::try_from_sources(&sources, SourceReadinessPolicy::AllReady) - .expect("attached sources should build a source orchestration plan"); + let plan = SourceOrchestrationPlan::try_from_sources(&sources) + .expect("attached sources should build a source orchestration plan"); assert!(matches!( plan.mode(), 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 8ead379..ebf2d2d 100644 --- a/testing-framework/core/src/scenario/runtime/orchestration/source_resolver.rs +++ b/testing-framework/core/src/scenario/runtime/orchestration/source_resolver.rs @@ -41,10 +41,7 @@ pub enum SourceResolveError { pub fn build_source_orchestration_plan( scenario: &Scenario, ) -> Result { - SourceOrchestrationPlan::try_from_sources( - scenario.sources(), - scenario.source_readiness_policy(), - ) + SourceOrchestrationPlan::try_from_sources(scenario.sources()) } /// Resolves runtime source nodes via unified providers from orchestration plan. diff --git a/testing-framework/core/src/scenario/sources/mod.rs b/testing-framework/core/src/scenario/sources/mod.rs index 3585d8a..98324dd 100644 --- a/testing-framework/core/src/scenario/sources/mod.rs +++ b/testing-framework/core/src/scenario/sources/mod.rs @@ -1,3 +1,3 @@ mod model; -pub use model::{AttachSource, ExternalNodeSource, ScenarioSources, SourceReadinessPolicy}; +pub use model::{AttachSource, ExternalNodeSource, ScenarioSources}; diff --git a/testing-framework/core/src/scenario/sources/model.rs b/testing-framework/core/src/scenario/sources/model.rs index 84dc89f..98c60ad 100644 --- a/testing-framework/core/src/scenario/sources/model.rs +++ b/testing-framework/core/src/scenario/sources/model.rs @@ -70,19 +70,6 @@ impl ExternalNodeSource { } } -/// Planned readiness strategy for mixed managed/attached/external sources. -#[derive(Clone, Copy, Debug, Eq, PartialEq, Default)] -pub enum SourceReadinessPolicy { - /// Phase 1 default: require every known node to pass readiness checks. - #[default] - AllReady, - /// Optional relaxed policy for large/partial environments. - Quorum, - /// Future policy for per-source constraints (for example managed minimum - /// plus overall quorum). - SourceAware, -} - /// Source model that makes invalid managed+attached combinations /// unrepresentable by type. #[derive(Clone, Debug, Eq, PartialEq)]