Conversation
|
Reviewed at dea914c. The migration looks sound, but the new gate has three holes that let raw
The scan at The allowlist at The "allowlist holds" test in A few cleanup leftovers: On design: this adds the 11th and 12th copy of the two-line mkdtemp helper, and the gate then finds helpers by file name. Would exempting only functions named The branch conflicts with main. #2618 already removed the snapshot-helper The 5 reported checks pass, and the new gate runs in the tooling job. Next step: rebase, then close the three gate holes with model tests that fail without each fix. |
dea914c to
6a17e00
Compare
Size Report
Startup median (7 runs, lower is better):
|
Route every product-test scratch directory through the per-package mkdtempForTest/mkdtempForTestSync helpers so it lands under the run's redirected TMPDIR and is removed once per run, instead of path.join(os.tmpdir(), name), which reuses a fixed path across the whole suite. Adds the missing tmp-dir helpers to platform-harmonyos, provider-webdriver, and replay-test and rounds out platform-apple's.
Add a no-restricted-imports override so a product *.test.ts that imports node:os is a lint error pointing at mkdtempForTest, mirroring the existing node:child_process ban. A follow-up override clears it for the handful of tests that mock production's os.tmpdir()/os.homedir() or assert a real /tmp socket.
6a17e00 to
853f612
Compare
|
Reviewed at 6a17e00, as a follow-up to the review at dea914c. Banning the The enforced glob at oxlint.config.ts#L152 matches only The override for the 9 exempt tests at oxlint.config.ts#L174 clears A small leftover: session-close-shutdown.fixtures.ts#L3 imports All checks passed at 6a17e00 and there were no conflicts. The newer head 853f612 rebases onto main and adapts one fixture to an upstream mock; it does not change the lint config or the files named above, so these points still apply. Next: widen the glob and scope the exemptions to the justified calls. |
|
Addressed in Gate reworked per your design note. The bespoke
Cleanup leftovers fixed. Removed the On the 11th/12th helper copy — agreed it is duplication, but a single shared root test-surface helper importable by each package Validation at |
|
Checked at 853f612. Yes, please widen the ban to the helper files: The other two points from the 6a17e00 review still apply to this head. The nine exemptions at oxlint.config.ts#L171-L179 clear the rule for whole files, so a new unrelated The shared helper for all packages is fine as a follow-up. All checks pass and there are no conflicts. Next: widen the glob, scope the exemptions to lines, and drop the unused import. |
Summary
Route every product-test scratch directory through the per-package
mkdtempForTest/mkdtempForTestSynchelpers so it lands under the run's redirected TMPDIR and is removed once per run, instead ofpath.join(os.tmpdir(), name), which reuses a fixed path across the whole suite.tmp-dirhelpers toplatform-harmonyos,provider-webdriver,replay-testand trimsplatform-apple's to the variant each tree actually uses.daemon.logidiom collapses to one scratch dir per site; redundantrandomUUID/Date.now()suffixes dropped; two ad-hoc Android screenshot paths fold into the existingwithTempScreenshothelper; a snapshot-helper manifest fixture drops a staleinstallArgsfield (a refactor(android): drop the snapshot helper manifest installArgs #2618 leftover that broke typecheck).no-restricted-importsoverride inoxlint.config.ts: a product*.test.tsthat importsnode:osis a lint error pointing atmkdtempForTest, mirroring the existingnode:child_processban. A follow-up override clears it for the 9 tests that mock production'sos.tmpdir()/os.homedir()or assert a real/tmpsocket path. No new command, gate, or CI step — it rides the existingpnpm lintgate.packages/maestro/test/**and the.tswrapper helpers fall outside the*.test.tsscope by design.Scope: 83 files (81 tests + 2 helper trims +
oxlint.config.ts). ~953 gross lines, inherently all-or-nothing — the rule cannot land before its migration.Validation
Tested at
6a17e00ea4. Green in isolation:pnpm lint(oxlint, incl. the new rule),format:check,typecheck,check:fallow --base origin/main,check:gate-manifest(+test),check:affected:test, and the vitest unit run for all changed files. The rule is proven reachable: it errors on a plantednode:osimport in asrc/**/__tests__/*.test.tsand stays silent on the exception/helper files.check:affected --runreports two halts, neither attributable to this change:mutation-model(scripts/mutation/ownership.test.ts) — pre-existing: reproduces identically at cleanorigin/mainwith this change absent (verified in a throwaway worktree).lint— a fan-out resource artifact, not a findings failure: oxlint prints no violation and exits 0 standalone here, and the set ofnode:os-importing*.test.tsunder the ban globs equals the 9 exceptions exactly, so the rule cannot fire.