Skip to content

Expand test coverage - #94

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

Expand test coverage#94
C-Achard wants to merge 10 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 C-Achard self-assigned this Jul 10, 2026
@C-Achard C-Achard added the enhancement New feature or request label Jul 10, 2026
@C-Achard
C-Achard force-pushed the cy/expand-coverage-july26 branch from 81800e2 to b6961fd Compare July 14, 2026 09:21
@C-Achard
C-Achard force-pushed the cy/expand-coverage-july26 branch from b6961fd to 3c715e5 Compare July 14, 2026 09:44
@C-Achard
C-Achard force-pushed the cy/expand-coverage-july26 branch from 3c715e5 to f5da210 Compare July 16, 2026 09:47
@C-Achard
C-Achard force-pushed the cy/expand-coverage-july26 branch from f5da210 to ecce224 Compare July 16, 2026 11:15
@C-Achard
C-Achard force-pushed the cy/expand-coverage-july26 branch from ecce224 to 2d7392b Compare August 10, 2026 12:11
@C-Achard
C-Achard force-pushed the cy/expand-coverage-july26 branch 2 times, most recently from f63d689 to d84352d Compare August 11, 2026 08:58
@C-Achard
C-Achard force-pushed the cy/expand-coverage-july26 branch from d84352d to 9b28422 Compare August 11, 2026 09:24
@C-Achard
C-Achard force-pushed the cy/expand-coverage-july26 branch from 9b28422 to 245392e Compare August 11, 2026 11:56
@C-Achard
C-Achard force-pushed the cy/expand-coverage-july26 branch from 245392e to 6f28683 Compare August 11, 2026 13:23
@C-Achard
C-Achard force-pushed the cy/expand-coverage-july26 branch from 6f28683 to 48a463f Compare August 12, 2026 08:16
@C-Achard
C-Achard force-pushed the cy/expand-coverage-july26 branch from 48a463f to 299f92f Compare August 12, 2026 09:31
@C-Achard
C-Achard force-pushed the cy/expand-coverage-july26 branch from 299f92f to 7f3c373 Compare August 12, 2026 13:50
@C-Achard
C-Achard force-pushed the cy/expand-coverage-july26 branch from 7f3c373 to f0b4a5b Compare August 12, 2026 14:11
@C-Achard
C-Achard force-pushed the cy/expand-coverage-july26 branch from f0b4a5b to e1af5f5 Compare August 12, 2026 14:31
@C-Achard
C-Achard force-pushed the cy/expand-coverage-july26 branch from e1af5f5 to 263fdfe Compare August 12, 2026 16:21
@C-Achard
C-Achard force-pushed the cy/expand-coverage-july26 branch from 263fdfe to 724990a Compare August 12, 2026 16:26
@C-Achard
C-Achard force-pushed the cy/expand-coverage-july26 branch from 724990a to 927a85f Compare August 13, 2026 09:52
@C-Achard
C-Achard force-pushed the cy/expand-coverage-july26 branch from 927a85f to e5d95cd Compare August 13, 2026 14:35
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.
Reworked tests to match the split between base WriteGear option construction and config-level overrides. Added focused unit coverage for `build_writegear_options` (default values, FPS fallback, invalid FPS handling, and override merging), updated `RecordingSettings` tests to validate `writegear_overrides()` behavior by codec/fast-encoding mode, and relaxed GUI manager assertions to only check override-specific flags.
@C-Achard
C-Achard force-pushed the cy/expand-coverage-july26 branch from e5d95cd to 3b1faae Compare August 13, 2026 15:13
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