From d7404aa07435e0e5372f7b559ef82b9a3f81d1b6 Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Wed, 27 Sep 2023 17:17:48 +0530 Subject: [PATCH] feat: runner result types --- src/runner/results.rs | 56 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 src/runner/results.rs diff --git a/src/runner/results.rs b/src/runner/results.rs new file mode 100644 index 0000000..d72bcec --- /dev/null +++ b/src/runner/results.rs @@ -0,0 +1,56 @@ +use std::collections::HashMap; + +use semver::Version; +use serde::{Deserialize, Serialize}; +use url::Url; + +use crate::complaince::suite::Suite; + +#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)] +pub struct ArchivableInitResult { + pub success: bool, + pub exit_code: isize, + pub container: ArchivableContainer, +} + +#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)] +pub struct ArchivableTestResult { + pub success: bool, + // sent by the app + pub logs: String, + pub container: ArchivableContainer, +} + +#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)] +pub struct ArchivableContainer { + pub logs: String, + pub name: String, +} +#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)] +pub struct ArchivableTest { + pub name: String, + pub url: Url, + pub version: Version, + // URL to the container image, the version should be the tag + pub container: String, + pub env_vars: Option>, + pub result: ArchivableTestResult, +} + +#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)] +pub struct ArchivableSuiteResult { + pub suite: Suite, + pub tests: Vec, +} + +#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)] +pub struct ArchivableResult { + pub commit: String, + pub suites: Vec, + pub init_containers: Option>, +} + +#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)] +pub struct LatestFile { + pub latest: String, +}