Skip to content

Commit 0a31c6e

Browse files
[cueman] Add comprehensive test infrastructure and update documentation for cueman
- Fix pylint issues in `test_integration_workflows.py` * Add module docstring and fix import style * Remove trailing whitespace and add proper spacing * Achieve 10/10 pylint rating - Fix SystemExit test failures in integration tests: * Update test_batch_operation_workflow to use comma-separated job format * Mock displayLayers function properly in workflow tests * Remove incorrect SystemExit expectations where not applicable * All tests now pass successfully - Add pytest and test dependencies to pyproject.toml: * Add test optional dependencies: pytest, pytest-cov, pytest-mock, mock, pyfakefs * Add dev optional dependencies including pylint, black, isort * Configure pytest.ini_options with test discovery and execution settings * Add coverage configuration with HTML/XML report generation * Include test markers for unit, integration, and slow tests - Create test infrastructure tools: * Add `run_tests.sh` convenience script for running tests with coverage options * Add `tox.ini` for multi-Python version testing and code quality checks * Include GitHub Actions workflow example in pyproject.toml comments - Update documentation comprehensively: * Enhance README.md with detailed testing section covering tests * Add test infrastructure description and development workflow * Update docs/reference/tools/cueman.md with development and testing section * Enhance docs/tutorials/cueman-tutorial.md with contribution information - Improve development experience: * Document coverage reporting capabilities * Provide clear testing and development guidelines * Include CI/CD integration documentation * Add code quality tool usage instructions All tests pass with comprehensive coverage reporting and lint-free code.
2 parents 3d54b04 + 658002d commit 0a31c6e

File tree

11 files changed

+499
-297
lines changed

11 files changed

+499
-297
lines changed

cueman/README.md

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ cueman -v -info job_name # Enable verbose logging
391391

392392
## Running Tests
393393

394-
Cueman includes a comprehensive test suite with 42+ tests covering unit tests and integration workflows.
394+
Cueman includes a comprehensive test suite with tests covering unit tests and integration workflows.
395395

396396
### Quick Start
397397

@@ -409,11 +409,11 @@ pytest --cov=cueman --cov-report=term-missing
409409
### Test Infrastructure
410410

411411
**Test Dependencies:**
412-
- `pytest>=8.0.0` - Modern test framework
413-
- `pytest-cov>=4.0.0` - Coverage reporting
414-
- `pytest-mock>=3.10.0` - Enhanced mocking
415-
- `mock>=4.0.0` - Core mocking library
416-
- `pyfakefs>=5.2.3` - Filesystem mocking
412+
- `pytest` - Modern test framework
413+
- `pytest` - Coverage reporting
414+
- `pytest-mock` - Enhanced mocking
415+
- `mock` - Core mocking library
416+
- `pyfakefs` - Filesystem mocking
417417

418418
**Test Types:**
419419
- **Unit tests** - Function-level testing (`tests/test_main.py`)
@@ -540,8 +540,6 @@ Source code available in /opt/opencue/cueman/
540540

541541
## Contributing
542542

543-
We welcome contributions to Cueman! The project includes comprehensive development infrastructure:
544-
545543
### Development Setup
546544

547545
```bash
@@ -556,7 +554,7 @@ pip install -e ".[dev]"
556554
### Testing and Quality
557555

558556
```bash
559-
# Run comprehensive test suite (42+ tests)
557+
# Run comprehensive test suite (tests)
560558
pytest --cov=cueman --cov-report=term-missing
561559

562560
# Code formatting and linting
@@ -565,21 +563,4 @@ pylint cueman tests
565563

566564
# Multi-environment testing
567565
tox
568-
```
569-
570-
### Project Quality
571-
572-
- **Comprehensive test coverage** with unit and integration tests
573-
- **Modern testing infrastructure** using pytest, coverage, and CI/CD
574-
- **Code quality tools** including pylint, black, and isort
575-
- **Multi-Python version support** via tox
576-
- **Docker support** for containerized development
577-
578-
For detailed contribution guidelines, see [CONTRIBUTING.md](CONTRIBUTING.md).
579-
580-
### Get Involved
581-
582-
- **Report Issues**: [GitHub Issues](https://github.com/AcademySoftwareFoundation/OpenCue/issues)
583-
- **Contribute Code**: Submit pull requests with tests and documentation
584-
- **Improve Documentation**: Help enhance tutorials and reference docs
585-
- **Share Use Cases**: Contribute real-world examples and workflows
566+
```

cueman/cueman/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"""OpenCue Cueman job management tool."""
1717

1818
try:
19-
from importlib.metadata import version, PackageNotFoundError
19+
from importlib.metadata import PackageNotFoundError, version
20+
2021
try:
2122
__version__ = version("opencue_cueman")
2223
except PackageNotFoundError:
@@ -26,6 +27,7 @@
2627
# Python < 3.8
2728
try:
2829
import pkg_resources
30+
2931
__version__ = pkg_resources.get_distribution("opencue_cueman").version
3032
except Exception:
3133
__version__ = "0.0.0+unknown"

cueman/cueman/__main__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616
"""Entrypoint for Cueman tool."""
1717

1818

19-
from __future__ import absolute_import
20-
from __future__ import division
21-
from __future__ import print_function
19+
from __future__ import absolute_import, division, print_function
2220

2321
import logging
2422
import sys
@@ -27,7 +25,9 @@
2725
from cueman import main as opencueman
2826

2927
# Suppress protobuf version warnings
30-
warnings.filterwarnings("ignore", category=UserWarning, module="google.protobuf.runtime_version")
28+
warnings.filterwarnings(
29+
"ignore", category=UserWarning, module="google.protobuf.runtime_version"
30+
)
3131

3232
logger = logging.getLogger("opencue.tools.cueman")
3333

@@ -37,5 +37,5 @@ def main():
3737
opencueman.main(sys.argv)
3838

3939

40-
if __name__ == '__main__':
40+
if __name__ == "__main__":
4141
main()

0 commit comments

Comments
 (0)