feat: runner result types
This commit is contained in:
parent
6078953faa
commit
d7404aa074
1 changed files with 56 additions and 0 deletions
56
src/runner/results.rs
Normal file
56
src/runner/results.rs
Normal 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,
|
||||
}
|
Loading…
Reference in a new issue