test: fix pull archive fallback test
Some checks failed
CI / build (pull_request) Failing after 30s

This commit is contained in:
2025-12-24 12:30:36 +01:00
parent e872f6b992
commit 5015ff7278

View File

@@ -297,16 +297,16 @@ async fn fetch_archive_sources(
progress: ProgressCallback<'_>, progress: ProgressCallback<'_>,
) -> Result<(), Box<dyn Error>> { ) -> Result<(), Box<dyn Error>> {
let package_dir = if let Some(path) = cwd { let package_dir = if let Some(path) = cwd {
path.join(&info.stanza.package) path
} else { } else {
Path::new(&info.stanza.package).to_path_buf() &Path::new(".").to_path_buf()
}; };
std::fs::create_dir_all(&package_dir)?; std::fs::create_dir_all(package_dir)?;
for file in &info.stanza.files { for file in &info.stanza.files {
let url = format!("{}/{}", info.archive_url, file.name); let url = format!("{}/{}", info.archive_url, file.name);
download_file_checksum(&url, &file.sha256, &package_dir, progress).await?; download_file_checksum(&url, &file.sha256, package_dir, progress).await?;
} }
// Extract the debian tarball or diff // Extract the debian tarball or diff
@@ -516,7 +516,7 @@ mod tests {
} }
} }
// Check for orig tarball in package dir // Check for orig tarball in package dir (only for non-native packages)
let mut found_tarball = false; let mut found_tarball = false;
let mut found_dsc = false; let mut found_dsc = false;
for entry in std::fs::read_dir(package_dir).unwrap() { for entry in std::fs::read_dir(package_dir).unwrap() {
@@ -530,7 +530,10 @@ mod tests {
} }
} }
assert!(found_tarball, "Orig tarball not found in package dir"); // Only check for orig tarball if the package is not native
if !info.is_native() {
assert!(found_tarball, "Orig tarball not found in package dir");
}
assert!(found_dsc, "DSC file not found in package dir"); assert!(found_dsc, "DSC file not found in package dir");
} }