Skip to content

Expand test coverage#94

Draft
C-Achard wants to merge 9 commits into
cy/ui-tweaksfrom
cy/expand-coverage-july26
Draft

Expand test coverage#94
C-Achard wants to merge 9 commits into
cy/ui-tweaksfrom
cy/expand-coverage-july26

Conversation

@C-Achard

@C-Achard C-Achard commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Aims to restore coverage after the latest round of changes to the GUI.

Covers:

  • Settings storage
  • Main window
  • GenTL CTI discovery
  • SingleCameraWorker
  • Trigger config UI

C-Achard added 9 commits July 10, 2026 14:41
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.
@C-Achard C-Achard self-assigned this Jul 10, 2026
@C-Achard C-Achard added the enhancement New feature or request label Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant