Complete pytest configuration for test suite standardization#277
Complete pytest configuration for test suite standardization#277github-actions[bot] wants to merge 2 commits intomainfrom
Conversation
- Add [tool.pytest.ini_options] section to pyproject.toml - Configure verbose output (-v) by default - Enable strict marker and config enforcement - Define test discovery patterns (test_*.py, Test*, test_*) - Add 'slow' marker for future test categorization - Document pytest configuration in README Completes pytest-xdist setup that was partially implemented. pytest-xdist dependency was already in pyproject.toml and documented in README, but lacked pytest configuration. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
✨ Submitted to Merge by @abhimehro. It will be added to the merge queue once all branch protection rules pass, there are no merge conflicts with the target branch, and impacted targets for the current PR head commit have been uploaded. See more details here. |
…-ccd7ec87e0958a37
|
👋 Development Partner is reviewing this PR. Will provide feedback shortly. |
There was a problem hiding this comment.
Pull request overview
This PR completes the pytest-xdist setup by adding comprehensive pytest configuration to pyproject.toml. The configuration standardizes test execution behavior across development and CI environments with sensible defaults including verbose output, strict marker/config enforcement, and test discovery patterns. The PR addresses issue #275 and its duplicates by providing the final missing piece of the parallel execution infrastructure, which was already substantially implemented.
Changes:
- Added
[tool.pytest.ini_options]section topyproject.tomlwith test discovery patterns, default verbosity, and strict validation flags - Updated README.md to document the new pytest configuration location and default behavior
- Defined a "slow" marker for future test categorization
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pyproject.toml | Added comprehensive pytest configuration with test paths, discovery patterns, default options (-v, --strict-markers, --strict-config), and marker definitions |
| README.md | Added documentation noting pytest configuration location in pyproject.toml and default verbose output behavior |
Goal and Rationale
Completed the pytest-xdist setup by adding missing pytest configuration to
pyproject.toml. While pytest-xdist dependency was already present and documented, the project lacked standardized pytest configuration for consistent test execution behavior.This addresses issue #275 by providing the missing configuration piece, though I discovered that most of the parallel execution infrastructure was already in place.
Approach
Added comprehensive pytest configuration to
pyproject.toml:Updated README to reference the new pytest configuration location and explain the defaults.
Impact
What Changed:
pyproject.toml: Added[tool.pytest.ini_options]section with sensible defaultsREADME.md: Added note about pytest configuration location and defaultsWhat Was Fixed:
Developer Experience Improvements:
-vflagValidation
Testing Approach:
.github/actions/daily-perf-improver/build-steps/action.yml) already usespytest -n auto, confirming parallel execution infrastructure is in placeSuccess Criteria Met:
Note: I could not run the tests locally due to network restrictions in the CI environment, but the configuration follows pytest best practices and standard conventions.
Context: Issue #275 Analysis
During implementation, I discovered that pytest-xdist is substantially already implemented:
.github/actions/daily-perf-improver/build-steps/action.ymlline 45 usespytest -n autoIssue #275 and related duplicates (#264, #258, #247) can likely be closed as substantially complete once this PR merges. The main missing piece was the pytest configuration, which is now added.
Future Work
With this configuration in place, future enhancements become easier:
@pytest.mark.slowfor long-running tests, then run withpytest -m "not slow"for fast feedbackRelated Issues
Closes #275(and duplicates #264, #258, #247) - pytest-xdist parallel executionContributes to backlog cleanup identified in Daily Backlog Burner Discussion #221