Rewrite rust #38

Merged
kjuulh merged 24 commits from experiment/local into v0.3 2022-11-27 12:21:36 +01:00
2 changed files with 1 additions and 34 deletions
Showing only changes of commit c5df9a6392 - Show all commits

View File

@ -1,7 +1,7 @@
use std::{path::PathBuf, sync::Arc}; use std::{path::PathBuf, sync::Arc};
use eyre::ContextCompat; use eyre::ContextCompat;
use git2::{AutotagOption, Cred, FetchOptions, PushOptions, RemoteCallbacks, Repository}; use git2::{Cred, FetchOptions, PushOptions, RemoteCallbacks, Repository};
use tokio::sync::Mutex; use tokio::sync::Mutex;
use crate::storage::DynStorageEngine; use crate::storage::DynStorageEngine;

View File

@ -34,36 +34,3 @@ impl DefaultSchemaParser {
Ok(schema) Ok(schema)
} }
} }
mod test {
use super::DefaultSchemaParser;
use crate::schema::models::{Action, Schema, SelectAction};
#[test]
fn can_parse_action() {
let content = r#"apiVersion: action
name: write-a-readme
select:
repositories:
- git@git.front.kjuulh.io:kjuulh/octopush-test.git
actions:
- type: go
entry: "main.go"
"#;
let res = DefaultSchemaParser::new().parse(content.trim().into());
assert_eq!(
res.unwrap(),
Schema::Action {
name: "write-a-readme".into(),
select: SelectAction {
repositories: vec!["git@git.front.kjuulh.io:kjuulh/octopush-test.git".into()]
},
action: vec![Action::Go {
entry: "main.go".into()
}]
}
)
}
}