Skip to content

Conversation

@kkxthyl
Copy link
Contributor

@kkxthyl kkxthyl commented Sep 26, 2025

Link the Issue(s) this Pull Request is related to.

Summarize your change.

Summary:

Add comprehensive unit tests for frame-specific operations and implement input validation for stagger, reorder, and frame range operations. Updated documentation to reflect new validation requirements.

Changes:

  1. Unit tests (cueman/tests/test_frame_operations.py)

Created comprehensive test suite covering:

  • Frame eat/kill/retry operations with layer and range filters
  • Frame state filtering (running, waiting, dead, succeeded)
  • Frame range parsing and validation
  • Mark done functionality
  • Stagger operations with increment validation (positive integers only)
  • Reorder operations with position validation (FIRST, LAST, REVERSE)
  • Confirmation prompts for destructive operations
  • Error handling for invalid inputs
  1. Input validation (cueman/cueman/main.py)

Added validation to ensure:

  • Stagger increments must be positive integers (rejects 0, negative, non-numeric)
  • Reorder positions must be FIRST, LAST, or REVERSE
  • Frame ranges must be valid numeric formats with start < = end
  1. Documentation updates

Updated documentation across multiple files:

  • docs/_docs/reference/tools/cueman.md: Added validation notes and troubleshooting examples for invalid inputs
  • docs/_docs/tutorials/cueman-tutorial.md: Added validation notes in Frame Manipulation section and error examples
  • cueman/cueman_tutorial.md: Added validation notes for stagger and reorder
  • cueman/README.md: Updated inline comments to reflect requirements
  1. Test fixes
  • Fixed typo in test method name: from test_done_fundtionality to test_done_functionality
  • Corrected layer parameter type from string to list in 7 tests to match argparse nargs="+" behavior
  • Updated assertions to expect list values for consistency with actual command-line argument parsing

Co-authored-by: Kathy Lee [email protected]
Co-authored-by: Ramon Figueiredo [email protected]

@ramonfigueiredo
Copy link
Collaborator

Hi @kkxthyl ,

Please fix the Lint Python issues.

Thanks!

@kkxthyl kkxthyl force-pushed the test-frame-operations branch from 69c3ed4 to d546995 Compare September 29, 2025 23:36
@kkxthyl kkxthyl force-pushed the test-frame-operations branch from d546995 to 8c91e9b Compare September 30, 2025 00:39
- Fix typo in test method name: from `test_done_fundtionality` to `test_done_functionality`
- Correct layer parameter type from string to list in 7 tests to match argparse nargs="+" behavior
- Update assertions to expect list values instead of strings for consistency with actual command-line argument parsing

These changes ensure tests accurately reflect how the `-layer` argument is parsed and passed through the application.
@ramonfigueiredo ramonfigueiredo marked this pull request as draft September 30, 2025 03:55
Document validation rules for frame operations added in recent changes:

- Stagger increment: Must be a positive integer (rejects 0, negative, non-numeric)
- Reorder position: Must be FIRST, LAST, or REVERSE
- Frame ranges: Must be numeric with start < = end

Updated files:
- docs/_docs/reference/tools/cueman.md: Added validation notes and troubleshooting examples for invalid inputs
- docs/_docs/tutorials/cueman-tutorial.md: Added validation notes in Frame Manipulation section and error examples
- cueman/cueman_tutorial.md: Added validation notes for stagger and reorder
- cueman/README.md: Updated inline comments to reflect requirements

Users will now see clear guidance on valid inputs and understand error messages when validation fails.
@ramonfigueiredo ramonfigueiredo changed the title [cueman] Add Unit Tests for Frame Operations #1929 [cueman] Add Unit Tests for Frame Operations Sep 30, 2025
@ramonfigueiredo ramonfigueiredo changed the title [cueman] Add Unit Tests for Frame Operations [cueman] Add unit tests and validation for frame operations Sep 30, 2025
@ramonfigueiredo ramonfigueiredo marked this pull request as ready for review September 30, 2025 04:16
@ramonfigueiredo
Copy link
Collaborator

ramonfigueiredo commented Sep 30, 2025

Hi @kkxthyl

FYI...

I made some improvements and fixes. See commits: 605d61e and 277c456

Your code will be merged soon!

@ramonfigueiredo ramonfigueiredo merged commit cfc32ef into AcademySoftwareFoundation:master Sep 30, 2025
20 checks passed
@ramonfigueiredo
Copy link
Collaborator

Merged!

Great job, @kkxthyl !

@ramonfigueiredo
Copy link
Collaborator

====================================================================== test session starts =======================================================================
cachedir: .pytest_cache
configfile: pyproject.toml
collected 24 items                                                                                                                                               

cueman/tests/test_frame_operations.py::TestFrameOperations::test_done_confirmation_prompt PASSED                                                           [  4%]
cueman/tests/test_frame_operations.py::TestFrameOperations::test_done_functionality PASSED                                                                 [  8%]
cueman/tests/test_frame_operations.py::TestFrameOperations::test_eatFrames_with_dead_state_filter PASSED                                                   [ 12%]
cueman/tests/test_frame_operations.py::TestFrameOperations::test_eatFrames_with_running_state_filter PASSED                                                [ 16%]
cueman/tests/test_frame_operations.py::TestFrameOperations::test_eatFrames_with_succeeded_state_filter PASSED                                              [ 20%]
cueman/tests/test_frame_operations.py::TestFrameOperations::test_eatFrames_with_valid_layer PASSED                                                         [ 25%]
cueman/tests/test_frame_operations.py::TestFrameOperations::test_eatFrames_with_waiting_state_filter PASSED                                                [ 29%]
cueman/tests/test_frame_operations.py::TestFrameOperations::test_eat_confirmation_prompt PASSED                                                            [ 33%]
cueman/tests/test_frame_operations.py::TestFrameOperations::test_invalid_nonnumeric_range_inputs PASSED                                                    [ 37%]
cueman/tests/test_frame_operations.py::TestFrameOperations::test_invalid_reverse_range_inputs PASSED                                                       [ 41%]
cueman/tests/test_frame_operations.py::TestFrameOperations::test_killFrames_with_valid_layer PASSED                                                        [ 45%]
cueman/tests/test_frame_operations.py::TestFrameOperations::test_kill_confirmation_prompt PASSED                                                           [ 50%]
cueman/tests/test_frame_operations.py::TestFrameOperations::test_reorder_first_operation PASSED                                                            [ 54%]
cueman/tests/test_frame_operations.py::TestFrameOperations::test_reorder_invalid_operation PASSED                                                          [ 58%]
cueman/tests/test_frame_operations.py::TestFrameOperations::test_reorder_last_operation PASSED                                                             [ 62%]
cueman/tests/test_frame_operations.py::TestFrameOperations::test_reorder_reverse_operation PASSED                                                          [ 66%]
cueman/tests/test_frame_operations.py::TestFrameOperations::test_retryFrames_with_valid_layer PASSED                                                       [ 70%]
cueman/tests/test_frame_operations.py::TestFrameOperations::test_retry_confirmation_prompt PASSED                                                          [ 75%]
cueman/tests/test_frame_operations.py::TestFrameOperations::test_stagger_increments PASSED                                                                 [ 79%]
cueman/tests/test_frame_operations.py::TestFrameOperations::test_stagger_negative_increments PASSED                                                        [ 83%]
cueman/tests/test_frame_operations.py::TestFrameOperations::test_stagger_nonnumeric_increments PASSED                                                      [ 87%]
cueman/tests/test_frame_operations.py::TestFrameOperations::test_stagger_zero_increments PASSED                                                            [ 91%]
cueman/tests/test_frame_operations.py::TestFrameOperations::test_valid_range_inputs PASSED                                                                 [ 95%]
cueman/tests/test_frame_operations.py::TestFrameOperations::test_valid_single_range_inputs PASSED                                                          [100%]

======================================================================= 24 passed in 0.54s =======================================================================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants