From cea140755405f92d2eb61e1706dcb6f7ae25d5c0 Mon Sep 17 00:00:00 2001 From: Filip Skokan Date: Fri, 10 Apr 2026 18:38:38 +0200 Subject: [PATCH] wip Signed-off-by: Filip Skokan --- .github/actions/undici-wpt-current/action.yml | 56 +++++++++++ .github/actions/undici-wpt-legacy/action.yml | 37 ++++++++ .github/workflows/daily-wpt-fyi.yml | 94 ++++++++++++++----- test/wpt/test-compression.js | 4 + 4 files changed, 165 insertions(+), 26 deletions(-) create mode 100644 .github/actions/undici-wpt-current/action.yml create mode 100644 .github/actions/undici-wpt-legacy/action.yml diff --git a/.github/actions/undici-wpt-current/action.yml b/.github/actions/undici-wpt-current/action.yml new file mode 100644 index 00000000000..b4e35b7f00e --- /dev/null +++ b/.github/actions/undici-wpt-current/action.yml @@ -0,0 +1,56 @@ +name: Run undici WPT (current) +description: Runs undici WPT tests for undici >= 7 and merges results into the Node.js WPT report + +inputs: + undici-version: + required: true + description: undici version tag to checkout + wpt-report: + required: true + description: Path to the Node.js WPT report to merge into + +runs: + using: composite + steps: + - name: Checkout undici + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + repository: nodejs/undici + persist-credentials: false + path: undici + clean: false + ref: ${{ inputs.undici-version }} + - name: Prepare WPT checkout + shell: bash + run: | + rm -rf undici/test/web-platform-tests/wpt + mv test/fixtures/wpt undici/test/web-platform-tests/wpt + - name: Configure hosts + shell: bash + working-directory: undici/test/web-platform-tests/wpt + run: python3 wpt make-hosts-file | sudo tee -a /etc/hosts + - name: Install dependencies + shell: bash + working-directory: undici + run: npm install + - name: Run WPT + shell: bash + working-directory: undici + env: + CI: 'true' + WPT_REPORT: ${{ github.workspace }}/undici/wptreport.json + run: npm run test:wpt || true + - name: Merge report + shell: bash + env: + NODE_WPT_REPORT: ${{ inputs.wpt-report }} + UNDICI_WPT_REPORT: ${{ github.workspace }}/undici/wptreport.json + run: | + if [ -f "$UNDICI_WPT_REPORT" ]; then + jq -s ' + .[0].results += .[1].results | + .[0].time_end = .[1].time_end | + .[0] + ' "$NODE_WPT_REPORT" "$UNDICI_WPT_REPORT" > "${NODE_WPT_REPORT}.tmp" + mv "${NODE_WPT_REPORT}.tmp" "$NODE_WPT_REPORT" + fi diff --git a/.github/actions/undici-wpt-legacy/action.yml b/.github/actions/undici-wpt-legacy/action.yml new file mode 100644 index 00000000000..77a8b3fee46 --- /dev/null +++ b/.github/actions/undici-wpt-legacy/action.yml @@ -0,0 +1,37 @@ +name: Run undici WPT (legacy) +description: Runs undici WPT tests for undici < 7 and appends results to the Node.js WPT report + +inputs: + undici-version: + required: true + description: undici version tag to checkout + wpt-report: + required: true + description: Path to the Node.js WPT report + +runs: + using: composite + steps: + - name: Checkout undici + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + repository: nodejs/undici + persist-credentials: false + path: undici + clean: false + ref: ${{ inputs.undici-version }} + - name: Prepare WPT checkout + shell: bash + run: | + rm -rf undici/test/wpt/tests + mv test/fixtures/wpt undici/test/wpt/tests + - name: Install dependencies + shell: bash + working-directory: undici + run: npm install + - name: Run WPT + shell: bash + working-directory: undici + env: + WPT_REPORT: ${{ inputs.wpt-report }} + run: npm run test:wpt || true diff --git a/.github/workflows/daily-wpt-fyi.yml b/.github/workflows/daily-wpt-fyi.yml index 5ec2662d21d..bc505351355 100644 --- a/.github/workflows/daily-wpt-fyi.yml +++ b/.github/workflows/daily-wpt-fyi.yml @@ -96,6 +96,48 @@ jobs: echo "WPT_REPORT=$(pwd)/out/wpt/wptreport.json" >> $GITHUB_ENV fi + # undici WPT Runner + - name: Set env.UNDICI_VERSION + if: ${{ env.WPT_REPORT != '' }} + run: | + UNDICI_VERSION=$(jq -r '.version' < deps/undici/src/package.json) + echo "UNDICI_VERSION=v$UNDICI_VERSION" >> $GITHUB_ENV + if [ "${UNDICI_VERSION%%.*}" -ge 7 ]; then + echo "UNDICI_WPT=current" >> $GITHUB_ENV + else + echo "UNDICI_WPT=legacy" >> $GITHUB_ENV + fi + # Checkout composite actions from the default branch since the + # version-specific checkout above overwrites .github/actions/ + - name: Checkout undici WPT actions + if: ${{ env.WPT_REPORT != '' }} + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + sparse-checkout: | + .github/actions/undici-wpt-current + .github/actions/undici-wpt-legacy + sparse-checkout-cone-mode: false + persist-credentials: false + path: _wpt_actions + clean: false + - name: Place undici WPT actions + if: ${{ env.WPT_REPORT != '' }} + run: | + mkdir -p .github/actions + cp -r _wpt_actions/.github/actions/undici-wpt-* .github/actions/ + - name: Run undici WPT (current) + if: ${{ env.UNDICI_WPT == 'current' }} + uses: ./.github/actions/undici-wpt-current + with: + undici-version: ${{ env.UNDICI_VERSION }} + wpt-report: ${{ env.WPT_REPORT }} + - name: Run undici WPT (legacy) + if: ${{ env.UNDICI_WPT == 'legacy' }} + uses: ./.github/actions/undici-wpt-legacy + with: + undici-version: ${{ env.UNDICI_VERSION }} + wpt-report: ${{ env.WPT_REPORT }} + # Upload artifacts - name: Clone report for upload if: ${{ env.WPT_REPORT != '' }} @@ -108,31 +150,31 @@ jobs: path: out/wpt/wptreport-*.json name: WPT Report for ${{ steps.setup-node.outputs.node-version }} if-no-files-found: error - - name: Upload WPT Report to wpt.fyi API - if: ${{ env.WPT_REPORT != '' }} - env: - WPT_FYI_USERNAME: ${{ vars.WPT_FYI_USERNAME }} - WPT_FYI_PASSWORD: ${{ secrets.WPT_FYI_PASSWORD }} - working-directory: out/wpt - run: | - gzip wptreport.json - echo "## Node.js ${{ steps.setup-node.outputs.node-version }}" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "WPT Revision: [\`${WPT_REVISION:0:7}\`](https://github.com/web-platform-tests/wpt/commits/$WPT_REVISION)" >> $GITHUB_STEP_SUMMARY - for WPT_FYI_ENDPOINT in "https://wpt.fyi/api/results/upload" "https://staging.wpt.fyi/api/results/upload" - do - response=$(curl -sS \ - -u "$WPT_FYI_USERNAME:$WPT_FYI_PASSWORD" \ - -F "result_file=@wptreport.json.gz" \ - -F "labels=master" \ - $WPT_FYI_ENDPOINT) + # - name: Upload WPT Report to wpt.fyi API + # if: ${{ env.WPT_REPORT != '' }} + # env: + # WPT_FYI_USERNAME: ${{ vars.WPT_FYI_USERNAME }} + # WPT_FYI_PASSWORD: ${{ secrets.WPT_FYI_PASSWORD }} + # working-directory: out/wpt + # run: | + # gzip wptreport.json + # echo "## Node.js ${{ steps.setup-node.outputs.node-version }}" >> $GITHUB_STEP_SUMMARY + # echo "" >> $GITHUB_STEP_SUMMARY + # echo "WPT Revision: [\`${WPT_REVISION:0:7}\`](https://github.com/web-platform-tests/wpt/commits/$WPT_REVISION)" >> $GITHUB_STEP_SUMMARY + # for WPT_FYI_ENDPOINT in "https://wpt.fyi/api/results/upload" "https://staging.wpt.fyi/api/results/upload" + # do + # response=$(curl -sS \ + # -u "$WPT_FYI_USERNAME:$WPT_FYI_PASSWORD" \ + # -F "result_file=@wptreport.json.gz" \ + # -F "labels=master" \ + # $WPT_FYI_ENDPOINT) - if [[ $response =~ Task\ ([0-9]+)\ added\ to\ queue ]]; then - run_id=${BASH_REMATCH[1]} - origin=${WPT_FYI_ENDPOINT%/api/results/upload} + # if [[ $response =~ Task\ ([0-9]+)\ added\ to\ queue ]]; then + # run_id=${BASH_REMATCH[1]} + # origin=${WPT_FYI_ENDPOINT%/api/results/upload} - echo "" >> $GITHUB_STEP_SUMMARY - echo "Run ID [\`$run_id\`]($origin/api/runs/$run_id) added to the processor queue at ${origin:8}" >> $GITHUB_STEP_SUMMARY - echo "- [View on the ${origin:8} dashboard]($origin/results?run_id=$run_id)" >> $GITHUB_STEP_SUMMARY - fi - done + # echo "" >> $GITHUB_STEP_SUMMARY + # echo "Run ID [\`$run_id\`]($origin/api/runs/$run_id) added to the processor queue at ${origin:8}" >> $GITHUB_STEP_SUMMARY + # echo "- [View on the ${origin:8} dashboard]($origin/results?run_id=$run_id)" >> $GITHUB_STEP_SUMMARY + # fi + # done diff --git a/test/wpt/test-compression.js b/test/wpt/test-compression.js index 23800734922..15cf93a546e 100644 --- a/test/wpt/test-compression.js +++ b/test/wpt/test-compression.js @@ -1,5 +1,9 @@ 'use strict'; +const { skip } = require('../common'); + +skip('begone'); + const { WPTRunner } = require('../common/wpt'); const runner = new WPTRunner('compression');