Skip to content

ci: cache the compare tests' ngtsc baseline with vp run - #712

Merged
fengmk2 merged 3 commits into
mainfrom
feat/vp-run-ng-baseline-cache
Nov 12, 2026
Merged

fengmk2 merged 3 commits into
mainfrom
feat/vp-run-ng-baseline-cache

Conversation

@wan9chi

@wan9chi wan9chi commented Nov 11, 2026

Copy link
Copy Markdown
Member

Why

The E2E job's Compare tests step compiles every fixture with Angular's compiler (ngtsc) on every PR push, even when nothing that compile depends on changed. That takes about 7 minutes. This caches it with vp run and its remote task cache, so PRs reuse what main has built.

Changes

  • compare --fixtures is split into two tasks. It compiled every fixture with both ngtsc and Oxc in one run, so the ngtsc compile couldn't be cached on its own. Compare tests now runs vp run compare, which runs the two tasks the root vite.config.ts defines: ng-baseline compiles the fixtures with ngtsc and saves the outputs, then compare compiles them with Oxc and compares the result with those outputs.
  • Only ng-baseline is cached. It reads only the fixtures and the Angular side of the harness, so a change to Oxc still hits. compare reads the Oxc binding, which is built outside vp run, so it always runs. vp run tracks the files a task reads, so ng-baseline needs no input config.

Results

Across 131 E2E jobs replayed in a fork:

  • Median E2E job: 12.4 min → 5.2 min
  • Compare tests on a hit: 439 s → 10 s
  • ng-baseline hit rate: 92%, with 0 false hits

@socket-security

socket-security Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​vite-plus@​1.6.098100100100100

View full report

@fengmk2 fengmk2 self-assigned this Nov 12, 2026
wan9chi and others added 3 commits November 12, 2026 14:44
The Compare tests step compiles every fixture with ngtsc before comparing the
output with Oxc's, which takes about 7 minutes of each E2E job. `vp run compare`
now runs it as two tasks: `ng-baseline` compiles the fixtures with ngtsc and
saves the outputs, cached locally and in the remote task cache, and `compare`
compiles them with Oxc and compares the outputs with the saved ones.

The baseline script loads only the Angular side of the harness, so the
binding, the Rust sources and the comparison code aren't among its inputs.
Pull requests read the remote cache anonymously; only pushes to main upload,
from a job variant that may request an OIDC token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pick the cache mode with an expression instead of a second napi-main job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace the preview build from the registry bridge with the npm release, and drop the
.npmrc that pointed @voidzero-dev at the bridge. vite-plus joins the other
minimumReleaseAgeExclude entries for toolchain packages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fengmk2
fengmk2 force-pushed the feat/vp-run-ng-baseline-cache branch from 6ea6b26 to 473dc90 Compare November 12, 2026 06:46
@fengmk2
fengmk2 marked this pull request as ready for review November 12, 2026 07:25

@fengmk2 fengmk2 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fengmk2
fengmk2 merged commit 6883315 into main Nov 12, 2026
10 checks passed
@fengmk2
fengmk2 deleted the feat/vp-run-ng-baseline-cache branch November 12, 2026 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants