Skip to content

Conversation

@ramonfigueiredo
Copy link
Collaborator

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

Summarize your change.

[cueadmin] Enhance testing infrastructure, tooling, and documentation

  • Update pyproject.toml with modern pytest configuration

    • Add pytest markers (unit, integration, slow)
    • Enable verbose output and strict marker validation
    • Upgrade dependencies (pytest >= 8.0.0, pytest-cov >= 4.0.0)
    • Add dev dependencies: pylint, black, isort
    • Configure comprehensive coverage reporting with exclusions
  • Add tox.ini for multi-environment testing

    • Support Python 3.8–3.13
    • Include lint, coverage, and code formatting envs
    • Enable CI/CD integration with format checks
  • Improve README.md with testing documentation

    • Add quick start guide and test infra overview
    • Document dependencies, coverage, and workflows
    • Add CI/CD integration examples and contributing guidelines
  • Create run_tests.sh script

    • Support coverage reporting (--coverage, --html)
    • Verbose and quick test modes
    • Colored output and dependency checks
    • Environment info and help usage examples
  • Raise project quality standards

    • Align with cueman testing infrastructure
    • Enable modern testing practices and tooling
    • Integrate with OpenCue CI/CD pipeline

[docs] Expand cueadmin documentation

  • Add “Development and Testing” and “Development and Contributing” sections
  • Include pytest usage, CI/CD integration, and workflows
  • Align structure with cueman docs and update navigation links

[cueadmin] Apply code formatting with black and isort

  • isort reordered imports in 8 files
  • black reformatted 8 files for consistency
  • 3 files already compliant, unchanged

- Update pyproject.toml with modern pytest configuration
    * Add pytest markers for unit, integration, and slow tests
    * Enable verbose output and strict marker validation
    * Upgrade test dependencies to pytest > = 8.0.0, pytest-cov > = 4.0.0
    * Add dev dependencies with linting tools (pylint, black, isort)
    * Configure comprehensive coverage reporting with exclusions

- Add tox.ini for multi-environment testing
    * Support Python 3.8-3.13 testing environments
    * Include lint, coverage, and code formatting environments
    * Enable CI/CD integration with format checking

- Enhance README.md with comprehensive testing documentation
    * Add detailed testing section with quick start guide
    * Document test infrastructure and dependencies
    * Include coverage reporting and development workflows
    * Add CI/CD integration examples and contributing guidelines
    * Provide multiple testing scenarios and usage examples

- Improve project quality standards
    * Align with cueman testing infrastructure standards
    * Enable modern testing practices and tooling
    * Support professional development workflows
    * Integrate with OpenCue CI/CD pipeline
* Support for coverage reporting (--coverage, --html)
* Verbose and quick test modes
* Colored output for better readability
* Dependency checking for pytest and pytest-cov
* Environment information display
* Help documentation with usage examples
* Add "Development and Testing" section to cueadmin reference docs
* Add "Development and Contributing" section to cueadmin tutorial
* Include information test suite, pytest usage, and CI/CD integration
* Align cueadmin documentation structure with cueman documentation
* Update navigation links to development resources
Both black and isort ran and made changes:

- isort fixed import ordering in 8 files
- black reformatted 8 files for consistent code style
- 3 files were already properly formatted and left unchanged
@ramonfigueiredo ramonfigueiredo marked this pull request as ready for review September 23, 2025 23:48
@ramonfigueiredo
Copy link
Collaborator Author

cd cueadmin
./run_tests.sh 
[INFO] Python version: Python 3.13.2
[INFO] pytest version: pytest 8.4.2
[INFO] Test directory: /Users/rfigueiredo/github/OpenCue/cueadmin

[INFO] Running: python -m pytest -v tests/
==========================================
=============================================================================================================================================== test session starts ===============================================================================================================================================
cachedir: .pytest_cache
configfile: pyproject.toml
plugins: mock-3.15.1, pyfakefs-5.9.3, cov-7.0.0
collected 76 items                                                                                                                                                                                                                                                                                                

tests/test_common.py::CommonArgTests::testSetFacility PASSED                                                                                                                                                                                                                                                [  1%]
tests/test_common.py::CommonArgTests::testSetServer PASSED                                                                                                                                                                                                                                                  [  2%]
tests/test_common.py::CommonArgTests::testVerboseLogging PASSED                                                                                                                                                                                                                                             [  3%]
tests/test_common.py::ShowTests::testCreateShow PASSED                                                                                                                                                                                                                                                      [  5%]
tests/test_common.py::ShowTests::testDefaultMaxCores PASSED                                                                                                                                                                                                                                                 [  6%]
tests/test_common.py::ShowTests::testDefaultMinCores PASSED                                                                                                                                                                                                                                                 [  7%]
tests/test_common.py::ShowTests::testDeleteShow PASSED                                                                                                                                                                                                                                                      [  9%]
tests/test_common.py::ShowTests::testDisableBooking PASSED                                                                                                                                                                                                                                                  [ 10%]
tests/test_common.py::ShowTests::testDisableDispatch PASSED                                                                                                                                                                                                                                                 [ 11%]
tests/test_common.py::ShowTests::testDisableShow PASSED                                                                                                                                                                                                                                                     [ 13%]
tests/test_common.py::ShowTests::testEnableBooking PASSED                                                                                                                                                                                                                                                   [ 14%]
tests/test_common.py::ShowTests::testEnableDispatch PASSED                                                                                                                                                                                                                                                  [ 15%]
tests/test_common.py::ShowTests::testEnableShow PASSED                                                                                                                                                                                                                                                      [ 17%]
tests/test_common.py::ShowTests::testListShows PASSED                                                                                                                                                                                                                                                       [ 18%]
tests/test_common.py::AllocTests::testCreateAlloc PASSED                                                                                                                                                                                                                                                    [ 19%]
tests/test_common.py::AllocTests::testDeleteAlloc PASSED                                                                                                                                                                                                                                                    [ 21%]
tests/test_common.py::AllocTests::testInvalidRenameAlloc PASSED                                                                                                                                                                                                                                             [ 22%]
tests/test_common.py::AllocTests::testListAllocs PASSED                                                                                                                                                                                                                                                     [ 23%]
tests/test_common.py::AllocTests::testListSubscriptionsForAlloc PASSED                                                                                                                                                                                                                                      [ 25%]
tests/test_common.py::AllocTests::testRenameAlloc PASSED                                                                                                                                                                                                                                                    [ 26%]
tests/test_common.py::AllocTests::testReparentHosts PASSED                                                                                                                                                                                                                                                  [ 27%]
tests/test_common.py::AllocTests::testTagAlloc PASSED                                                                                                                                                                                                                                                       [ 28%]
tests/test_common.py::HostTests::testDeleteHost PASSED                                                                                                                                                                                                                                                      [ 30%]
tests/test_common.py::HostTests::testInvalidDeleteHost PASSED                                                                                                                                                                                                                                               [ 31%]
tests/test_common.py::HostTests::testInvalidLockHost PASSED                                                                                                                                                                                                                                                 [ 32%]
tests/test_common.py::HostTests::testInvalidMoveHost PASSED                                                                                                                                                                                                                                                 [ 34%]
tests/test_common.py::HostTests::testInvalidSafeReboot PASSED                                                                                                                                                                                                                                               [ 35%]
tests/test_common.py::HostTests::testInvalidSetFixed PASSED                                                                                                                                                                                                                                                 [ 36%]
tests/test_common.py::HostTests::testInvalidSetRepairState PASSED                                                                                                                                                                                                                                           [ 38%]
tests/test_common.py::HostTests::testInvalidSetThreadMode PASSED                                                                                                                                                                                                                                            [ 39%]
tests/test_common.py::HostTests::testInvalidUnlockHost PASSED                                                                                                                                                                                                                                               [ 40%]
tests/test_common.py::HostTests::testListHosts PASSED                                                                                                                                                                                                                                                       [ 42%]
tests/test_common.py::HostTests::testLockHost PASSED                                                                                                                                                                                                                                                        [ 43%]
tests/test_common.py::HostTests::testMoveHost PASSED                                                                                                                                                                                                                                                        [ 44%]
tests/test_common.py::HostTests::testSafeReboot PASSED                                                                                                                                                                                                                                                      [ 46%]
tests/test_common.py::HostTests::testSetFixed PASSED                                                                                                                                                                                                                                                        [ 47%]
tests/test_common.py::HostTests::testSetRepairState PASSED                                                                                                                                                                                                                                                  [ 48%]
tests/test_common.py::HostTests::testSetThreadMode PASSED                                                                                                                                                                                                                                                   [ 50%]
tests/test_common.py::HostTests::testUnlockHost PASSED                                                                                                                                                                                                                                                      [ 51%]
tests/test_common.py::SubscriptionTests::testCreateSub PASSED                                                                                                                                                                                                                                               [ 52%]
tests/test_common.py::SubscriptionTests::testDeleteSub PASSED                                                                                                                                                                                                                                               [ 53%]
tests/test_common.py::SubscriptionTests::testListSubs PASSED                                                                                                                                                                                                                                                [ 55%]
tests/test_common.py::SubscriptionTests::testSetBurst PASSED                                                                                                                                                                                                                                                [ 56%]
tests/test_common.py::SubscriptionTests::testSetBurstPercentage PASSED                                                                                                                                                                                                                                      [ 57%]
tests/test_common.py::SubscriptionTests::testSetSize PASSED                                                                                                                                                                                                                                                 [ 59%]
tests/test_common.py::JobTests::testListJobInfo PASSED                                                                                                                                                                                                                                                      [ 60%]
tests/test_common.py::JobTests::testListJobs PASSED                                                                                                                                                                                                                                                         [ 61%]
tests/test_common.py::ProcTests::testListFrameLogPaths PASSED                                                                                                                                                                                                                                               [ 63%]
tests/test_common.py::ProcTests::testListProcs PASSED                                                                                                                                                                                                                                                       [ 64%]
tests/test_common.py::ServiceTests::testListDefaultServices PASSED                                                                                                                                                                                                                                          [ 65%]
tests/test_common.py::ServiceTests::testListShowServices PASSED                                                                                                                                                                                                                                             [ 67%]
tests/test_format.py::FmtTests::test_cutoff_edge_cases PASSED                                                                                                                                                                                                                                               [ 68%]
tests/test_format.py::FmtTests::test_find_duration_with_mocked_time PASSED                                                                                                                                                                                                                                  [ 69%]
tests/test_format.py::FmtTests::test_format_duration_precision_edge_cases PASSED                                                                                                                                                                                                                            [ 71%]
tests/test_format.py::FmtTests::test_format_duration_with_extreme_values PASSED                                                                                                                                                                                                                             [ 72%]
tests/test_format.py::FmtTests::test_format_duration_with_floating_point PASSED                                                                                                                                                                                                                             [ 73%]
tests/test_format.py::FmtTests::test_format_long_duration_precision_edge_cases PASSED                                                                                                                                                                                                                       [ 75%]
tests/test_format.py::FmtTests::test_format_long_duration_with_extreme_values PASSED                                                                                                                                                                                                                        [ 76%]
tests/test_format.py::FmtTests::test_format_long_duration_with_floating_point PASSED                                                                                                                                                                                                                        [ 77%]
tests/test_format.py::FmtTests::test_format_mem_conversion_precision PASSED                                                                                                                                                                                                                                 [ 78%]
tests/test_format.py::FmtTests::test_format_mem_force_unit_edge_cases PASSED                                                                                                                                                                                                                                [ 80%]
tests/test_format.py::FmtTests::test_format_mem_with_decimal_inputs PASSED                                                                                                                                                                                                                                  [ 81%]
tests/test_format.py::FmtTests::test_format_time_custom_formats_date_components PASSED                                                                                                                                                                                                                      [ 82%]
tests/test_format.py::FmtTests::test_format_time_custom_formats_time_components PASSED                                                                                                                                                                                                                      [ 84%]
tests/test_format.py::FmtTests::test_format_time_epoch_edge_cases PASSED                                                                                                                                                                                                                                    [ 85%]
tests/test_format.py::FmtTests::test_format_time_with_different_default_values PASSED                                                                                                                                                                                                                       [ 86%]
tests/test_format.py::FmtTests::test_format_time_with_fractional_seconds PASSED                                                                                                                                                                                                                             [ 88%]
tests/test_output.py::OutputTests::testDisplayAllocations PASSED                                                                                                                                                                                                                                            [ 89%]
tests/test_output.py::OutputTests::testDisplayFrames PASSED                                                                                                                                                                                                                                                 [ 90%]
tests/test_output.py::OutputTests::testDisplayHosts PASSED                                                                                                                                                                                                                                                  [ 92%]
tests/test_output.py::OutputTests::testDisplayJobInfo PASSED                                                                                                                                                                                                                                                [ 93%]
tests/test_output.py::OutputTests::testDisplayJobs PASSED                                                                                                                                                                                                                                                   [ 94%]
tests/test_output.py::OutputTests::testDisplayProcs PASSED                                                                                                                                                                                                                                                  [ 96%]
tests/test_output.py::OutputTests::testDisplayServices PASSED                                                                                                                                                                                                                                               [ 97%]
tests/test_output.py::OutputTests::testDisplayShows PASSED                                                                                                                                                                                                                                                  [ 98%]
tests/test_output.py::OutputTests::testDisplaySubscriptions PASSED                                                                                                                                                                                                                                          [100%]

=============================================================================================================================================== 76 passed in 0.15s ================================================================================================================================================
==========================================
[INFO] All tests passed successfully!

@ramonfigueiredo
Copy link
Collaborator Author

pytest --cov=cueadmin --cov-report=term-missing

=============================================================================================================================================== test session starts ===============================================================================================================================================
cachedir: .pytest_cache
configfile: pyproject.toml
testpaths: tests
plugins: mock-3.15.1, pyfakefs-5.9.3, cov-7.0.0
collected 76 items                                                                                                                                                                                                                                                                                                

tests/test_common.py::CommonArgTests::testSetFacility PASSED                                                                                                                                                                                                                                                [  1%]
tests/test_common.py::CommonArgTests::testSetServer PASSED                                                                                                                                                                                                                                                  [  2%]
tests/test_common.py::CommonArgTests::testVerboseLogging PASSED                                                                                                                                                                                                                                             [  3%]
tests/test_common.py::ShowTests::testCreateShow PASSED                                                                                                                                                                                                                                                      [  5%]
tests/test_common.py::ShowTests::testDefaultMaxCores PASSED                                                                                                                                                                                                                                                 [  6%]
tests/test_common.py::ShowTests::testDefaultMinCores PASSED                                                                                                                                                                                                                                                 [  7%]
tests/test_common.py::ShowTests::testDeleteShow PASSED                                                                                                                                                                                                                                                      [  9%]
tests/test_common.py::ShowTests::testDisableBooking PASSED                                                                                                                                                                                                                                                  [ 10%]
tests/test_common.py::ShowTests::testDisableDispatch PASSED                                                                                                                                                                                                                                                 [ 11%]
tests/test_common.py::ShowTests::testDisableShow PASSED                                                                                                                                                                                                                                                     [ 13%]
tests/test_common.py::ShowTests::testEnableBooking PASSED                                                                                                                                                                                                                                                   [ 14%]
tests/test_common.py::ShowTests::testEnableDispatch PASSED                                                                                                                                                                                                                                                  [ 15%]
tests/test_common.py::ShowTests::testEnableShow PASSED                                                                                                                                                                                                                                                      [ 17%]
tests/test_common.py::ShowTests::testListShows PASSED                                                                                                                                                                                                                                                       [ 18%]
tests/test_common.py::AllocTests::testCreateAlloc PASSED                                                                                                                                                                                                                                                    [ 19%]
tests/test_common.py::AllocTests::testDeleteAlloc PASSED                                                                                                                                                                                                                                                    [ 21%]
tests/test_common.py::AllocTests::testInvalidRenameAlloc PASSED                                                                                                                                                                                                                                             [ 22%]
tests/test_common.py::AllocTests::testListAllocs PASSED                                                                                                                                                                                                                                                     [ 23%]
tests/test_common.py::AllocTests::testListSubscriptionsForAlloc PASSED                                                                                                                                                                                                                                      [ 25%]
tests/test_common.py::AllocTests::testRenameAlloc PASSED                                                                                                                                                                                                                                                    [ 26%]
tests/test_common.py::AllocTests::testReparentHosts PASSED                                                                                                                                                                                                                                                  [ 27%]
tests/test_common.py::AllocTests::testTagAlloc PASSED                                                                                                                                                                                                                                                       [ 28%]
tests/test_common.py::HostTests::testDeleteHost PASSED                                                                                                                                                                                                                                                      [ 30%]
tests/test_common.py::HostTests::testInvalidDeleteHost PASSED                                                                                                                                                                                                                                               [ 31%]
tests/test_common.py::HostTests::testInvalidLockHost PASSED                                                                                                                                                                                                                                                 [ 32%]
tests/test_common.py::HostTests::testInvalidMoveHost PASSED                                                                                                                                                                                                                                                 [ 34%]
tests/test_common.py::HostTests::testInvalidSafeReboot PASSED                                                                                                                                                                                                                                               [ 35%]
tests/test_common.py::HostTests::testInvalidSetFixed PASSED                                                                                                                                                                                                                                                 [ 36%]
tests/test_common.py::HostTests::testInvalidSetRepairState PASSED                                                                                                                                                                                                                                           [ 38%]
tests/test_common.py::HostTests::testInvalidSetThreadMode PASSED                                                                                                                                                                                                                                            [ 39%]
tests/test_common.py::HostTests::testInvalidUnlockHost PASSED                                                                                                                                                                                                                                               [ 40%]
tests/test_common.py::HostTests::testListHosts PASSED                                                                                                                                                                                                                                                       [ 42%]
tests/test_common.py::HostTests::testLockHost PASSED                                                                                                                                                                                                                                                        [ 43%]
tests/test_common.py::HostTests::testMoveHost PASSED                                                                                                                                                                                                                                                        [ 44%]
tests/test_common.py::HostTests::testSafeReboot PASSED                                                                                                                                                                                                                                                      [ 46%]
tests/test_common.py::HostTests::testSetFixed PASSED                                                                                                                                                                                                                                                        [ 47%]
tests/test_common.py::HostTests::testSetRepairState PASSED                                                                                                                                                                                                                                                  [ 48%]
tests/test_common.py::HostTests::testSetThreadMode PASSED                                                                                                                                                                                                                                                   [ 50%]
tests/test_common.py::HostTests::testUnlockHost PASSED                                                                                                                                                                                                                                                      [ 51%]
tests/test_common.py::SubscriptionTests::testCreateSub PASSED                                                                                                                                                                                                                                               [ 52%]
tests/test_common.py::SubscriptionTests::testDeleteSub PASSED                                                                                                                                                                                                                                               [ 53%]
tests/test_common.py::SubscriptionTests::testListSubs PASSED                                                                                                                                                                                                                                                [ 55%]
tests/test_common.py::SubscriptionTests::testSetBurst PASSED                                                                                                                                                                                                                                                [ 56%]
tests/test_common.py::SubscriptionTests::testSetBurstPercentage PASSED                                                                                                                                                                                                                                      [ 57%]
tests/test_common.py::SubscriptionTests::testSetSize PASSED                                                                                                                                                                                                                                                 [ 59%]
tests/test_common.py::JobTests::testListJobInfo PASSED                                                                                                                                                                                                                                                      [ 60%]
tests/test_common.py::JobTests::testListJobs PASSED                                                                                                                                                                                                                                                         [ 61%]
tests/test_common.py::ProcTests::testListFrameLogPaths PASSED                                                                                                                                                                                                                                               [ 63%]
tests/test_common.py::ProcTests::testListProcs PASSED                                                                                                                                                                                                                                                       [ 64%]
tests/test_common.py::ServiceTests::testListDefaultServices PASSED                                                                                                                                                                                                                                          [ 65%]
tests/test_common.py::ServiceTests::testListShowServices PASSED                                                                                                                                                                                                                                             [ 67%]
tests/test_format.py::FmtTests::test_cutoff_edge_cases PASSED                                                                                                                                                                                                                                               [ 68%]
tests/test_format.py::FmtTests::test_find_duration_with_mocked_time PASSED                                                                                                                                                                                                                                  [ 69%]
tests/test_format.py::FmtTests::test_format_duration_precision_edge_cases PASSED                                                                                                                                                                                                                            [ 71%]
tests/test_format.py::FmtTests::test_format_duration_with_extreme_values PASSED                                                                                                                                                                                                                             [ 72%]
tests/test_format.py::FmtTests::test_format_duration_with_floating_point PASSED                                                                                                                                                                                                                             [ 73%]
tests/test_format.py::FmtTests::test_format_long_duration_precision_edge_cases PASSED                                                                                                                                                                                                                       [ 75%]
tests/test_format.py::FmtTests::test_format_long_duration_with_extreme_values PASSED                                                                                                                                                                                                                        [ 76%]
tests/test_format.py::FmtTests::test_format_long_duration_with_floating_point PASSED                                                                                                                                                                                                                        [ 77%]
tests/test_format.py::FmtTests::test_format_mem_conversion_precision PASSED                                                                                                                                                                                                                                 [ 78%]
tests/test_format.py::FmtTests::test_format_mem_force_unit_edge_cases PASSED                                                                                                                                                                                                                                [ 80%]
tests/test_format.py::FmtTests::test_format_mem_with_decimal_inputs PASSED                                                                                                                                                                                                                                  [ 81%]
tests/test_format.py::FmtTests::test_format_time_custom_formats_date_components PASSED                                                                                                                                                                                                                      [ 82%]
tests/test_format.py::FmtTests::test_format_time_custom_formats_time_components PASSED                                                                                                                                                                                                                      [ 84%]
tests/test_format.py::FmtTests::test_format_time_epoch_edge_cases PASSED                                                                                                                                                                                                                                    [ 85%]
tests/test_format.py::FmtTests::test_format_time_with_different_default_values PASSED                                                                                                                                                                                                                       [ 86%]
tests/test_format.py::FmtTests::test_format_time_with_fractional_seconds PASSED                                                                                                                                                                                                                             [ 88%]
tests/test_output.py::OutputTests::testDisplayAllocations PASSED                                                                                                                                                                                                                                            [ 89%]
tests/test_output.py::OutputTests::testDisplayFrames PASSED                                                                                                                                                                                                                                                 [ 90%]
tests/test_output.py::OutputTests::testDisplayHosts PASSED                                                                                                                                                                                                                                                  [ 92%]
tests/test_output.py::OutputTests::testDisplayJobInfo PASSED                                                                                                                                                                                                                                                [ 93%]
tests/test_output.py::OutputTests::testDisplayJobs PASSED                                                                                                                                                                                                                                                   [ 94%]
tests/test_output.py::OutputTests::testDisplayProcs PASSED                                                                                                                                                                                                                                                  [ 96%]
tests/test_output.py::OutputTests::testDisplayServices PASSED                                                                                                                                                                                                                                               [ 97%]
tests/test_output.py::OutputTests::testDisplayShows PASSED                                                                                                                                                                                                                                                  [ 98%]
tests/test_output.py::OutputTests::testDisplaySubscriptions PASSED                                                                                                                                                                                                                                          [100%]

================================================================================================================================================= tests coverage ==================================================================================================================================================
________________________________________________________________________________________________________________________________ coverage: platform darwin, python 3.13.2-final-0 _________________________________________________________________________________________________________________________________

Name                   Stmts   Miss   Cover   Missing
-----------------------------------------------------
cueadmin/__init__.py       0      0 100.00%
cueadmin/__main__.py      11     11   0.00%   19-38
cueadmin/common.py       457    120  73.74%   63-73, 437-478, 495, 505, 510, 514, 518-519, 527-532, 555-557, 559, 569-570, 573-578, 583, 604-621, 647-650, 655-658, 663-666, 671-674, 681-682, 689-690, 699-702, 707-718, 723-753
cueadmin/format.py        34      0 100.00%
cueadmin/output.py        88      1  98.86%   354
cueadmin/util.py          39     26  33.33%   33-38, 52, 67-89
-----------------------------------------------------
TOTAL                    629    158  74.88%
=============================================================================================================================================== 76 passed in 0.25s ================================================================================================================================================

@ramonfigueiredo
Copy link
Collaborator Author

black cueadmin tests && isort cueadmin tests

All done! ✨ 🍰 ✨

@ramonfigueiredo
Copy link
Collaborator Author

@lithorus

FYI ..

I will update the CI/CD for tests of cueman and cueadmin in another pull request.

@ramonfigueiredo
Copy link
Collaborator Author

@DiegoTavares / @lithorus
Ready for review!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants