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-AchardC-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-AchardC-Achard self-assigned this Jul 10, 2026
@C-AchardC-Achard added the enhancement New feature or request label Jul 10, 2026
@C-Achard
C-Achardforce-pushed the cy/expand-coverage-july26 branch from 81800e2 to b6961fdCompareJuly 14, 2026 09:21
@C-Achard
C-Achardforce-pushed the cy/expand-coverage-july26 branch from b6961fd to 3c715e5CompareJuly 14, 2026 09:44
@C-Achard
C-Achardforce-pushed the cy/expand-coverage-july26 branch from 3c715e5 to f5da210CompareJuly 16, 2026 09:47
@C-Achard
C-Achardforce-pushed the cy/expand-coverage-july26 branch from f5da210 to ecce224CompareJuly 16, 2026 11:15
@C-Achard
C-Achardforce-pushed the cy/expand-coverage-july26 branch from ecce224 to 2d7392bCompareAugust 10, 2026 12:11
@C-Achard
C-Achardforce-pushed the cy/expand-coverage-july26 branch 2 times, most recently from f63d689 to d84352dCompareAugust 11, 2026 08:58
@C-Achard
C-Achardforce-pushed the cy/expand-coverage-july26 branch from d84352d to 9b28422CompareAugust 11, 2026 09:24
@C-Achard
C-Achardforce-pushed the cy/expand-coverage-july26 branch from 9b28422 to 245392eCompareAugust 11, 2026 11:56
@C-Achard
C-Achardforce-pushed the cy/expand-coverage-july26 branch from 245392e to 6f28683CompareAugust 11, 2026 13:23
@C-Achard
C-Achardforce-pushed the cy/expand-coverage-july26 branch from 6f28683 to 48a463fCompareAugust 12, 2026 08:16
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-Achardforce-pushed the cy/expand-coverage-july26 branch from 48a463f to 299f92fCompareAugust 12, 2026 09:31
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancementNew feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@C-Achard