feat: Add comprehensive Python testing infrastructure #4
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.
Add Complete Python Testing Infrastructure
Summary
This PR establishes a comprehensive testing infrastructure for the OmniIsaacGymEnvs project, providing developers with a complete and ready-to-use testing environment.
Changes Made
Package Management
pyproject.tomlconfigurationsetup.pyto Poetry formatpytest,pytest-cov,pytest-mockas development dependenciesTesting Configuration
Comprehensive pytest configuration in
pyproject.tomlwith:unit,integration, andslowtestsCoverage configuration with:
Directory Structure
tests/- Main test directorytests/unit/- Unit teststests/integration/- Integration tests__init__.pyfilesShared Testing Fixtures
conftest.pywith fixtures for:Infrastructure Validation
test_setup_validation.py) that verifies:Additional Setup
Updated
.gitignorewith comprehensive entries for:.pytest_cache/, coverage files)Added missing
__init__.pyfiles in:omniisaacgymenvs/robots/omniisaacgymenvs/utils/How to Use
Installation
Running Tests
Coverage Reports
htmlcov/index.htmlin browser for detailed coverage reportcoverage.xmlfor CI/CD integrationTesting Infrastructure Features
Markers
@pytest.mark.unit- Unit tests (fast, isolated)@pytest.mark.integration- Integration tests (slower, with dependencies)@pytest.mark.slow- Long-running testsKey Fixtures Available
temp_dir- Temporary directory for test filestemp_file- Pre-created temporary filemock_config- Mock robotics environment configurationsample_robot_config- Sample robot configuration datamock_isaac_sim- Mock Isaac Sim simulation contextenv_vars- Temporary environment variable setupConfiguration Highlights
Validation
All infrastructure has been validated through automated tests:
Next Steps
Developers can now:
tests/unit/tests/integration/The testing infrastructure is production-ready and follows Python testing best practices.