Skip to content

Commit cea1407

Browse files
committed
wip
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
1 parent de5644c commit cea1407

File tree

4 files changed

+165
-26
lines changed

4 files changed

+165
-26
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Run undici WPT (current)
2+
description: Runs undici WPT tests for undici >= 7 and merges results into the Node.js WPT report
3+
4+
inputs:
5+
undici-version:
6+
required: true
7+
description: undici version tag to checkout
8+
wpt-report:
9+
required: true
10+
description: Path to the Node.js WPT report to merge into
11+
12+
runs:
13+
using: composite
14+
steps:
15+
- name: Checkout undici
16+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
17+
with:
18+
repository: nodejs/undici
19+
persist-credentials: false
20+
path: undici
21+
clean: false
22+
ref: ${{ inputs.undici-version }}
23+
- name: Prepare WPT checkout
24+
shell: bash
25+
run: |
26+
rm -rf undici/test/web-platform-tests/wpt
27+
mv test/fixtures/wpt undici/test/web-platform-tests/wpt
28+
- name: Configure hosts
29+
shell: bash
30+
working-directory: undici/test/web-platform-tests/wpt
31+
run: python3 wpt make-hosts-file | sudo tee -a /etc/hosts
32+
- name: Install dependencies
33+
shell: bash
34+
working-directory: undici
35+
run: npm install
36+
- name: Run WPT
37+
shell: bash
38+
working-directory: undici
39+
env:
40+
CI: 'true'
41+
WPT_REPORT: ${{ github.workspace }}/undici/wptreport.json
42+
run: npm run test:wpt || true
43+
- name: Merge report
44+
shell: bash
45+
env:
46+
NODE_WPT_REPORT: ${{ inputs.wpt-report }}
47+
UNDICI_WPT_REPORT: ${{ github.workspace }}/undici/wptreport.json
48+
run: |
49+
if [ -f "$UNDICI_WPT_REPORT" ]; then
50+
jq -s '
51+
.[0].results += .[1].results |
52+
.[0].time_end = .[1].time_end |
53+
.[0]
54+
' "$NODE_WPT_REPORT" "$UNDICI_WPT_REPORT" > "${NODE_WPT_REPORT}.tmp"
55+
mv "${NODE_WPT_REPORT}.tmp" "$NODE_WPT_REPORT"
56+
fi
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Run undici WPT (legacy)
2+
description: Runs undici WPT tests for undici < 7 and appends results to the Node.js WPT report
3+
4+
inputs:
5+
undici-version:
6+
required: true
7+
description: undici version tag to checkout
8+
wpt-report:
9+
required: true
10+
description: Path to the Node.js WPT report
11+
12+
runs:
13+
using: composite
14+
steps:
15+
- name: Checkout undici
16+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
17+
with:
18+
repository: nodejs/undici
19+
persist-credentials: false
20+
path: undici
21+
clean: false
22+
ref: ${{ inputs.undici-version }}
23+
- name: Prepare WPT checkout
24+
shell: bash
25+
run: |
26+
rm -rf undici/test/wpt/tests
27+
mv test/fixtures/wpt undici/test/wpt/tests
28+
- name: Install dependencies
29+
shell: bash
30+
working-directory: undici
31+
run: npm install
32+
- name: Run WPT
33+
shell: bash
34+
working-directory: undici
35+
env:
36+
WPT_REPORT: ${{ inputs.wpt-report }}
37+
run: npm run test:wpt || true

.github/workflows/daily-wpt-fyi.yml

Lines changed: 68 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,48 @@ jobs:
9696
echo "WPT_REPORT=$(pwd)/out/wpt/wptreport.json" >> $GITHUB_ENV
9797
fi
9898
99+
# undici WPT Runner
100+
- name: Set env.UNDICI_VERSION
101+
if: ${{ env.WPT_REPORT != '' }}
102+
run: |
103+
UNDICI_VERSION=$(jq -r '.version' < deps/undici/src/package.json)
104+
echo "UNDICI_VERSION=v$UNDICI_VERSION" >> $GITHUB_ENV
105+
if [ "${UNDICI_VERSION%%.*}" -ge 7 ]; then
106+
echo "UNDICI_WPT=current" >> $GITHUB_ENV
107+
else
108+
echo "UNDICI_WPT=legacy" >> $GITHUB_ENV
109+
fi
110+
# Checkout composite actions from the default branch since the
111+
# version-specific checkout above overwrites .github/actions/
112+
- name: Checkout undici WPT actions
113+
if: ${{ env.WPT_REPORT != '' }}
114+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
115+
with:
116+
sparse-checkout: |
117+
.github/actions/undici-wpt-current
118+
.github/actions/undici-wpt-legacy
119+
sparse-checkout-cone-mode: false
120+
persist-credentials: false
121+
path: _wpt_actions
122+
clean: false
123+
- name: Place undici WPT actions
124+
if: ${{ env.WPT_REPORT != '' }}
125+
run: |
126+
mkdir -p .github/actions
127+
cp -r _wpt_actions/.github/actions/undici-wpt-* .github/actions/
128+
- name: Run undici WPT (current)
129+
if: ${{ env.UNDICI_WPT == 'current' }}
130+
uses: ./.github/actions/undici-wpt-current
131+
with:
132+
undici-version: ${{ env.UNDICI_VERSION }}
133+
wpt-report: ${{ env.WPT_REPORT }}
134+
- name: Run undici WPT (legacy)
135+
if: ${{ env.UNDICI_WPT == 'legacy' }}
136+
uses: ./.github/actions/undici-wpt-legacy
137+
with:
138+
undici-version: ${{ env.UNDICI_VERSION }}
139+
wpt-report: ${{ env.WPT_REPORT }}
140+
99141
# Upload artifacts
100142
- name: Clone report for upload
101143
if: ${{ env.WPT_REPORT != '' }}
@@ -108,31 +150,31 @@ jobs:
108150
path: out/wpt/wptreport-*.json
109151
name: WPT Report for ${{ steps.setup-node.outputs.node-version }}
110152
if-no-files-found: error
111-
- name: Upload WPT Report to wpt.fyi API
112-
if: ${{ env.WPT_REPORT != '' }}
113-
env:
114-
WPT_FYI_USERNAME: ${{ vars.WPT_FYI_USERNAME }}
115-
WPT_FYI_PASSWORD: ${{ secrets.WPT_FYI_PASSWORD }}
116-
working-directory: out/wpt
117-
run: |
118-
gzip wptreport.json
119-
echo "## Node.js ${{ steps.setup-node.outputs.node-version }}" >> $GITHUB_STEP_SUMMARY
120-
echo "" >> $GITHUB_STEP_SUMMARY
121-
echo "WPT Revision: [\`${WPT_REVISION:0:7}\`](https://github.com/web-platform-tests/wpt/commits/$WPT_REVISION)" >> $GITHUB_STEP_SUMMARY
122-
for WPT_FYI_ENDPOINT in "https://wpt.fyi/api/results/upload" "https://staging.wpt.fyi/api/results/upload"
123-
do
124-
response=$(curl -sS \
125-
-u "$WPT_FYI_USERNAME:$WPT_FYI_PASSWORD" \
126-
-F "result_file=@wptreport.json.gz" \
127-
-F "labels=master" \
128-
$WPT_FYI_ENDPOINT)
153+
# - name: Upload WPT Report to wpt.fyi API
154+
# if: ${{ env.WPT_REPORT != '' }}
155+
# env:
156+
# WPT_FYI_USERNAME: ${{ vars.WPT_FYI_USERNAME }}
157+
# WPT_FYI_PASSWORD: ${{ secrets.WPT_FYI_PASSWORD }}
158+
# working-directory: out/wpt
159+
# run: |
160+
# gzip wptreport.json
161+
# echo "## Node.js ${{ steps.setup-node.outputs.node-version }}" >> $GITHUB_STEP_SUMMARY
162+
# echo "" >> $GITHUB_STEP_SUMMARY
163+
# echo "WPT Revision: [\`${WPT_REVISION:0:7}\`](https://github.com/web-platform-tests/wpt/commits/$WPT_REVISION)" >> $GITHUB_STEP_SUMMARY
164+
# for WPT_FYI_ENDPOINT in "https://wpt.fyi/api/results/upload" "https://staging.wpt.fyi/api/results/upload"
165+
# do
166+
# response=$(curl -sS \
167+
# -u "$WPT_FYI_USERNAME:$WPT_FYI_PASSWORD" \
168+
# -F "result_file=@wptreport.json.gz" \
169+
# -F "labels=master" \
170+
# $WPT_FYI_ENDPOINT)
129171

130-
if [[ $response =~ Task\ ([0-9]+)\ added\ to\ queue ]]; then
131-
run_id=${BASH_REMATCH[1]}
132-
origin=${WPT_FYI_ENDPOINT%/api/results/upload}
172+
# if [[ $response =~ Task\ ([0-9]+)\ added\ to\ queue ]]; then
173+
# run_id=${BASH_REMATCH[1]}
174+
# origin=${WPT_FYI_ENDPOINT%/api/results/upload}
133175

134-
echo "" >> $GITHUB_STEP_SUMMARY
135-
echo "Run ID [\`$run_id\`]($origin/api/runs/$run_id) added to the processor queue at ${origin:8}" >> $GITHUB_STEP_SUMMARY
136-
echo "- [View on the ${origin:8} dashboard]($origin/results?run_id=$run_id)" >> $GITHUB_STEP_SUMMARY
137-
fi
138-
done
176+
# echo "" >> $GITHUB_STEP_SUMMARY
177+
# echo "Run ID [\`$run_id\`]($origin/api/runs/$run_id) added to the processor queue at ${origin:8}" >> $GITHUB_STEP_SUMMARY
178+
# echo "- [View on the ${origin:8} dashboard]($origin/results?run_id=$run_id)" >> $GITHUB_STEP_SUMMARY
179+
# fi
180+
# done

test/wpt/test-compression.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
'use strict';
22

3+
const { skip } = require('../common');
4+
5+
skip('begone');
6+
37
const { WPTRunner } = require('../common/wpt');
48

59
const runner = new WPTRunner('compression');

0 commit comments

Comments
 (0)