test: ci testing logs
Some checks failed
CI / build (pull_request) Has been cancelled

This commit is contained in:
2025-12-25 00:47:56 +01:00
parent eac47e3e8b
commit 22f21ff4cf
3 changed files with 28 additions and 1 deletions

View File

@@ -29,7 +29,7 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y pristine-tar sbuild mmdebstrap util-linux dpkg-dev
- name: Run tests with verbose logging
- name: Run tests with verbose logging (timeout 30min)
env:
RUST_LOG: debug
run: timeout 30m cargo test -- --nocapture

View File

@@ -28,3 +28,6 @@ serde_json = "1.0.145"
directories = "6.0.0"
ssh2 = "0.9.5"
tempfile = "3.10.1"
[dev-dependencies]
test-log = "0.2.19"

View File

@@ -107,9 +107,19 @@ fn find_dsc_file(
#[cfg(test)]
mod tests {
async fn test_build_end_to_end(package: &str, series: &str, arch: Option<&str>, cross: bool) {
log::info!(
"Starting end-to-end test for package: {} (series: {}, arch: {:?}, cross: {})",
package,
series,
arch,
cross
);
let temp_dir = tempfile::tempdir().unwrap();
let cwd = temp_dir.path();
log::debug!("Created temporary directory: {}", cwd.display());
log::info!("Pulling package {} from Ubuntu {}...", package, series);
crate::pull::pull(
package,
"",
@@ -122,12 +132,16 @@ mod tests {
)
.await
.expect("Cannot pull package");
log::info!("Successfully pulled package {}", package);
// Change directory to the package directory
let cwd = cwd.join(package).join(package);
log::debug!("Package directory: {}", cwd.display());
log::info!("Starting binary package build...");
crate::deb::build_binary_package(arch, Some(series), Some(&cwd), cross, None)
.expect("Cannot build binary package (deb)");
log::info!("Successfully built binary package");
// Check that the .deb files are present
let parent_dir = cwd.parent().expect("Cannot find parent directory");
@@ -137,7 +151,16 @@ mod tests {
.filter(|entry| entry.path().extension().is_some_and(|ext| ext == "deb"))
.collect::<Vec<_>>();
log::info!("Found {} .deb files after build", deb_files.len());
for file in &deb_files {
log::debug!(" - {}", file.path().display());
}
assert!(!deb_files.is_empty(), "No .deb files found after build");
log::info!(
"End-to-end test completed successfully for package: {}",
package
);
}
#[tokio::test]
@@ -146,6 +169,7 @@ mod tests {
}
#[tokio::test]
#[test_log::test]
#[cfg(target_arch = "x86_64")]
async fn test_deb_hello_ubuntu_cross_end_to_end() {
test_build_end_to_end("hello", "noble", Some("riscv64"), true).await;