Visitar URL original
build: fetch Perfetto trace_processor_shell for the Node.js tests · electron/electron@8920a7c · GitHub
Skip to content

Commit 8920a7c

Browse files
committed
build: fetch Perfetto trace_processor_shell for the Node.js tests
nodejs/node#66068 (test: enable trace_events tests with perfetto) moved the trace_events tests from test/parallel into a new test/trace_events suite. When Node.js is built with Perfetto (process.config.variables .v8_use_perfetto, which Electron's build sets), those tests write binary .pftrace files and convert them back to JSON with Perfetto's trace_processor_shell, through test/common/trace_events.js. Without the tool, all 17 trace_events/* tests in nn-test fail with "trace_processor_shell is missing". The same PR added tools/perfetto/get_trace_processor, which upstream's Makefile and CI use to fetch it. Run that script in the Node.js test job. It downloads the Perfetto release matching the vendored deps/perfetto/VERSION (v58.2) from Perfetto's GitHub releases to tools/perfetto/trace_processor_shell, which is the default path the test helper resolves, so TRACE_PROCESSOR_SHELL_PATH is not needed. Cache the binary keyed on that VERSION file. Upstream pins only the version, not a checksum. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vf2yMuJ7XxvNktpKuiMPzU
1 parent 719c369 commit 8920a7c

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

‎.github/workflows/pipeline-segment-node-nan-test.yml‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,19 @@ jobs:
9090
run: |
9191
cd src/out/Default
9292
unzip -:o dist.zip
93+
# The trace_events tests read Perfetto traces back through
94+
# trace_processor_shell. Node's own tool fetches the release matching the
95+
# vendored deps/perfetto/VERSION into the path test/common/trace_events.js
96+
# expects, so key the cache on that file.
97+
- name: Restore Perfetto trace_processor_shell
98+
id: trace-processor-cache
99+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
100+
with:
101+
path: src/third_party/electron_node/tools/perfetto/trace_processor_shell
102+
key: ${{ runner.os }}-${{ runner.arch }}-perfetto-trace-processor-${{ hashFiles('src/third_party/electron_node/deps/perfetto/VERSION') }}
103+
- name: Download Perfetto trace_processor_shell
104+
if: steps.trace-processor-cache.outputs.cache-hit != 'true'
105+
run: src/third_party/electron_node/tools/perfetto/get_trace_processor
93106
- name: Setup Linux for Headless Testing
94107
run: sh -e /etc/init.d/xvfb start
95108
- name: Run Node.js Tests

0 commit comments

Comments
 (0)