feat: runner result types

This commit is contained in:
Aravinth Manivannan 2023-09-27 17:17:48 +05:30
parent 6078953faa
commit d7404aa074
Signed by: realaravinth
GPG key ID: F8F50389936984FF

56
src/runner/results.rs Normal file
View file

@ -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<HashMap<String, String>>,
pub result: ArchivableTestResult,
}
#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)]
pub struct ArchivableSuiteResult {
pub suite: Suite,
pub tests: Vec<ArchivableTest>,
}
#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)]
pub struct ArchivableResult {
pub commit: String,
pub suites: Vec<ArchivableSuiteResult>,
pub init_containers: Option<Vec<ArchivableInitResult>>,
}
#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)]
pub struct LatestFile {
pub latest: String,
}