A facial recognition login service for Linux.
2

Configure Feed

Select the types of activity you want to include in your feed.

tests: Smoke-test the public camera surface

Unit tests inside `pareidolia-core` reach in via `super::` and so can't
catch the case where the public re-export surface accidentally hides a type
a downstream crate needs. These cross-crate tests are explicitly that
backstop: they exercise the same mocks but only through the public path the
daemon and CLI will use.

Lives as a module under the single integration test binary, per the workspace
convention documented in CONTRIBUTING.md.

Isaac Corbrey (May 27, 2026, 9:44 AM EDT) f38df4d7 e0e4ab0b

+49
+1
crates/integration-tests/tests/integration.rs
··· 9 9 //! file under `tests/` is a regression — add a `mod` here instead. 10 10 11 11 mod integration { 12 + mod camera; 12 13 mod smoke; 13 14 }
+48
crates/integration-tests/tests/integration/camera.rs
··· 1 + //! Cross-crate smoke tests for `pareidolia_core::camera`. 2 + //! 3 + //! Unit tests inside `pareidolia-core` already cover the mock implementations 4 + //! thoroughly. These tests exist to catch the orthogonal failure mode where 5 + //! the public re-export surface accidentally hides one of the types a 6 + //! downstream consumer (the daemon, the CLI) needs — exactly the kind of 7 + //! regression the in-crate tests can't see, because they reach in via 8 + //! `super::`. 9 + 10 + use pareidolia_core::camera::mock::{FailingFrameSource, ScriptedFrameSource, StaticFrameSource}; 11 + use pareidolia_core::camera::{CameraInfo, CameraKind, FrameError, FrameSource, PixelFormat}; 12 + 13 + fn rgb_info() -> CameraInfo { 14 + CameraInfo { 15 + name: "smoke-rgb".into(), 16 + path: None, 17 + kind: CameraKind::Rgb, 18 + } 19 + } 20 + 21 + #[test] 22 + fn public_static_source_round_trip() { 23 + let mut src = StaticFrameSource::new(rgb_info(), 1, 1, PixelFormat::Rgb8, vec![10, 20, 30]); 24 + let frame = src.capture().expect("capture"); 25 + assert_eq!(frame.width, 1); 26 + assert_eq!(frame.height, 1); 27 + assert_eq!(frame.format, PixelFormat::Rgb8); 28 + assert_eq!(frame.kind, CameraKind::Rgb); 29 + assert_eq!(frame.data, vec![10, 20, 30]); 30 + } 31 + 32 + #[test] 33 + fn public_scripted_source_exhausts_to_typed_error() { 34 + let mut src = ScriptedFrameSource::new(rgb_info()); 35 + // No frames pushed; first capture must surface the exhaustion variant 36 + // through the public re-export path. 37 + let err = src.capture().expect_err("must be exhausted"); 38 + assert!(matches!(err, FrameError::Exhausted)); 39 + } 40 + 41 + #[test] 42 + fn public_failing_source_surfaces_unavailable() { 43 + let mut src = FailingFrameSource::unavailable(rgb_info(), "smoke"); 44 + match src.capture() { 45 + Err(FrameError::Unavailable(reason)) => assert_eq!(reason, "smoke"), 46 + other => panic!("expected Unavailable, got {other:?}"), 47 + } 48 + }