pub struct TestRun {Show 14 fields
pub id: Uuid,
pub suite_id: Uuid,
pub org_id: Uuid,
pub kind: String,
pub triggered_by: String,
pub triggered_by_user: Option<Uuid>,
pub status: String,
pub queued_at: DateTime<Utc>,
pub started_at: Option<DateTime<Utc>>,
pub finished_at: Option<DateTime<Utc>>,
pub runner_seconds: Option<i32>,
pub summary: Option<Value>,
pub git_ref: Option<String>,
pub git_sha: Option<String>,
}Fields§
§id: Uuid§suite_id: UuidOwning resource id. For suite runs this is test_suites.id; for
chaos / flow / snapshot / contract / replay / clone runs it points
at the matching domain table — kind says which.
org_id: Uuid§kind: StringWhat sort of run this is. Mirrors the kind vocabulary in
test_suites plus the cross-task additions documented in migration
20250101000059_test_execution.sql.
triggered_by: String§triggered_by_user: Option<Uuid>§status: String§queued_at: DateTime<Utc>§started_at: Option<DateTime<Utc>>§finished_at: Option<DateTime<Utc>>§runner_seconds: Option<i32>§summary: Option<Value>§git_ref: Option<String>§git_sha: Option<String>Implementations§
Source§impl TestRun
impl TestRun
Sourcepub async fn enqueue(
pool: &Pool<Postgres>,
input: EnqueueTestRun<'_>,
) -> Result<TestRun, Error>
pub async fn enqueue( pool: &Pool<Postgres>, input: EnqueueTestRun<'_>, ) -> Result<TestRun, Error>
Insert a new run in queued status.
pub async fn find_by_id( pool: &Pool<Postgres>, id: Uuid, ) -> Result<Option<TestRun>, Error>
Sourcepub async fn list_by_suite(
pool: &Pool<Postgres>,
suite_id: Uuid,
limit: i64,
) -> Result<Vec<TestRun>, Error>
pub async fn list_by_suite( pool: &Pool<Postgres>, suite_id: Uuid, limit: i64, ) -> Result<Vec<TestRun>, Error>
Recent runs of a suite, newest first.
Sourcepub async fn list_by_org(
pool: &Pool<Postgres>,
org_id: Uuid,
status_filter: Option<&str>,
limit: i64,
) -> Result<Vec<TestRun>, Error>
pub async fn list_by_org( pool: &Pool<Postgres>, org_id: Uuid, status_filter: Option<&str>, limit: i64, ) -> Result<Vec<TestRun>, Error>
Cross-suite list for an org. Used by the global “all runs” dashboard.
Sourcepub async fn count_inflight(
pool: &Pool<Postgres>,
org_id: Uuid,
) -> Result<InflightRuns, Error>
pub async fn count_inflight( pool: &Pool<Postgres>, org_id: Uuid, ) -> Result<InflightRuns, Error>
How many runs are queued + running for this org? Used by the concurrency-cap check (max_concurrent_runs plan limit) before admitting a new run.
Sourcepub async fn mark_running(
pool: &Pool<Postgres>,
id: Uuid,
) -> Result<Option<TestRun>, Error>
pub async fn mark_running( pool: &Pool<Postgres>, id: Uuid, ) -> Result<Option<TestRun>, Error>
Worker-callback transition to running. Idempotent: only
transitions when current status is queued, otherwise no-op.
Sourcepub async fn mark_finished(
pool: &Pool<Postgres>,
id: Uuid,
status: &str,
runner_seconds: i32,
summary: Option<&Value>,
) -> Result<Option<TestRun>, Error>
pub async fn mark_finished( pool: &Pool<Postgres>, id: Uuid, status: &str, runner_seconds: i32, summary: Option<&Value>, ) -> Result<Option<TestRun>, Error>
Worker-callback transition to a terminal status. Idempotent on the
terminal: a row already in passed/failed/cancelled/errored is not
changed.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TestRun
impl<'de> Deserialize<'de> for TestRun
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TestRun, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TestRun, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl<'a, R> FromRow<'a, R> for TestRunwhere
R: Row,
&'a str: ColumnIndex<R>,
Uuid: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
String: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Option<Uuid>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
DateTime<Utc>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Option<DateTime<Utc>>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Option<i32>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Option<Value>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Option<String>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
impl<'a, R> FromRow<'a, R> for TestRunwhere
R: Row,
&'a str: ColumnIndex<R>,
Uuid: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
String: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Option<Uuid>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
DateTime<Utc>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Option<DateTime<Utc>>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Option<i32>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Option<Value>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Option<String>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Source§impl Serialize for TestRun
impl Serialize for TestRun
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for TestRun
impl RefUnwindSafe for TestRun
impl Send for TestRun
impl Sync for TestRun
impl Unpin for TestRun
impl UnsafeUnpin for TestRun
impl UnwindSafe for TestRun
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more