Skip to main content

StepDef

Enum StepDef 

Source
pub enum StepDef {
    Add {
        service: String,
        args: Option<String>,
        env: BTreeMap<String, String>,
        timeout: u64,
    },
    Remove {
        service: String,
    },
    Wait {
        service: String,
        timeout: u64,
    },
    Shell {
        name: String,
        run: String,
        timeout: u64,
        poll: Option<PollConfig>,
    },
    Http {
        name: Option<String>,
        url: String,
        method: HttpMethod,
        body: Option<String>,
        content_type: String,
        headers: BTreeMap<String, String>,
        status: u16,
        service: Option<String>,
        poll: Option<PollConfig>,
        timeout: u64,
    },
    Playwright {
        name: Option<String>,
        spec: String,
        env: BTreeMap<String, String>,
        timeout: u64,
    },
    Mail {
        name: Option<String>,
        mailbox: String,
        contains: Option<String>,
        poll: PollConfig,
        timeout: u64,
    },
}
Expand description

A lifecycle test step — serde deserializes directly into the correct variant based on the action field. Invalid field combinations are rejected at parse time rather than runtime.

Variants§

§

Add

Fields

§service: String
§timeout: u64
§

Remove

Fields

§service: String
§

Wait

Fields

§service: String
§timeout: u64
§

Shell

Shell command step. Fails the test on non-zero exit code.

Fields

§name: String
§timeout: u64
§poll: Option<PollConfig>

Optional retry configuration. When set, the runner re-executes the command on failure, up to attempts times.

§

Http

HTTP request step. Sends a request and checks the response status code. The URL supports shell variable expansion (e.g., $SERVICE_PORT_HTTP) after sourcing service .env files. Follows redirects automatically.

Fields

§method: HttpMethod
§body: Option<String>

Request body for POST/PUT. Shell heredoc-safe: arbitrary bytes are supported including quotes and newlines.

§content_type: String

Content-Type header for requests with a body. Defaults to application/json since most API triggers we use ship JSON.

§headers: BTreeMap<String, String>

Extra request headers (e.g., apikey, Authorization). Values support shell variable expansion after .env sourcing.

§status: u16
§service: Option<String>

When set, only source this service’s .env file (needed when multiple services define the same port variable).

§timeout: u64
§

Playwright

Playwright browser test step.

Fields

§spec: String
§timeout: u64
§

Mail

Inbucket mail-delivery assertion. Polls inbucket’s /api/v1/mailbox/ <mailbox> endpoint until a non-empty response arrives; when contains is set, additionally requires that substring in the raw JSON body. Collapses the 8-line port-discovery + curl-poll pattern that previously lived in every SMTP test into one step.

Fields

§mailbox: String

Local-part of the recipient address (smtptest for smtptest@example.com).

§contains: Option<String>

Optional substring required in the response body. Matches against the raw inbucket JSON, which includes subject + body.

§poll: PollConfig

Retry config. Defaults favour short SMTP mail delivery; apps with async mail queues (twenty, supabase) should widen these.

§timeout: u64

Implementations§

Source§

impl StepDef

Source

pub fn service(&self) -> Option<&str>

The service name referenced by this step, if any.

Source

pub fn is_setup(&self) -> bool

Whether this step is a setup step (vs. a test/assertion step). Used by --retest to skip setup and only re-run test steps.

Source

pub fn step_name(&self) -> String

Human-readable name for this step (used in output).

Source

pub fn describe(&self) -> Vec<String>

Multi-line description for --list -v. Shows every field that meaningfully changes behaviour (args, env, headers, body, …). The caller indents each returned line.

Trait Implementations§

Source§

impl Clone for StepDef

Source§

fn clone(&self) -> StepDef

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StepDef

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for StepDef

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for StepDef

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V