diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7d689e307..f3504f19a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,6 +33,11 @@ jobs: sudo apt-get update sudo apt-get install -y libavformat-dev libavfilter-dev libavdevice-dev ffmpeg libasound2-dev libgtk-3-dev libsoup-3.0-dev libjavascriptcoregtk-4.1-dev libwebkit2gtk-4.1-dev + - name: Copy test image + run: | + mkdir -p target/debug/deps + cp tests/testing_OCR.png target/debug/deps/ + - name: Run tests run: cargo test @@ -53,7 +58,7 @@ jobs: toolchain: stable # - name: Run tests - # run: cargo test + # run: cargo test - name: Run specific Windows OCR test - run: cargo test test_process_ocr_task_windows + run: cargo test test_process_ocr_task_windows diff --git a/screenpipe-vision/tests/integration_test.rs b/screenpipe-vision/tests/integration_test.rs index 2696533e6..43873e876 100644 --- a/screenpipe-vision/tests/integration_test.rs +++ b/screenpipe-vision/tests/integration_test.rs @@ -7,11 +7,11 @@ use screenpipe_vision::perform_ocr_tesseract; fn test_ocr_output() -> Result<(), Box> { println!("Starting test_ocr_output"); - // Use the correct path to the testing_OCR.png file + // Use an absolute path that works in both local and CI environments let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - path.push("tests/testing_OCR.png"); - println!("Path to image.png: {:?}", path); - + path.push("tests"); + path.push("testing_OCR.png"); + println!("Path to testing_OCR.png: {:?}", path); let image = image::open(&path).expect("Failed to open image"); // Start timing diff --git a/screenpipe-vision/tests/windows_vision_test.rs b/screenpipe-vision/tests/windows_vision_test.rs index d08efcc19..4d14d645f 100644 --- a/screenpipe-vision/tests/windows_vision_test.rs +++ b/screenpipe-vision/tests/windows_vision_test.rs @@ -6,11 +6,16 @@ mod tests { use screenpipe_vision::{process_ocr_task, OcrEngine}; use std::{sync::Arc, time::Instant}; use tokio::sync::{mpsc, Mutex}; - #[cfg(target_os = "windows")] #[tokio::test] async fn test_process_ocr_task_windows() { - let image = DynamicImage::new_rgb8(100, 100); + // Use an absolute path that works in both local and CI environments + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("tests"); + path.push("testing_OCR.png"); + println!("Path to testing_OCR.png: {:?}", path); + let image = image::open(&path).expect("Failed to open image"); + let image_arc = Arc::new(image); let frame_number = 1; let timestamp = Instant::now();