test: add staged pytest integration suite#182
Conversation
There was a problem hiding this comment.
Pull request overview
This PR replaces ad hoc integration runs with a pytest-native staged integration suite, adds pytest-xdist as a dev dependency, and fixes a duplicate-log issue by setting propagate = False on the plexe logger in setup_logging().
Changes:
- Adds a three-stage pytest integration suite (
test_stage1_seed,test_stage2_search,test_stage3_eval_predict) with shared fixtures/helpers in a newconftest.py, driven by a new shell entrypoint script - Adds
pytest-xdist ^3.8.0as a dev dependency and declares the three integration stage markers inpyproject.toml - Fixes duplicate log output by setting
package_logger.propagate = Falseinsetup_logging(), and guardsTestAgentFeedbackIntegrationwith@pytest.mark.skipifwhen pyspark is unavailable
Reviewed changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
tests/integration/conftest.py |
Shared session-scoped fixtures, helper functions, and the integration environment setup for all staged tests |
tests/integration/test_stage1_seed.py |
Stage 1: builds seed checkpoints (phases 1–3) |
tests/integration/test_stage2_search.py |
Stage 2: copies seeds and runs model search (phase 4) |
tests/integration/test_stage3_eval_predict.py |
Stage 3: runs final evaluation, packaging, and predictor inference |
tests/integration/integration_config.yaml |
Integration test config (LLM, Spark, sample sizes) |
scripts/tests/run_integration_staged.sh |
Bash entrypoint that runs the three pytest stages sequentially |
plexe/config.py |
Fixes duplicate log output by disabling propagation on the plexe logger |
plexe/execution/dataproc/session.py |
Updates a comment to better describe Maven JAR caching behavior |
tests/unit/test_config.py |
Adds unit test verifying setup_logging() disables propagation |
tests/unit/agents/test_feedback.py |
Adds @pytest.mark.skipif guard and pyspark-conditional config fixture |
tests/unit/agents/__init__.py |
New __init__.py for the agents unit test package |
pyproject.toml |
Adds pytest-xdist ^3.8.0 dev dependency and integration stage markers |
poetry.lock |
Lockfile update for execnet + pytest-xdist |
Makefile |
Adds test-integration and test-integration-verbose targets |
CONTRIBUTING.md |
Documents the new staged integration workflow for contributors |
AGENTS.md |
Adds make test-integration to the quick reference |
tests/CODE_INDEX.md |
Updated documentation index for new and moved test files |
Comments suppressed due to low confidence (1)
tests/unit/agents/test_feedback.py:109
- The
mock_configfixture is defined insideTestAgentFeedbackIntegration, which is already guarded by@pytest.mark.skipif(not PYSPARK_AVAILABLE, ...). This means the fixture body only executes whenPYSPARK_AVAILABLEisTrue. The inner checkif importlib.util.find_spec("pyspark") is None:at line 107 can therefore never be True when the fixture runs, making lines 107–108 dead code that will never execute. This dead code should be removed to avoid confusion.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Greptile SummaryThis PR introduces a pytest-native staged integration suite that replaces ad hoc integration runs with a structured 3-stage workflow and significantly improves the contributor experience. Key improvements:
Architecture:
Testing approach: Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| scripts/tests/run_integration_staged.sh | New bash script orchestrating 3-stage pytest integration suite with proper error handling, cleanup traps, and dependency validation |
| tests/integration/conftest.py | Comprehensive fixture module providing seed workflow builders, checkpoint copying with path rewriting, and predictor loading utilities |
| tests/integration/test_stage1_seed.py | Stage 1 tests build reusable checkpoints through phase 3, properly asserting pause behavior and checkpoint existence |
| tests/integration/test_stage2_search.py | Stage 2 tests copy seeds, resume workflows with model-specific filtering, and verify search completion without evaluation |
| tests/integration/test_stage3_eval_predict.py | Stage 3 tests complete workflow execution, validate packaged artifacts, and run inference checks via dynamically loaded predictors |
| plexe/workflow.py | Added _apply_allowed_model_types_on_resume() to filter checkpoint model types on resume, with proper error handling for empty intersections |
| plexe/config.py | Set package_logger.propagate = False to prevent duplicate log output when pytest live logging is enabled |
| tests/unit/workflow/test_resume_model_type_filtering.py | Comprehensive unit tests for model type filtering on resume, covering filtering, empty checkpoint handling, and error cases |
Last reviewed commit: 05c45d7
9894375 to
2df2242
Compare
|
@greptileai please review again with latest changes |
This PR replaces ad hoc integration runs with a pytest-native staged integration suite and a single developer entrypoint, and cleans up verbose integration logging output. The aim is to give contributors one simple pre-PR integration workflow that reuses checkpoints across stages while keeping terminal output readable.
Testing