Skip to main content

camel_integration_test/
lib.rs

1//! Integration-tier test support for rust-camel (ADR-0069).
2//!
3//! This crate owns the scenario model: the parsing of `.test.yaml`
4//! documents that declare a `scenario:` section, the ordered action
5//! vocabulary (`send`, `receive`, `sleep`, `validate`), endpoint
6//! references with partner provisioning, and the document-level rules
7//! that keep the scenario vocabulary separate from the unit-tier
8//! vocabulary (`inputs`, `expects`, `intercepts`).
9//!
10//! The tier derivation, the layered environment source, the action
11//! runner, and the partner adapters are built on the model types
12//! defined here.
13//!
14//! The system under test is always an embedded boot. The harness never
15//! drives a deployed `camel run` process.
16
17pub mod adapters;
18pub mod boot_scenario;
19pub mod document;
20pub mod env_layers;
21pub mod runner;
22pub mod tier;
23
24/// Partner-script grammar of the scenario document's `partners:` map;
25/// its public types are re-exported through [`crate::document`].
26mod partner_script;
27
28#[cfg(feature = "http")]
29pub use adapters::http::{HttpPartner, HttpRecorder, HttpWireRequest, ScriptedResponse};
30pub use adapters::{
31    DirectStimulus, FakeAdapter, FakeRecorder, IncomingMessage, OutgoingMessage, PartnerAdapter,
32    PartnerRouter, ReceiveError, ReceiveTimeout, RecordedSend, TransportError,
33};
34pub use boot_scenario::{ScenarioRun, boot_scenario};
35#[cfg(feature = "http")]
36pub use document::partner_scripts_for;
37pub use document::{
38    CountBound, DocError, EndpointRef, Expectation, PartnerExpectation, PartnerFault,
39    PartnerScript, PartnerScriptResponse, PathFilter, Provisioning, RouteSource, ScenarioAction,
40    ScenarioDocument, ScenarioTarget, ValidateExpectation, parse_scenario_document,
41};
42pub use env_layers::{AmbientLookup, LayeredEnv, ambient_std};
43pub use runner::{
44    DocumentOutcome, ScenarioFailure, ScenarioVars, ScenarioVerdict, run_scenario,
45    run_scenario_document,
46};
47pub use tier::{DocumentInputs, Tier, derive_tier};
48
49/// Scenario document parser contract tests (the six named tests from
50/// the task brief plus the validate and regex-gate tests).
51#[cfg(test)]
52mod doc_parse_test;
53
54/// Layered environment tests (the three named tests from task 2.3).
55#[cfg(test)]
56mod env_layers_test;
57
58/// Scenario action runner tests (the four named tests from task 2.4).
59#[cfg(test)]
60mod runner_test;
61
62/// boot_scenario delegation tests (the six named tests from task 3.1,
63/// scenario-shared-boot).
64#[cfg(test)]
65mod boot_scenario_test;
66
67/// Partner router address-math tests (the pure wire_target /
68/// lane_key_for cases).
69#[cfg(test)]
70mod adapters_test;
71
72/// HTTP partner adapter tests (the named tests from task 3.1).
73#[cfg(all(test, feature = "http"))]
74mod http_partner_test;