diff --git a/logos/runtime/ext/src/scenario/mod.rs b/logos/runtime/ext/src/scenario/mod.rs index 50c976d..564e46c 100644 --- a/logos/runtime/ext/src/scenario/mod.rs +++ b/logos/runtime/ext/src/scenario/mod.rs @@ -9,7 +9,7 @@ use lb_framework::{ }; pub use testing_framework_core::scenario::ObservabilityBuilderExt; use testing_framework_core::{ - scenario::{NodeControlScenarioBuilder, ObservabilityScenarioBuilder}, + scenario::internal::{NodeControlScenarioBuilder, ObservabilityScenarioBuilder}, topology::{DeploymentProvider, DeploymentSeed, DynTopologyError}, }; use tracing::warn; @@ -18,7 +18,7 @@ use crate::LbcExtEnv; pub type ScenarioBuilder = testing_framework_core::scenario::ScenarioBuilder; pub type ScenarioBuilderWith = - testing_framework_core::scenario::CoreBuilder; + testing_framework_core::scenario::internal::CoreBuilder; pub trait CoreBuilderExt: Sized { fn deployment_with(f: impl FnOnce(DeploymentBuilder) -> DeploymentBuilder) -> Self; diff --git a/testing-framework/core/src/scenario/builder_ext.rs b/testing-framework/core/src/scenario/builder_ext.rs index b771c2e..f5003b7 100644 --- a/testing-framework/core/src/scenario/builder_ext.rs +++ b/testing-framework/core/src/scenario/builder_ext.rs @@ -1,6 +1,8 @@ use reqwest::Url; -use super::{Application, ObservabilityCapability, ObservabilityScenarioBuilder, ScenarioBuilder}; +use super::{ + Application, ObservabilityCapability, ScenarioBuilder, internal::ObservabilityScenarioBuilder, +}; const METRICS_QUERY_URL_FIELD: &str = "metrics_query_url"; const METRICS_OTLP_INGEST_URL_FIELD: &str = "metrics_otlp_ingest_url"; diff --git a/testing-framework/core/src/scenario/common_builder_ext.rs b/testing-framework/core/src/scenario/common_builder_ext.rs index 76b7f49..f0842c3 100644 --- a/testing-framework/core/src/scenario/common_builder_ext.rs +++ b/testing-framework/core/src/scenario/common_builder_ext.rs @@ -1,8 +1,8 @@ use std::time::Duration; use super::{ - Application, CleanupPolicy, CoreBuilderAccess, DeploymentPolicy, Expectation, - HttpReadinessRequirement, RetryPolicy, Workload, + Application, CleanupPolicy, DeploymentPolicy, Expectation, HttpReadinessRequirement, + RetryPolicy, Workload, internal::CoreBuilderAccess, }; use crate::topology::{DeploymentProvider, DeploymentSeed}; diff --git a/testing-framework/core/src/scenario/internal.rs b/testing-framework/core/src/scenario/internal.rs new file mode 100644 index 0000000..deeb2dd --- /dev/null +++ b/testing-framework/core/src/scenario/internal.rs @@ -0,0 +1,13 @@ +#[doc(hidden)] +pub use super::builder_ops::CoreBuilderAccess; +#[doc(hidden)] +pub use super::definition::{ + Builder as CoreBuilder, NodeControlScenarioBuilder, ObservabilityScenarioBuilder, +}; +#[doc(hidden)] +pub use super::runtime::{ + ApplicationExternalProvider, AttachProvider, AttachProviderError, AttachedNode, CleanupGuard, + FeedHandle, ManagedSource, RuntimeAssembly, SourceOrchestrationPlan, SourceProviders, + StaticManagedProvider, build_source_orchestration_plan, orchestrate_sources, + orchestrate_sources_with_providers, resolve_sources, +}; diff --git a/testing-framework/core/src/scenario/mod.rs b/testing-framework/core/src/scenario/mod.rs index 4089111..52306de 100644 --- a/testing-framework/core/src/scenario/mod.rs +++ b/testing-framework/core/src/scenario/mod.rs @@ -10,6 +10,7 @@ mod control; mod definition; mod deployment_policy; mod expectation; +pub mod internal; mod observability; mod runtime; mod sources; @@ -18,31 +19,16 @@ mod workload; pub type DynError = Box; pub use builder_ext::{BuilderInputError, ObservabilityBuilderExt}; -#[doc(hidden)] -pub use builder_ops::CoreBuilderAccess; pub use capabilities::{ NodeControlCapability, ObservabilityCapability, PeerSelection, RequiresNodeControl, StartNodeOptions, StartedNode, }; pub use common_builder_ext::CoreBuilderExt; pub use control::{ClusterWaitHandle, NodeControlHandle}; -#[doc(hidden)] -pub use definition::{ - Builder as CoreBuilder, // internal adapter-facing core builder - NodeControlScenarioBuilder, - ObservabilityScenarioBuilder, -}; pub use definition::{Scenario, ScenarioBuildError, ScenarioBuilder}; pub use deployment_policy::{CleanupPolicy, DeploymentPolicy, RetryPolicy}; pub use expectation::Expectation; pub use observability::{ObservabilityCapabilityProvider, ObservabilityInputs}; -#[doc(hidden)] -pub use runtime::{ - ApplicationExternalProvider, AttachProvider, AttachProviderError, AttachedNode, CleanupGuard, - FeedHandle, ManagedSource, RuntimeAssembly, SourceOrchestrationPlan, SourceProviders, - StaticManagedProvider, build_source_orchestration_plan, orchestrate_sources, - orchestrate_sources_with_providers, resolve_sources, -}; pub use runtime::{ Deployer, Feed, FeedRuntime, HttpReadinessRequirement, NodeClients, ReadinessError, RunContext, RunHandle, RunMetrics, Runner, ScenarioError, StabilizationConfig, diff --git a/testing-framework/core/src/workloads/chaos.rs b/testing-framework/core/src/workloads/chaos.rs index 38fba98..6c6be9b 100644 --- a/testing-framework/core/src/workloads/chaos.rs +++ b/testing-framework/core/src/workloads/chaos.rs @@ -5,7 +5,9 @@ use rand::{Rng as _, seq::SliceRandom as _, thread_rng}; use tokio::time::{Instant, sleep}; use crate::{ - scenario::{Application, CoreBuilder, DynError, NodeControlCapability, RunContext, Workload}, + scenario::{ + Application, DynError, NodeControlCapability, RunContext, Workload, internal::CoreBuilder, + }, topology::DeploymentDescriptor, }; diff --git a/testing-framework/deployers/compose/src/deployer/attach_provider.rs b/testing-framework/deployers/compose/src/deployer/attach_provider.rs index 24c16d6..2b35207 100644 --- a/testing-framework/deployers/compose/src/deployer/attach_provider.rs +++ b/testing-framework/deployers/compose/src/deployer/attach_provider.rs @@ -2,8 +2,9 @@ use std::marker::PhantomData; use async_trait::async_trait; use testing_framework_core::scenario::{ - AttachProvider, AttachProviderError, AttachedNode, ClusterWaitHandle, DynError, - ExistingCluster, ExternalNodeSource, HttpReadinessRequirement, wait_http_readiness, + ClusterWaitHandle, DynError, ExistingCluster, ExternalNodeSource, HttpReadinessRequirement, + internal::{AttachProvider, AttachProviderError, AttachedNode}, + wait_http_readiness, }; use url::Url; diff --git a/testing-framework/deployers/compose/src/deployer/clients.rs b/testing-framework/deployers/compose/src/deployer/clients.rs index 665acc3..0574391 100644 --- a/testing-framework/deployers/compose/src/deployer/clients.rs +++ b/testing-framework/deployers/compose/src/deployer/clients.rs @@ -1,6 +1,8 @@ use std::{fmt::Debug, marker::PhantomData}; -use testing_framework_core::scenario::{Application, FeedHandle, FeedRuntime, NodeClients}; +use testing_framework_core::scenario::{ + Application, FeedRuntime, NodeClients, internal::FeedHandle, +}; use tracing::{info, warn}; use crate::{ diff --git a/testing-framework/deployers/compose/src/deployer/mod.rs b/testing-framework/deployers/compose/src/deployer/mod.rs index 9771a9a..3624563 100644 --- a/testing-framework/deployers/compose/src/deployer/mod.rs +++ b/testing-framework/deployers/compose/src/deployer/mod.rs @@ -9,8 +9,9 @@ use std::marker::PhantomData; use async_trait::async_trait; use testing_framework_core::scenario::{ - CleanupGuard, Deployer, DynError, ExistingCluster, FeedHandle, IntoExistingCluster, - ObservabilityCapabilityProvider, RequiresNodeControl, Runner, Scenario, + Deployer, DynError, ExistingCluster, IntoExistingCluster, ObservabilityCapabilityProvider, + RequiresNodeControl, Runner, Scenario, + internal::{CleanupGuard, FeedHandle}, }; use crate::{env::ComposeDeployEnv, errors::ComposeRunnerError, lifecycle::cleanup::RunnerCleanup}; diff --git a/testing-framework/deployers/compose/src/deployer/orchestrator.rs b/testing-framework/deployers/compose/src/deployer/orchestrator.rs index 452867a..3c43961 100644 --- a/testing-framework/deployers/compose/src/deployer/orchestrator.rs +++ b/testing-framework/deployers/compose/src/deployer/orchestrator.rs @@ -3,12 +3,15 @@ use std::{env, sync::Arc, time::Duration}; use reqwest::Url; use testing_framework_core::{ scenario::{ - Application, ApplicationExternalProvider, CleanupGuard, ClusterControlProfile, ClusterMode, - ClusterWaitHandle, DeploymentPolicy, DynError, ExistingCluster, FeedHandle, FeedRuntime, - HttpReadinessRequirement, Metrics, NodeClients, NodeControlHandle, - ObservabilityCapabilityProvider, ObservabilityInputs, RequiresNodeControl, Runner, - RuntimeAssembly, Scenario, SourceOrchestrationPlan, SourceProviders, StaticManagedProvider, - build_source_orchestration_plan, orchestrate_sources_with_providers, + Application, ClusterControlProfile, ClusterMode, ClusterWaitHandle, DeploymentPolicy, + DynError, ExistingCluster, FeedRuntime, HttpReadinessRequirement, Metrics, NodeClients, + NodeControlHandle, ObservabilityCapabilityProvider, ObservabilityInputs, + RequiresNodeControl, Runner, Scenario, + internal::{ + ApplicationExternalProvider, CleanupGuard, FeedHandle, RuntimeAssembly, + SourceOrchestrationPlan, SourceProviders, StaticManagedProvider, + build_source_orchestration_plan, orchestrate_sources_with_providers, + }, }, topology::DeploymentDescriptor, }; diff --git a/testing-framework/deployers/compose/src/infrastructure/environment.rs b/testing-framework/deployers/compose/src/infrastructure/environment.rs index 2c98c50..b4bb6bd 100644 --- a/testing-framework/deployers/compose/src/infrastructure/environment.rs +++ b/testing-framework/deployers/compose/src/infrastructure/environment.rs @@ -6,7 +6,7 @@ use std::{ use anyhow::anyhow; use reqwest::Url; -use testing_framework_core::{scenario::CleanupGuard, topology::DeploymentDescriptor}; +use testing_framework_core::{scenario::internal::CleanupGuard, topology::DeploymentDescriptor}; use tokio::{net::TcpStream, process::Command}; use tokio_retry::{Retry, strategy::FixedInterval}; use tracing::{debug, error, info, warn}; diff --git a/testing-framework/deployers/compose/src/lifecycle/block_feed.rs b/testing-framework/deployers/compose/src/lifecycle/block_feed.rs index ff72aae..a16dd84 100644 --- a/testing-framework/deployers/compose/src/lifecycle/block_feed.rs +++ b/testing-framework/deployers/compose/src/lifecycle/block_feed.rs @@ -1,7 +1,7 @@ use std::time::Duration; use testing_framework_core::scenario::{ - Application, FeedHandle, FeedRuntime, NodeClients, spawn_feed, + Application, FeedRuntime, NodeClients, internal::FeedHandle, spawn_feed, }; use tokio::time::sleep; use tracing::{debug, info, warn}; diff --git a/testing-framework/deployers/compose/src/lifecycle/cleanup.rs b/testing-framework/deployers/compose/src/lifecycle/cleanup.rs index 33e9cdc..2a640a2 100644 --- a/testing-framework/deployers/compose/src/lifecycle/cleanup.rs +++ b/testing-framework/deployers/compose/src/lifecycle/cleanup.rs @@ -4,7 +4,7 @@ use std::{ thread, }; -use testing_framework_core::scenario::CleanupGuard; +use testing_framework_core::scenario::internal::CleanupGuard; use tracing::{debug, info, warn}; use crate::{ diff --git a/testing-framework/deployers/k8s/src/deployer/attach_provider.rs b/testing-framework/deployers/k8s/src/deployer/attach_provider.rs index bdfa1fe..dbc1bcc 100644 --- a/testing-framework/deployers/k8s/src/deployer/attach_provider.rs +++ b/testing-framework/deployers/k8s/src/deployer/attach_provider.rs @@ -7,8 +7,9 @@ use kube::{ api::{ListParams, ObjectList}, }; use testing_framework_core::scenario::{ - AttachProvider, AttachProviderError, AttachedNode, ClusterWaitHandle, DynError, - ExistingCluster, ExternalNodeSource, HttpReadinessRequirement, wait_http_readiness, + ClusterWaitHandle, DynError, ExistingCluster, ExternalNodeSource, HttpReadinessRequirement, + internal::{AttachProvider, AttachProviderError, AttachedNode}, + wait_http_readiness, }; use url::Url; diff --git a/testing-framework/deployers/k8s/src/deployer/orchestrator.rs b/testing-framework/deployers/k8s/src/deployer/orchestrator.rs index 83ba257..279f035 100644 --- a/testing-framework/deployers/k8s/src/deployer/orchestrator.rs +++ b/testing-framework/deployers/k8s/src/deployer/orchestrator.rs @@ -5,12 +5,15 @@ use kube::Client; use reqwest::Url; use testing_framework_core::{ scenario::{ - Application, ApplicationExternalProvider, CleanupGuard, ClusterControlProfile, ClusterMode, - ClusterWaitHandle, Deployer, DynError, ExistingCluster, FeedHandle, FeedRuntime, - HttpReadinessRequirement, Metrics, MetricsError, NodeClients, + Application, ClusterControlProfile, ClusterMode, ClusterWaitHandle, Deployer, DynError, + ExistingCluster, FeedRuntime, HttpReadinessRequirement, Metrics, MetricsError, NodeClients, ObservabilityCapabilityProvider, ObservabilityInputs, RequiresNodeControl, Runner, - RuntimeAssembly, Scenario, SourceOrchestrationPlan, SourceProviders, StaticManagedProvider, - build_source_orchestration_plan, orchestrate_sources_with_providers, + Scenario, + internal::{ + ApplicationExternalProvider, CleanupGuard, FeedHandle, RuntimeAssembly, + SourceOrchestrationPlan, SourceProviders, StaticManagedProvider, + build_source_orchestration_plan, orchestrate_sources_with_providers, + }, }, topology::DeploymentDescriptor, }; diff --git a/testing-framework/deployers/k8s/src/infrastructure/cluster.rs b/testing-framework/deployers/k8s/src/infrastructure/cluster.rs index fa3ee24..66574d4 100644 --- a/testing-framework/deployers/k8s/src/infrastructure/cluster.rs +++ b/testing-framework/deployers/k8s/src/infrastructure/cluster.rs @@ -1,7 +1,7 @@ use kube::Client; use reqwest::Url; use testing_framework_core::scenario::{ - CleanupGuard, DynError, HttpReadinessRequirement, NodeClients, + DynError, HttpReadinessRequirement, NodeClients, internal::CleanupGuard, }; use tracing::{debug, info}; use url::ParseError; diff --git a/testing-framework/deployers/k8s/src/lifecycle/block_feed.rs b/testing-framework/deployers/k8s/src/lifecycle/block_feed.rs index d50351e..527a285 100644 --- a/testing-framework/deployers/k8s/src/lifecycle/block_feed.rs +++ b/testing-framework/deployers/k8s/src/lifecycle/block_feed.rs @@ -1,5 +1,5 @@ use testing_framework_core::scenario::{ - Application, FeedHandle, FeedRuntime, NodeClients, spawn_feed, + Application, FeedRuntime, NodeClients, internal::FeedHandle, spawn_feed, }; use tracing::{debug, info}; diff --git a/testing-framework/deployers/k8s/src/lifecycle/cleanup.rs b/testing-framework/deployers/k8s/src/lifecycle/cleanup.rs index 6d64ebe..71c86ae 100644 --- a/testing-framework/deployers/k8s/src/lifecycle/cleanup.rs +++ b/testing-framework/deployers/k8s/src/lifecycle/cleanup.rs @@ -2,7 +2,7 @@ use std::{io, process::Output, thread}; use k8s_openapi::api::core::v1::Namespace; use kube::{Api, Client, api::DeleteParams}; -use testing_framework_core::scenario::CleanupGuard; +use testing_framework_core::scenario::internal::CleanupGuard; use tokio::{ process::Command, runtime::{Handle, Runtime}, diff --git a/testing-framework/deployers/local/src/deployer/orchestrator.rs b/testing-framework/deployers/local/src/deployer/orchestrator.rs index 5af3d2e..c17f54f 100644 --- a/testing-framework/deployers/local/src/deployer/orchestrator.rs +++ b/testing-framework/deployers/local/src/deployer/orchestrator.rs @@ -10,10 +10,14 @@ use std::{ use async_trait::async_trait; use testing_framework_core::{ scenario::{ - Application, CleanupGuard, ClusterControlProfile, ClusterMode, Deployer, DeploymentPolicy, - DynError, FeedHandle, FeedRuntime, HttpReadinessRequirement, Metrics, NodeClients, - NodeControlCapability, NodeControlHandle, RetryPolicy, Runner, RuntimeAssembly, Scenario, - ScenarioError, SourceOrchestrationPlan, build_source_orchestration_plan, spawn_feed, + Application, ClusterControlProfile, ClusterMode, Deployer, DeploymentPolicy, DynError, + FeedRuntime, HttpReadinessRequirement, Metrics, NodeClients, NodeControlCapability, + NodeControlHandle, RetryPolicy, Runner, Scenario, ScenarioError, + internal::{ + CleanupGuard, FeedHandle, RuntimeAssembly, SourceOrchestrationPlan, + build_source_orchestration_plan, + }, + spawn_feed, }, topology::DeploymentDescriptor, };