Add comprehensive thread-worker unit coverage; harden CSVImportThread ROI field/NaN handling - #209
Merged
Merged
Conversation
Co-authored-by: tkswanson <4371698+tkswanson@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add comprehensive unit tests for matchypatchy thread workers
Add comprehensive thread-worker unit coverage; harden CSVImportThread ROI field/NaN handling
Aug 28, 2026
tkswanson
marked this pull request as ready for review
August 28, 2026 22:18
Co-authored-by: tkswanson <4371698+tkswanson@users.noreply.github.com>
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.
This PR adds focused unit coverage for previously untested thread workers under
matchypatchy/threads, with priority onimport_thread.pyandaniml_thread.py. While building the tests, it also addresses two CSV import edge cases surfaced by coverage (ROI field access mode mismatch andfavorite/individualnull handling).tests/test_threads/test_import_thread.py)CSVMigrateThread: required-column validation, row processing, ref-dict caching, missing-file skip/error collection, interruption/finish behavior.CSVImportThread: common base-dir detection, filepath grouping behavior, old (bbox1-4) and new (bbox_x/y/w/h) bbox formats, value conversion withNone/NaN, ROI/media thumbnail persistence, interruption/finish behavior.FolderImportThread: station/camera extraction by path index, default station creation (station_level=0), interruption and finish semantics.BasePathUpdateThread:update_base_dirinvocation semantics and progress/finished signal behavior.tests/test_threads/test_animl_thread.py)BuildManifestThread: manifest build call contract andmanifestsignal payload.VerifyNewBaseDirsThread: hash-diff logic across update tuples andnot_in_db/not_in_new_directory/finishedsignaling.AnimlThread: initialization from DB state, image/video detection flows, ROI bbox updates for unresolved ROIs, thumbnail saves, progress/prompt signaling,detector=Nonebehavior, interruption handling.tests/conftest.pywith minimalQThread/pyqtSignalstubs to reliably exercise workerrun()paths in headless unit tests.CSVImportThread_roi_value()to support ROI extraction when selected columns are passed as either names or positional indices.favoritenow defaults to0when conversion yieldsNone.individual()now returnsNonefor missing/NaN names instead of attempting DB lookup/insert.