mirror of
https://github.com/logos-blockchain/logos-blockchain-testing.git
synced 2026-03-31 08:13:48 +00:00
Move scenario internals behind dedicated module
This commit is contained in:
parent
0f110ff755
commit
4fec05078f
@ -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<LbcExtEnv>;
|
||||
pub type ScenarioBuilderWith<Caps = ()> =
|
||||
testing_framework_core::scenario::CoreBuilder<LbcExtEnv, Caps>;
|
||||
testing_framework_core::scenario::internal::CoreBuilder<LbcExtEnv, Caps>;
|
||||
|
||||
pub trait CoreBuilderExt: Sized {
|
||||
fn deployment_with(f: impl FnOnce(DeploymentBuilder) -> DeploymentBuilder) -> Self;
|
||||
|
||||
@ -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";
|
||||
|
||||
@ -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};
|
||||
|
||||
|
||||
13
testing-framework/core/src/scenario/internal.rs
Normal file
13
testing-framework/core/src/scenario/internal.rs
Normal file
@ -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,
|
||||
};
|
||||
@ -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<dyn Error + Send + Sync + 'static>;
|
||||
|
||||
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,
|
||||
|
||||
@ -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,
|
||||
};
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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::{
|
||||
|
||||
@ -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};
|
||||
|
||||
@ -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,
|
||||
};
|
||||
|
||||
@ -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};
|
||||
|
||||
@ -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};
|
||||
|
||||
@ -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::{
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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,
|
||||
};
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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};
|
||||
|
||||
|
||||
@ -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},
|
||||
|
||||
@ -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,
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user