ci: build CommonJS test-version-utils for perf runs#27383
Conversation
|
Hi! Thank you for opening this PR. Want me to review it? Based on the diff (12 lines, 1 files), I've queued these reviewers:
How this works
|
There was a problem hiding this comment.
Pull request overview
This PR fixes the performance benchmark pipelines that run ESM-focused builds by ensuring @fluid-private/test-version-utils still produces the CommonJS artifact (dist/compatOptions.js) that its mocharc-common.cjs loads via require() at Mocha startup.
Changes:
- Adds a
fluidBuild.tasksoverride sobuild:esnextdepends on the package’stsc(CommonJS) build. - Documents the rationale in
package.jsonto prevent future regressions when scoped ESM builds are used.
jason-ha
left a comment
There was a problem hiding this comment.
If the perf pipeline passed with this, then let's do it.
|
/azp run Build - protocol-definitions,Build - test-tools,server-gitrest,server-gitssh,server-historian,server-routerlicious,Build - client packages,repo-policy-check |
|
/azp run Build - api-markdown-documenter,Build - benchmark-tool,Build - build-common,Build - build-tools,Build - common-utils,Build - eslint-config-fluid,Build - eslint-plugin-fluid |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
|
/azp run Performance benchmarks |
|
No pipelines are associated with this pull request. |
Description
Fixes the Performance benchmarks pipeline (
perf_e2e_local,perf_e2e_frs,perf_e2e_odsp),which has failed continuously on
mainsince #27265 with:Error: Unable to read/parse .../test-end-to-end-tests/.mocharc.cjs:
Error: Cannot find module './dist/compatOptions.js'
Root cause
The perf pipeline runs
pnpm exec fluid-build --nolint --task build:test:esm --worker.@fluid-private/test-version-utils/mocharc-common.cjsrequire()s its own./dist/compatOptions.js(CommonJS) at mocha load time, but #27265 narrowedtest-end-to-end-tests'sbuild:test:esmoverride from"^tsc"(every ancestor's CJS build) to a single explicit ancestor, dropping the transitive CJS build oftest-version-utils. The CJS artifact stopped being produced and mocha failed to load its config.Fix
Add a one-time pre-build step in
tools/pipelines/test-perf-benchmarks.ymlthat runsfluid-build packages/test/test-version-utils --task compilebefore the mainbuild:test:esmstep. This warmstest-version-utils'sdist/so the runtimerequire()frommocharc-common.cjsresolves.Because the new step lives inside the
${{ each job in parameters.benchmarkJobs }}:template, the single source-line addition applies to all 5 stages.