-
Notifications
You must be signed in to change notification settings - Fork 114
Fix / re-org CI #288
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
Fix / re-org CI #288
Conversation
Michael D. Brown seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
This comment was marked as outdated.
This comment was marked as outdated.
Hey Mike, here's a recap of what I was trying to work on that Riccardo rolled back in PR #271. There is a lot of existing code there that might be useful to cherry pick. Here were my objectives and some of the reasoning behind how I modified the CI (obviously Claude Code summarized this). You could probably give each of these to Claude Code one at a time and it would be able to follow all these steps with ease. Suggested Improvements for PR #288Excellent work on reorganizing the CI workflows! Once PR #285 is merged, the mypy type checking issues (including the fuzzer component) will no longer be a blocker, so this reorganization comes at a perfect time. Here are some opportunities to further optimize the workflow efficiency: 1. Reduce Duplication in
|
Thanks I'll take a look! |
restore-keys: | | ||
${{ runner.os }}-uv-integration-${{ matrix.component }}- | ||
${{ runner.os }}-uv- | ||
|
||
- name: Download Wasm runtime | ||
if: matrix.component == 'seed-gen' && steps.should_test.outputs.test != 'false' | ||
run: wget https://github.com/vmware-labs/webassembly-language-runtimes/releases/download/python%2F3.12.0%2B20231211-040d5a6/python-3.12.0.wasm | ||
working-directory: seed-gen | ||
|
||
- name: Install integration test dependencies | ||
if: steps.should_test.outputs.test != 'false' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y codequery ripgrep | ||
make install-cscope | ||
|
||
- name: Prepare environment | ||
if: steps.should_test.outputs.test != 'false' | ||
run: | | ||
export DEBIAN_FRONTEND=noninteractive | ||
sudo apt-get update | ||
sudo mkdir -p /crs_scratch | ||
sudo chmod -R 777 /crs_scratch | ||
|
||
- name: Setup ${{ matrix.component }} component | ||
if: steps.should_test.outputs.test != 'false' | ||
run: | | ||
uv sync --all-extras --frozen | ||
uv pip install --isolated pytest-html>=4.1.1 pytest-cov>=6.0.0 | ||
working-directory: ${{ matrix.component }} | ||
|
||
- name: Run program-model libpng integration test | ||
if: matrix.component == 'program-model' && steps.should_test.outputs.test != 'false' | ||
run: | | ||
uv run --frozen pytest -svv --runintegration tests/c/test_libpng.py \ | ||
--junit-xml=integration-test-results.xml \ | ||
--html=integration-test-report.html \ | ||
--self-contained-html \ | ||
--cov=${{ matrix.coverage_module }} \ | ||
--cov-report=xml:integration-coverage.xml \ | ||
--cov-report=html:integration-htmlcov \ | ||
--cov-report=term | ||
env: | ||
PYTHON_WASM_BUILD_PATH: "python-3.12.0.wasm" | ||
working-directory: ${{ matrix.component }} | ||
timeout-minutes: 30 | ||
|
||
- name: Run integration tests on ${{ matrix.component }} | ||
if: matrix.component != 'program-model' && steps.should_test.outputs.test != 'false' | ||
run: | | ||
uv run --frozen pytest -svv --runintegration \ | ||
--junit-xml=integration-test-results.xml \ | ||
--html=integration-test-report.html \ | ||
--self-contained-html \ | ||
--cov=${{ matrix.coverage_module }} \ | ||
--cov-report=xml:integration-coverage.xml \ | ||
--cov-report=html:integration-htmlcov \ | ||
--cov-report=term | ||
env: | ||
PYTHON_WASM_BUILD_PATH: "python-3.12.0.wasm" | ||
working-directory: ${{ matrix.component }} | ||
timeout-minutes: 30 | ||
|
||
- name: Generate integration test summary | ||
if: always() && steps.should_test.outputs.test != 'false' | ||
run: | | ||
echo "### Integration Test Results: ${{ matrix.component }}" >> $GITHUB_STEP_SUMMARY | ||
echo "" >> $GITHUB_STEP_SUMMARY | ||
if [ -f ${{ matrix.component }}/integration-test-results.xml ]; then | ||
python -c " | ||
import xml.etree.ElementTree as ET | ||
tree = ET.parse('${{ matrix.component }}/integration-test-results.xml') | ||
root = tree.getroot() | ||
tests = root.get('tests', '0') | ||
failures = root.get('failures', '0') | ||
errors = root.get('errors', '0') | ||
skipped = root.get('skipped', '0') | ||
time = root.get('time', '0') | ||
print(f'- **Total Tests**: {tests}') | ||
print(f'- **Passed**: {int(tests) - int(failures) - int(errors) - int(skipped)}') | ||
print(f'- **Failed**: {failures}') | ||
print(f'- **Errors**: {errors}') | ||
print(f'- **Skipped**: {skipped}') | ||
print(f'- **Duration**: {float(time):.2f}s') | ||
" >> $GITHUB_STEP_SUMMARY | ||
else | ||
echo "No integration test results found" >> $GITHUB_STEP_SUMMARY | ||
fi | ||
|
||
- name: Upload integration test results | ||
if: always() && steps.should_test.outputs.test != 'false' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: integration-test-results-${{ matrix.component }}-py${{ matrix.python }} | ||
path: | | ||
${{ matrix.component }}/integration-test-results.xml | ||
${{ matrix.component }}/integration-test-report.html | ||
${{ matrix.component }}/integration-coverage.xml | ||
${{ matrix.component }}/integration-htmlcov/ | ||
retention-days: 30 |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
One of the final two tests that are failing is due to the commit The other needs diagnosing but can be done separately from this PR. I've made an issue for it #324 |
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.
LGTM
closes #287
I've fixed up the CI organization into unit tests that run on every commit and component level / system level integration tests. The integration tests run nightly or when labelled.