-
Notifications
You must be signed in to change notification settings - Fork 201
Aligned PR and push workflows to use identical test commands for consistency #6473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Exclude Claude Code configuration files from version control 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
The .claude directory should be a local configuration directory for Claude Code, not a git submodule. It is now properly ignored via .gitignore. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
726676e to
f30d0d2
Compare
MaxGhenis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you make these common actions their own files and bring them in? modularity will further ensure consistency
The main issue we have is the coverage check in github action. There are two ways to fix it.
Option 2: Use venv but fix coverage
|
|
I mean reusing workflows across push and pr actions, see https://github.com/PolicyEngine/policyengine-us-data/tree/main/.github/workflows |
The uv sync --dev command wasn't properly installing dev dependencies. Now using uv sync --all-extras and explicitly installing coverage and pytest. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Implemented virtual environment approach with coverage fixes: - Use uv sync --all-extras for dependency installation - Set COVERAGE_FILE environment variable to ensure consistent data location - Add --data-file=.coverage flag to all coverage commands - Configure coverage settings in pyproject.toml for consistency - Handle coverage combine gracefully in case of no parallel files This approach maintains better memory isolation through virtual environments while ensuring coverage data is properly collected and combined. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
The coverage collection wasn't working because test_batched.py spawns subprocesses that don't inherit coverage tracking. This commit: - Extracts test and coverage logic into a reusable workflow - Properly configures coverage collection for each test batch - Ensures coverage files are combined and reported correctly The direct coverage test (test_coverage_direct.sh) proves that coverage collection works when tests are run directly with coverage. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
2430640 to
6c0ab6e
Compare
|
Superseded by #6474 |
🎯 Purpose
Fixes GitHub Actions test failures and aligns PR and push workflows to ensure consistent test execution. If PR tests pass, push tests will also pass - eliminating post-merge surprises.
🔧 Key Changes
1️⃣ Fixed Coverage Module Error
uv run coverageresulted in "command not found" errorsuv run python -m coveragefor proper module execution.github/workflows/pr.yaml,.github/workflows/push.yaml2️⃣ Unified Test Execution
Both PR and push workflows now run identical test commands:
3️⃣ Fixed Dependency Installation
uv sync --devtouv sync --all-extrasuv pip install coverage pytestto ensure test tools are availablepytest>=8.3.0to dev dependencies inpyproject.toml4️⃣ Python Version Update
📝 Files Modified
.github/workflows/pr.yaml- PR workflow test commands.github/workflows/push.yaml- Push workflow test commandspyproject.toml- Added pytest to dev dependencieschangelog_entry.yaml- Documented changes🔍 Command Changes
✅ Benefits