Repository navigation
fix: make pytest basetemp unique per session to prevent cross-session conflicts - #387
Conversation
ⓘ You are approaching your monthly quota for Qodo. Upgrade your plan Review Summary by QodoMake pytest basetemp unique per session to prevent conflicts
WalkthroughsDescription• Prevent cross-session temp file conflicts by generating unique basetemp • Remove hardcoded basetemp from pytest.ini configuration • Implement pytest_configure hook to assign unique directory per session • Use UUID suffix to ensure isolation between parallel test sessions Diagramflowchart LR
A["pytest.ini<br/>hardcoded basetemp"] -->|removed| B["pytest_configure hook"]
B -->|generates unique| C["basetemp with UUID"]
C -->|prevents| D["cross-session conflicts"]
File Changes1. conftest.py
|
WalkthroughA new pytest hook in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Code Review by Qodo
1. Hardcoded /tmp basetemp
|
|
Report bugs in Issues Welcome! 🎉This pull request will be automatically processed with the following features: 🔄 Automatic Actions
📋 Available CommandsPR Status Management
Review & Approval
Testing & Validation
Container Operations
Cherry-pick Operations
Label Management
✅ Merge RequirementsThis PR will be automatically approved when the following conditions are met:
📊 Review ProcessApprovers and ReviewersApprovers:
Reviewers:
Available Labels
AI Features
💡 Tips
For more information, please refer to the project documentation or contact the maintainers. |
… conflicts The fixed --basetemp=/tmp/pytest was shared across all test sessions. When multiple sessions ran in parallel, one session's teardown (shutil.rmtree) could delete another session's temp files (e.g., SSL cert files). Each session now gets a unique basetemp via pytest_configure hook.
Replace hardcoded /tmp/ with tempfile.gettempdir() for platform consistency. Remove outdated --basetemp=/tmp/pytest from documentation snippets to match the current pytest.ini configuration.
|
Persistent review updated to latest commit 3920879 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/pytest-options-and-markers.md`:
- Line 56: The HTML output still contains the old hardcoded
--basetemp=/tmp/pytest entry; regenerate the corresponding
troubleshooting-and-diagnostics.html from the updated
pytest-options-and-markers.md so the HTML reflects the new auto-generated
basetemp behavior (mentioning the session-specific path and the override via
--basetemp=/path), then commit the regenerated HTML to the repo to keep docs
consistent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 6d8dcb93-94d0-4492-bb01-3cf3df23d12a
📒 Files selected for processing (12)
conftest.pydocs/automation-and-release.mddocs/container-and-openshift-job-execution.mddocs/development-workflow.mddocs/introduction.mddocs/optional-integrations-and-secrets.mddocs/project-structure.mddocs/pytest-options-and-markers.mddocs/quickstart-first-run.mddocs/runtime-configuration.mddocs/troubleshooting-and-diagnostics.mdpytest.ini
💤 Files with no reviewable changes (10)
- pytest.ini
- docs/introduction.md
- docs/optional-integrations-and-secrets.md
- docs/project-structure.md
- docs/container-and-openshift-job-execution.md
- docs/automation-and-release.md
- docs/quickstart-first-run.md
- docs/troubleshooting-and-diagnostics.md
- docs/runtime-configuration.md
- docs/development-workflow.md
|
Persistent review updated to latest commit 3920879 |
|
/verified |
|
Cherry-pick requested for PR: |
|
/lgtm |
… conflicts (#387) * fix: make pytest basetemp unique per session to prevent cross-session conflicts The fixed --basetemp=/tmp/pytest was shared across all test sessions. When multiple sessions ran in parallel, one session's teardown (shutil.rmtree) could delete another session's temp files (e.g., SSL cert files). Each session now gets a unique basetemp via pytest_configure hook. * fix: use tempfile.gettempdir() for basetemp and update docs Replace hardcoded /tmp/ with tempfile.gettempdir() for platform consistency. Remove outdated --basetemp=/tmp/pytest from documentation snippets to match the current pytest.ini configuration.
|
Cherry-pick conflicts were resolved by AI Cherry-picked PR fix: make pytest basetemp unique per session to prevent cross-session conflicts into v2.11: #389 Manual verification is required — please review the changes and test before merging. |
… conflicts (#387) * fix: make pytest basetemp unique per session to prevent cross-session conflicts The fixed --basetemp=/tmp/pytest was shared across all test sessions. When multiple sessions ran in parallel, one session's teardown (shutil.rmtree) could delete another session's temp files (e.g., SSL cert files). Each session now gets a unique basetemp via pytest_configure hook. * fix: use tempfile.gettempdir() for basetemp and update docs Replace hardcoded /tmp/ with tempfile.gettempdir() for platform consistency. Remove outdated --basetemp=/tmp/pytest from documentation snippets to match the current pytest.ini configuration.
|
Cherry-pick conflicts were resolved by AI Cherry-picked PR fix: make pytest basetemp unique per session to prevent cross-session conflicts into v2.10: #390 Manual verification is required — please review the changes and test before merging. |
|
New container for ghcr.io/redhatqe/mtv-api-tests:latest published |
… conflicts (RedHatQE#387) * fix: make pytest basetemp unique per session to prevent cross-session conflicts The fixed --basetemp=/tmp/pytest was shared across all test sessions. When multiple sessions ran in parallel, one session's teardown (shutil.rmtree) could delete another session's temp files (e.g., SSL cert files). Each session now gets a unique basetemp via pytest_configure hook. * fix: use tempfile.gettempdir() for basetemp and update docs Replace hardcoded /tmp/ with tempfile.gettempdir() for platform consistency. Remove outdated --basetemp=/tmp/pytest from documentation snippets to match the current pytest.ini configuration.
The fixed --basetemp=/tmp/pytest was shared across all test sessions. When multiple sessions ran in parallel, one session's teardown (shutil.rmtree) could delete another session's temp files (e.g., SSL cert files).
Each session now gets a unique basetemp via pytest_configure hook.
Summary by CodeRabbit