Expand test coverage#94
Draft
C-Achard wants to merge 9 commits into
Draft
Conversation
Replace the asynchronous `test_queue_full_drops_frames` flow with a deterministic unit test that directly exercises `enqueue_frame` when the queue is full. The new test injects a 1-slot queue, simulates a running worker state, verifies stale-frame dropping via processor stats, and confirms the newest frame/timestamp remains queued.
Introduce a new test module for `SingleCameraWorker` covering normal fake-backend startup/frame flow, recording sink behavior (enabled/disabled), camera factory initialization failure handling, repeated empty-frame and read-error retry limits, and hardware-trigger timeout behavior that should not surface as errors.
Adds focused GUI test modules for main-window behavior: preview start/stop lifecycle, recording start/stop and pending-start logic, and camera label/display ID handling in UI elements. This improves regression coverage for camera-state transitions and user-facing camera naming, while keeping existing test entry points aligned with the new structure.
Before saving trigger configuration, this change removes strobe-related properties if the active profile does not expose strobe fields. This prevents hidden/unsupported strobe values from being written to the backend trigger config.
Introduce a new `test_trigger_config.py` suite for camera trigger configuration. The tests cover backend UI profiles, backend namespace normalization, dialog field visibility/enabling by role and backend, loading existing trigger settings, and accept-path payload serialization for off/external/master roles across GenTL and Basler behavior.
Call `self.settings.sync()` after saving the config and updating stored paths/snapshots so settings are flushed promptly. If syncing fails, log a debug message with exception info without interrupting the save flow.
Introduce a new test module covering `gentl_discovery` behavior end-to-end: CTI input normalization, explicit/env/extra-dir discovery, glob validation and allowed-root checks, candidate deduplication, and selection policies (`FIRST`, `NEWEST`, `RAISE_IF_MULTIPLE`). It also adds lifecycle tests for `SharedHarvesterPool`/`SharedHarvesterEntry`, including reuse/refcount semantics and failure reporting when CTI loading fails.
Expand main window GUI coverage with a regression test that ensures runtime camera fallback updates only the active inference camera, not the user’s preferred inference camera. Add a new test module for user-config persistence, covering config path validation, dialog path suggestion logic, successful save side effects (last path, snapshot, sync), and failure behavior that avoids persistence and reports errors. Also add file header comments in related test files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Aims to restore coverage after the latest round of changes to the GUI.
Covers: