mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-22 13:32:11 +00:00
## Summary - Add `unmapped` to genhtml `--ignore-errors` flag to fix GH Pages deploy failure - Remove unreachable placeholder block (dead code cleanup) ## Problem PR #11381 added `--ignore-errors source` but genhtml is now failing with a different error: ``` genhtml: ERROR: no data for line:4291, TLA:GNC, file:src/lib/litegraph/src/LGraphNode.ts (use "genhtml --ignore-errors unmapped ..." to bypass this error) ``` This happens when LCOV data references lines that don't map to source (from V8 coverage instrumentation). ## Changes 1. **Add `unmapped` to ignore-errors** — `--ignore-errors source,unmapped` handles both missing source files and unmapped line data 2. **Remove unreachable placeholder block** — The `if [ ! -s coverage/playwright/coverage.lcov ]` check is dead code because the step is already gated on `has-coverage == 'true'`, which only triggers when the merged LCOV exists and is non-empty ## Test plan - [ ] Verify workflow completes successfully on next push to main - [ ] Verify https://comfy-org.github.io/ComfyUI_frontend/ returns 200 Fixes #12229 🤖 Generated with [Claude Code](https://claude.com/claude-code) ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-12273-fix-ci-add-unmapped-to-genhtml-ignore-errors-remove-unreachable-placeholder-3606d73d36508198a4ffddfce3354d4a) by [Unito](https://www.unito.io) --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: GitHub Action <action@github.com>
152 lines
5.4 KiB
YAML
152 lines
5.4 KiB
YAML
name: 'CI: E2E Coverage'
|
|
|
|
on:
|
|
workflow_run:
|
|
workflows: ['CI: Tests E2E']
|
|
types:
|
|
- completed
|
|
|
|
concurrency:
|
|
group: e2e-coverage-${{ github.event.workflow_run.head_sha }}
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
merge:
|
|
if: >
|
|
github.repository == 'Comfy-Org/ComfyUI_frontend' &&
|
|
github.event.workflow_run.conclusion == 'success'
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
outputs:
|
|
has-coverage: ${{ steps.coverage-shards.outputs.has-coverage }}
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup frontend
|
|
uses: ./.github/actions/setup-frontend
|
|
|
|
- name: Download all shard coverage data
|
|
uses: dawidd6/action-download-artifact@0bd50d53a6d7fb5cb921e607957e9cc12b4ce392 # v12
|
|
with:
|
|
run_id: ${{ github.event.workflow_run.id }}
|
|
name: e2e-coverage-shard-.*
|
|
name_is_regexp: true
|
|
path: temp/coverage-shards
|
|
if_no_artifact_found: warn
|
|
|
|
- name: Detect shard coverage data
|
|
id: coverage-shards
|
|
run: |
|
|
if [ -d temp/coverage-shards ] && find temp/coverage-shards -name 'coverage.lcov' -type f | grep -q .; then
|
|
echo "has-coverage=true" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "has-coverage=false" >> "$GITHUB_OUTPUT"
|
|
echo "No E2E coverage shard artifacts found; treating this run as skipped." >> "$GITHUB_STEP_SUMMARY"
|
|
fi
|
|
|
|
- name: Install lcov
|
|
if: steps.coverage-shards.outputs.has-coverage == 'true'
|
|
run: sudo apt-get install -y -qq lcov
|
|
|
|
- name: Merge shard coverage into single LCOV
|
|
if: steps.coverage-shards.outputs.has-coverage == 'true'
|
|
run: |
|
|
mkdir -p coverage/playwright
|
|
LCOV_FILES=$(find temp/coverage-shards -name 'coverage.lcov' -type f)
|
|
ADD_ARGS=""
|
|
for f in $LCOV_FILES; do ADD_ARGS="$ADD_ARGS -a $f"; done
|
|
lcov $ADD_ARGS -o coverage/playwright/coverage.lcov
|
|
wc -l coverage/playwright/coverage.lcov
|
|
|
|
- name: Validate merged coverage
|
|
if: steps.coverage-shards.outputs.has-coverage == 'true'
|
|
run: |
|
|
MERGED_SF=$(grep -c '^SF:' coverage/playwright/coverage.lcov || echo 0)
|
|
MERGED_LH=$(awk -F: '/^LH:/{s+=$2}END{print s+0}' coverage/playwright/coverage.lcov)
|
|
MERGED_LF=$(awk -F: '/^LF:/{s+=$2}END{print s+0}' coverage/playwright/coverage.lcov)
|
|
echo "### Merged coverage" >> "$GITHUB_STEP_SUMMARY"
|
|
echo "- **$MERGED_SF** source files" >> "$GITHUB_STEP_SUMMARY"
|
|
echo "- **$MERGED_LH / $MERGED_LF** lines hit" >> "$GITHUB_STEP_SUMMARY"
|
|
echo "" >> "$GITHUB_STEP_SUMMARY"
|
|
echo "| Shard | Files | Lines Hit |" >> "$GITHUB_STEP_SUMMARY"
|
|
echo "|-------|-------|-----------|" >> "$GITHUB_STEP_SUMMARY"
|
|
for f in $(find temp/coverage-shards -name 'coverage.lcov' -type f | sort); do
|
|
SHARD=$(basename "$(dirname "$f")")
|
|
SHARD_SF=$(grep -c '^SF:' "$f" || echo 0)
|
|
SHARD_LH=$(awk -F: '/^LH:/{s+=$2}END{print s+0}' "$f")
|
|
echo "| $SHARD | $SHARD_SF | $SHARD_LH |" >> "$GITHUB_STEP_SUMMARY"
|
|
if [ "$MERGED_LH" -lt "$SHARD_LH" ]; then
|
|
echo "::error::Merged LH ($MERGED_LH) < shard LH ($SHARD_LH) in $SHARD — possible data loss"
|
|
fi
|
|
done
|
|
|
|
- name: Upload merged coverage data
|
|
if: steps.coverage-shards.outputs.has-coverage == 'true'
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: e2e-coverage
|
|
path: coverage/playwright/
|
|
retention-days: 30
|
|
if-no-files-found: warn
|
|
|
|
- name: Upload E2E coverage to Codecov
|
|
if: steps.coverage-shards.outputs.has-coverage == 'true'
|
|
uses: codecov/codecov-action@1af58845a975a7985b0beb0cbe6fbbb71a41dbad # v5.5.3
|
|
with:
|
|
files: coverage/playwright/coverage.lcov
|
|
flags: e2e
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
fail_ci_if_error: false
|
|
|
|
- name: Generate HTML coverage report
|
|
if: steps.coverage-shards.outputs.has-coverage == 'true'
|
|
run: |
|
|
genhtml coverage/playwright/coverage.lcov \
|
|
-o coverage/html \
|
|
--title "ComfyUI E2E Coverage" \
|
|
--no-function-coverage \
|
|
--precision 1 \
|
|
--ignore-errors source,unmapped
|
|
|
|
- name: Upload HTML report artifact
|
|
if: steps.coverage-shards.outputs.has-coverage == 'true'
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: e2e-coverage-html
|
|
path: coverage/html/
|
|
retention-days: 30
|
|
|
|
deploy:
|
|
needs: merge
|
|
if: >
|
|
github.event.workflow_run.head_branch == 'main' &&
|
|
needs.merge.outputs.has-coverage == 'true' &&
|
|
github.event.workflow_run.event == 'push'
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
pages: write
|
|
id-token: write
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
steps:
|
|
- name: Download HTML report
|
|
uses: actions/download-artifact@v7
|
|
with:
|
|
name: e2e-coverage-html
|
|
path: coverage/html
|
|
|
|
- name: Upload to GitHub Pages
|
|
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
|
|
with:
|
|
path: coverage/html
|
|
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
|