kingfisher/tests/int_local_path_validation.rs
Mick Grove 078fa16e6a - Reduced per-match memory usage by compacting stored source locations and interning repeated capture names.
- Stored optional validation response bodies as boxed strings to avoid allocating empty payloads and to streamline validator caches.
- Parallelized git cloning based on the configured job count and begin scanning repositories as soon as each clone finishes to reduce end-to-end scan times.
- Combined per-repository results into a single aggregate summary after scans complete.
- Added initial access-map support and report viewer html file. Currently beta features.
2025-12-04 22:02:30 -08:00

32 lines
878 B
Rust

use std::time::Duration;
use anyhow::Result;
use assert_cmd::Command;
use tempfile::tempdir;
#[test]
fn scan_local_path_finishes_without_repo_inputs() -> Result<()> {
let dir = tempdir()?;
let file_path = dir.path().join("sample.txt");
std::fs::write(&file_path, "hello world")?;
let mut cmd = Command::new(assert_cmd::cargo::cargo_bin!("kingfisher"));
cmd.args([
"scan",
file_path.to_str().expect("temp path is valid UTF-8"),
"--no-update-check",
"--format",
"json",
"--only-valid",
]);
// .timeout(Duration::from_secs(40));
let output = cmd.output()?;
if !output.status.success() {
eprintln!("stdout: {}", String::from_utf8_lossy(&output.stdout));
eprintln!("stderr: {}", String::from_utf8_lossy(&output.stderr));
}
assert!(output.status.success());
Ok(())
}