diff --git a/federate/federate-core/src/lib.rs b/federate/federate-core/src/lib.rs index e7c9443..03ce45f 100644 --- a/federate/federate-core/src/lib.rs +++ b/federate/federate-core/src/lib.rs @@ -78,7 +78,7 @@ pub trait Federate: Sync + Send { async fn tar(&self) -> Result; /// get latest tar ball - async fn latest_tar(&self) -> Result; + async fn latest_tar(&self) -> Result; } pub fn get_hostname(url: &Url) -> &str { diff --git a/federate/federate-core/src/tests.rs b/federate/federate-core/src/tests.rs index fed217b..ced3e5d 100644 --- a/federate/federate-core/src/tests.rs +++ b/federate/federate-core/src/tests.rs @@ -53,9 +53,9 @@ pub async fn adding_forge_works<'a, T: Federate>( .unwrap()); // tar() - let tar = ff.tar().await.unwrap(); + let tar = ff.tar().await.unwrap().to_str().unwrap().to_string(); let latest = ff.latest_tar().await.unwrap(); - assert_eq!(tar, latest); + assert!(tar.contains(&latest)); // delete repository ff.delete_repository(add_repo_msg.owner, add_repo_msg.name, &add_repo_msg.url) diff --git a/federate/publiccodeyml/src/lib.rs b/federate/publiccodeyml/src/lib.rs index aefca24..74f25c5 100644 --- a/federate/publiccodeyml/src/lib.rs +++ b/federate/publiccodeyml/src/lib.rs @@ -258,7 +258,7 @@ impl Federate for PccFederate { } /// get latest tar ball - async fn latest_tar(&self) -> Result { + async fn latest_tar(&self) -> Result { use std::fs::File; use std::time::{SystemTime, UNIX_EPOCH}; @@ -293,7 +293,6 @@ impl Federate for PccFederate { times.sort(); let latest = times.pop().unwrap(); - let latest = Path::new(&self.base_dir).join(format!("{}.tar", latest.to_string())); - Ok(latest) + Ok(format!("{}.tar", latest)) } } diff --git a/federate/publiccodeyml/src/tests.rs b/federate/publiccodeyml/src/tests.rs index 248042a..77ad120 100644 --- a/federate/publiccodeyml/src/tests.rs +++ b/federate/publiccodeyml/src/tests.rs @@ -37,6 +37,7 @@ async fn everything_works() { let create_forge_msg = CreateForge { url: url.clone(), forge_type: ForgeImplementation::Gitea, + import: false, }; let add_user_msg = AddUser { @@ -44,6 +45,7 @@ async fn everything_works() { html_link: HTML_PROFILE_URL, profile_photo: None, username: USERNAME, + import: false, }; let add_repo_msg = AddRepository { @@ -54,6 +56,7 @@ async fn everything_works() { website: None, description: None, url: url.clone(), + import: false, }; let pcc = PccFederate::new(tmp_dir.to_str().unwrap().to_string())