feat: Add comprehensive Python testing infrastructure with Poetry - #15
Open
llbbl wants to merge 1 commit into
Open
feat: Add comprehensive Python testing infrastructure with Poetry#15llbbl wants to merge 1 commit into
llbbl wants to merge 1 commit into
Conversation
- Set up Poetry as package manager and migrated dependencies from requirements.txt - Added pytest, pytest-cov, and pytest-mock as development dependencies - Created complete testing directory structure with unit/integration folders - Configured pytest with coverage reporting (80% threshold, HTML/XML output) - Added custom test markers (unit, integration, slow) and shared fixtures - Updated .gitignore with comprehensive Python and testing exclusions - Created validation tests to verify infrastructure setup works correctly
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.
Add Comprehensive Python Testing Infrastructure
Summary
This PR establishes a complete testing infrastructure for the Hadoop JMX Exporter project, providing a solid foundation for writing and running tests.
Changes Made
Package Management
requirements.txttopyproject.tomlpoetry.lockfile for reproducible dependency managementTesting Framework
pytest-covfor coverage reportingpytest-mockfor enhanced mocking capabilitiespyproject.toml:unit,integration,slowProject Structure
Shared Testing Utilities
conftest.py:temp_dir: Temporary directory managementmock_requests_response: HTTP response mockingsample_jmx_response: Sample JMX data for testingmock_prometheus_registry: Prometheus registry mockingsample_config: Configuration data for testsmock_yaml_config: YAML configuration file creationreset_prometheus_registry: Auto-cleanup for Prometheus metricsCoverage Configuration
htmlcov/directoryDevelopment Environment
.gitignorewith comprehensive exclusions:.pytest_cache, coverage reports)How to Run Tests
Install Dependencies
Run All Tests
Run Tests by Category
Generate Coverage Reports
Validation
The setup includes infrastructure validation tests (
test_infrastructure.py) that verify:Next Steps
With this testing infrastructure in place, developers can now:
tests/unit/)tests/integration/)The infrastructure is designed to grow with the project while maintaining consistency and best practices.
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com