@codyswann/lisa 5.4.0 → 5.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -3
- package/all/copy-contents/gitignore +16 -0
- package/all/copy-contents/scripts/lisa-mutation.sh +4 -6
- package/all/copy-overwrite/scripts/fetch-test-access-map.d.mts +71 -0
- package/all/copy-overwrite/scripts/fetch-test-access-map.mjs +674 -0
- package/all/copy-overwrite/scripts/lib/affected-tests.mjs +818 -0
- package/all/copy-overwrite/scripts/lib/automation-provenance-local.mjs +22 -1
- package/all/copy-overwrite/scripts/lib/build-marker.mjs +410 -0
- package/all/copy-overwrite/scripts/lib/gate-pass-cache.mjs +537 -0
- package/all/copy-overwrite/scripts/lib/kill-marks.mjs +1 -2
- package/all/copy-overwrite/scripts/lib/lisa-cleanup-sweep-processes.mjs +3 -4
- package/all/copy-overwrite/scripts/lib/npm-update-controller-broker.mjs +1 -1
- package/all/copy-overwrite/scripts/lib/npm-update-gate-hooks.mjs +2 -1
- package/all/copy-overwrite/scripts/lib/npm-update-helper-inventory.mjs +8 -1
- package/all/copy-overwrite/scripts/lib/npm-update-hosted-hook.mjs +1 -1
- package/all/copy-overwrite/scripts/lib/npm-update-tool-launcher.mjs +1 -1
- package/all/copy-overwrite/scripts/lib/push-admission.mjs +158 -0
- package/all/copy-overwrite/scripts/lib/push-gate-defaults.d.mts +34 -0
- package/all/copy-overwrite/scripts/lib/push-gate-defaults.mjs +147 -0
- package/all/copy-overwrite/scripts/lib/push-timing.mjs +323 -0
- package/all/copy-overwrite/scripts/lib/rspec-selection.mjs +672 -0
- package/all/copy-overwrite/scripts/lisa-affected-tests.mjs +566 -0
- package/all/copy-overwrite/scripts/lisa-gates.mjs +29 -0
- package/all/copy-overwrite/scripts/lisa-lint-staged-preflight.mjs +10 -1
- package/all/copy-overwrite/scripts/lisa-push-timing-report.mjs +153 -0
- package/all/copy-overwrite/scripts/lisa-rspec-select.mjs +982 -0
- package/all/copy-overwrite/scripts/lisa-run-gates.mjs +231 -6
- package/all/copy-overwrite/scripts/npm-updater-helper-graph.json +105 -17
- package/all/deletions.json +11 -2
- package/cdk/create-only/vitest.config.local.ts +1 -7
- package/cdk/package-lisa/package.lisa.json +4 -4
- package/dist/cli/admit-cmd.d.ts +21 -0
- package/dist/cli/admit-cmd.d.ts.map +1 -0
- package/dist/cli/admit-cmd.js +142 -0
- package/dist/cli/admit-cmd.js.map +1 -0
- package/dist/cli/check-cmd.d.ts +72 -0
- package/dist/cli/check-cmd.d.ts.map +1 -0
- package/dist/cli/check-cmd.js +316 -0
- package/dist/cli/check-cmd.js.map +1 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +6 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/lisa-test-run-admission.d.ts +18 -0
- package/dist/cli/lisa-test-run-admission.d.ts.map +1 -0
- package/dist/cli/lisa-test-run-admission.js +62 -0
- package/dist/cli/lisa-test-run-admission.js.map +1 -0
- package/dist/cli/lisa-test-run-payload.d.ts +37 -0
- package/dist/cli/lisa-test-run-payload.d.ts.map +1 -0
- package/dist/cli/lisa-test-run-payload.js +55 -0
- package/dist/cli/lisa-test-run-payload.js.map +1 -0
- package/dist/cli/lisa-test-run-shard-files.d.ts +89 -0
- package/dist/cli/lisa-test-run-shard-files.d.ts.map +1 -0
- package/dist/cli/lisa-test-run-shard-files.js +239 -0
- package/dist/cli/lisa-test-run-shard-files.js.map +1 -0
- package/dist/cli/lisa-test-run-shard.d.ts +6 -2
- package/dist/cli/lisa-test-run-shard.d.ts.map +1 -1
- package/dist/cli/lisa-test-run-shard.js +25 -13
- package/dist/cli/lisa-test-run-shard.js.map +1 -1
- package/dist/cli/lisa-test-run.d.ts +1 -1
- package/dist/cli/lisa-test-run.d.ts.map +1 -1
- package/dist/cli/lisa-test-run.js +47 -10
- package/dist/cli/lisa-test-run.js.map +1 -1
- package/dist/cli/update-check-hook.d.ts.map +1 -1
- package/dist/cli/update-check-hook.js +3 -0
- package/dist/cli/update-check-hook.js.map +1 -1
- package/dist/configs/vitest/base.d.ts +58 -135
- package/dist/configs/vitest/base.d.ts.map +1 -1
- package/dist/configs/vitest/base.js +76 -228
- package/dist/configs/vitest/base.js.map +1 -1
- package/dist/configs/vitest/cdk.d.ts.map +1 -1
- package/dist/configs/vitest/cdk.js +3 -2
- package/dist/configs/vitest/cdk.js.map +1 -1
- package/dist/configs/vitest/coverage-include-global-setup.d.ts.map +1 -1
- package/dist/configs/vitest/coverage-include-global-setup.js +3 -4
- package/dist/configs/vitest/coverage-include-global-setup.js.map +1 -1
- package/dist/configs/vitest/coverage-reports-directory.d.ts +27 -5
- package/dist/configs/vitest/coverage-reports-directory.d.ts.map +1 -1
- package/dist/configs/vitest/coverage-reports-directory.js +47 -10
- package/dist/configs/vitest/coverage-reports-directory.js.map +1 -1
- package/dist/configs/vitest/harper-fabric.d.ts.map +1 -1
- package/dist/configs/vitest/harper-fabric.js +3 -2
- package/dist/configs/vitest/harper-fabric.js.map +1 -1
- package/dist/configs/vitest/nestjs.d.ts.map +1 -1
- package/dist/configs/vitest/nestjs.js +3 -2
- package/dist/configs/vitest/nestjs.js.map +1 -1
- package/dist/configs/vitest/phaser.d.ts.map +1 -1
- package/dist/configs/vitest/phaser.js +3 -2
- package/dist/configs/vitest/phaser.js.map +1 -1
- package/dist/configs/vitest/refusal-announcement.d.ts +51 -0
- package/dist/configs/vitest/refusal-announcement.d.ts.map +1 -0
- package/dist/configs/vitest/refusal-announcement.js +97 -0
- package/dist/configs/vitest/refusal-announcement.js.map +1 -0
- package/dist/configs/vitest/socket-safe-temp-base.d.ts +3 -4
- package/dist/configs/vitest/socket-safe-temp-base.d.ts.map +1 -1
- package/dist/configs/vitest/socket-safe-temp-base.js +7 -6
- package/dist/configs/vitest/socket-safe-temp-base.js.map +1 -1
- package/dist/configs/vitest/typescript.d.ts.map +1 -1
- package/dist/configs/vitest/typescript.js +3 -2
- package/dist/configs/vitest/typescript.js.map +1 -1
- package/dist/core/admission-decision.d.ts +110 -0
- package/dist/core/admission-decision.d.ts.map +1 -0
- package/dist/core/admission-decision.js +91 -0
- package/dist/core/admission-decision.js.map +1 -0
- package/dist/core/admission-lock.d.ts +69 -0
- package/dist/core/admission-lock.d.ts.map +1 -0
- package/dist/core/admission-lock.js +278 -0
- package/dist/core/admission-lock.js.map +1 -0
- package/dist/core/admission-settings.d.ts +69 -0
- package/dist/core/admission-settings.d.ts.map +1 -0
- package/dist/core/admission-settings.js +204 -0
- package/dist/core/admission-settings.js.map +1 -0
- package/dist/core/admission-state.d.ts +50 -0
- package/dist/core/admission-state.d.ts.map +1 -0
- package/dist/core/admission-state.js +168 -0
- package/dist/core/admission-state.js.map +1 -0
- package/dist/core/admission.d.ts +70 -0
- package/dist/core/admission.d.ts.map +1 -0
- package/dist/core/admission.js +205 -0
- package/dist/core/admission.js.map +1 -0
- package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
- package/dist/core/lisa-owned-hash-ledger.js +318 -0
- package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
- package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
- package/dist/core/project-config-push-gate.d.ts +66 -0
- package/dist/core/project-config-push-gate.d.ts.map +1 -0
- package/dist/core/project-config-push-gate.js +82 -0
- package/dist/core/project-config-push-gate.js.map +1 -0
- package/dist/core/project-config.d.ts +4 -0
- package/dist/core/project-config.d.ts.map +1 -1
- package/dist/core/project-config.js +14 -9
- package/dist/core/project-config.js.map +1 -1
- package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
- package/dist/core/upstream-evidence-manifest.js +197 -123
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- package/expo/package-lisa/package.lisa.json +2 -2
- package/harper-fabric/package-lisa/package.lisa.json +4 -4
- package/nestjs/create-only/vitest.config.local.ts +1 -7
- package/nestjs/package-lisa/package.lisa.json +4 -4
- package/npm-package/package-lisa/package.lisa.json +4 -4
- package/package.json +12 -11
- package/phaser/package-lisa/package.lisa.json +4 -4
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-drive-pr-to-merge/SKILL.md +16 -3
- package/plugins/lisa/.codex-plugin/skills/lisa-git-submit-pr/SKILL.md +1 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-implement/SKILL.md +1 -1
- package/plugins/lisa/skills/lisa-drive-pr-to-merge/SKILL.md +16 -3
- package/plugins/lisa/skills/lisa-git-submit-pr/SKILL.md +1 -1
- package/plugins/lisa/skills/lisa-implement/SKILL.md +1 -1
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-agy/skills/lisa-drive-pr-to-merge/SKILL.md +16 -3
- package/plugins/lisa-agy/skills/lisa-git-submit-pr/SKILL.md +1 -1
- package/plugins/lisa-agy/skills/lisa-implement/SKILL.md +1 -1
- package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-agy/plugin.json +1 -1
- package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/skills/lisa-drive-pr-to-merge/SKILL.md +16 -3
- package/plugins/lisa-copilot/skills/lisa-git-submit-pr/SKILL.md +1 -1
- package/plugins/lisa-copilot/skills/lisa-implement/SKILL.md +1 -1
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/skills/lisa-drive-pr-to-merge/SKILL.md +16 -3
- package/plugins/lisa-cursor/skills/lisa-git-submit-pr/SKILL.md +1 -1
- package/plugins/lisa-cursor/skills/lisa-implement/SKILL.md +1 -1
- package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/skills/lisa-drive-pr-to-merge/SKILL.md +16 -3
- package/plugins/lisa-devin/skills/lisa-git-submit-pr/SKILL.md +1 -1
- package/plugins/lisa-devin/skills/lisa-implement/SKILL.md +1 -1
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-agy/plugin.json +1 -1
- package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-agy/plugin.json +1 -1
- package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-agy/plugin.json +1 -1
- package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-agy/plugin.json +1 -1
- package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-agy/plugin.json +1 -1
- package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-agy/plugin.json +1 -1
- package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/src/base/skills/lisa-drive-pr-to-merge/SKILL.md +16 -3
- package/plugins/src/base/skills/lisa-git-submit-pr/SKILL.md +1 -1
- package/plugins/src/base/skills/lisa-implement/SKILL.md +1 -1
- package/rails/copy-overwrite/Gemfile.lisa +8 -0
- package/rails/copy-overwrite/lefthook.yml +25 -11
- package/rails/copy-overwrite/scripts/lisa-rails-gates.mjs +686 -0
- package/rails/copy-overwrite/scripts/lisa-rspec-shards.mjs +2 -2
- package/rails/copy-overwrite/scripts/lisa_crystalball_recorder.rb +239 -0
- package/rails/copy-overwrite/scripts/lisa_rspec_partial_coverage.rb +83 -0
- package/scripts/build-unless-marked.mjs +83 -0
- package/scripts/check-plugins-sync.sh +22 -5
- package/scripts/classify-markdown-assertions.mjs +141 -0
- package/scripts/integration-shard-build.mjs +143 -0
- package/scripts/lib/history-scanner-suites.mjs +19 -0
- package/scripts/lib/markdown-assertions/classify.mjs +289 -0
- package/scripts/lib/markdown-assertions/context.mjs +53 -0
- package/scripts/lib/markdown-assertions/corpus.mjs +222 -0
- package/scripts/lib/markdown-assertions/manifest-cull.mjs +86 -0
- package/scripts/lib/markdown-assertions/record-setup.mjs +265 -0
- package/scripts/lib/markdown-assertions/record.mjs +115 -0
- package/scripts/lib/markdown-assertions/record.vitest.config.mjs +24 -0
- package/scripts/lib/markdown-assertions/sites.mjs +273 -0
- package/scripts/lib/markdown-assertions/test-cull.mjs +768 -0
- package/scripts/lib/markdown-assertions/tokens.mjs +158 -0
- package/scripts/lib/shell-guard-trace.mjs +6 -0
- package/scripts/lib/test-access-map-setup.mjs +40 -0
- package/scripts/lib/test-access-map-tracer.mjs +205 -0
- package/scripts/lib/test-access-map.d.mts +72 -0
- package/scripts/lib/test-access-map.mjs +395 -0
- package/scripts/lib/test-timings-reporter.d.mts +17 -0
- package/scripts/lib/test-timings-reporter.mjs +99 -0
- package/scripts/plan-integration-shards.mjs +300 -0
- package/scripts/test-timing-report.d.mts +41 -0
- package/scripts/test-timing-report.mjs +361 -0
- package/scripts/two-channel-couplings.json +132 -36
- package/scripts/verify-npm-advisories-4333.mjs +3 -12
- package/typescript/copy-overwrite/.prettierignore +12 -0
- package/typescript/create-only/vitest.config.local.ts +1 -7
- package/typescript/package-lisa/package.lisa.json +4 -4
- package/all/copy-overwrite/scripts/lisa-scratch-run.sh +0 -1078
- package/dist/cli/lisa-test-run-bootstrap.d.ts +0 -3
- package/dist/cli/lisa-test-run-bootstrap.d.ts.map +0 -1
- package/dist/cli/lisa-test-run-bootstrap.js +0 -229
- package/dist/cli/lisa-test-run-bootstrap.js.map +0 -1
- package/dist/cli/lisa-test-run-ipc.d.ts +0 -49
- package/dist/cli/lisa-test-run-ipc.d.ts.map +0 -1
- package/dist/cli/lisa-test-run-ipc.js +0 -226
- package/dist/cli/lisa-test-run-ipc.js.map +0 -1
- package/dist/cli/lisa-test-run-process-group.d.ts +0 -30
- package/dist/cli/lisa-test-run-process-group.d.ts.map +0 -1
- package/dist/cli/lisa-test-run-process-group.js +0 -140
- package/dist/cli/lisa-test-run-process-group.js.map +0 -1
- package/dist/cli/lisa-test-run-reaper.d.ts +0 -3
- package/dist/cli/lisa-test-run-reaper.d.ts.map +0 -1
- package/dist/cli/lisa-test-run-reaper.js +0 -195
- package/dist/cli/lisa-test-run-reaper.js.map +0 -1
- package/dist/cli/lisa-test-run-runtime.d.ts +0 -46
- package/dist/cli/lisa-test-run-runtime.d.ts.map +0 -1
- package/dist/cli/lisa-test-run-runtime.js +0 -123
- package/dist/cli/lisa-test-run-runtime.js.map +0 -1
- package/dist/cli/lisa-test-run-supervisor.d.ts +0 -13
- package/dist/cli/lisa-test-run-supervisor.d.ts.map +0 -1
- package/dist/cli/lisa-test-run-supervisor.js +0 -265
- package/dist/cli/lisa-test-run-supervisor.js.map +0 -1
- package/dist/configs/vitest/fleet-admission-global-setup.d.ts +0 -34
- package/dist/configs/vitest/fleet-admission-global-setup.d.ts.map +0 -1
- package/dist/configs/vitest/fleet-admission-global-setup.js +0 -123
- package/dist/configs/vitest/fleet-admission-global-setup.js.map +0 -1
- package/dist/configs/vitest/fleet-admission.d.ts +0 -129
- package/dist/configs/vitest/fleet-admission.d.ts.map +0 -1
- package/dist/configs/vitest/fleet-admission.js +0 -239
- package/dist/configs/vitest/fleet-admission.js.map +0 -1
- package/dist/configs/vitest/scratch-authority.d.ts +0 -25
- package/dist/configs/vitest/scratch-authority.d.ts.map +0 -1
- package/dist/configs/vitest/scratch-authority.js +0 -107
- package/dist/configs/vitest/scratch-authority.js.map +0 -1
- package/dist/configs/vitest/scratch-bound-cleanup-programs.d.ts +0 -5
- package/dist/configs/vitest/scratch-bound-cleanup-programs.d.ts.map +0 -1
- package/dist/configs/vitest/scratch-bound-cleanup-programs.js +0 -219
- package/dist/configs/vitest/scratch-bound-cleanup-programs.js.map +0 -1
- package/dist/configs/vitest/scratch-bound-cleanup.d.ts +0 -28
- package/dist/configs/vitest/scratch-bound-cleanup.d.ts.map +0 -1
- package/dist/configs/vitest/scratch-bound-cleanup.js +0 -155
- package/dist/configs/vitest/scratch-bound-cleanup.js.map +0 -1
- package/dist/configs/vitest/scratch-bound-root-cleanup.d.ts +0 -17
- package/dist/configs/vitest/scratch-bound-root-cleanup.d.ts.map +0 -1
- package/dist/configs/vitest/scratch-bound-root-cleanup.js +0 -149
- package/dist/configs/vitest/scratch-bound-root-cleanup.js.map +0 -1
- package/dist/configs/vitest/scratch-global-setup.d.ts +0 -258
- package/dist/configs/vitest/scratch-global-setup.d.ts.map +0 -1
- package/dist/configs/vitest/scratch-global-setup.js +0 -505
- package/dist/configs/vitest/scratch-global-setup.js.map +0 -1
- package/dist/configs/vitest/scratch-leak-setup.d.ts +0 -2
- package/dist/configs/vitest/scratch-leak-setup.d.ts.map +0 -1
- package/dist/configs/vitest/scratch-leak-setup.js +0 -108
- package/dist/configs/vitest/scratch-leak-setup.js.map +0 -1
- package/dist/configs/vitest/scratch-namespace-authority.d.ts +0 -80
- package/dist/configs/vitest/scratch-namespace-authority.d.ts.map +0 -1
- package/dist/configs/vitest/scratch-namespace-authority.js +0 -291
- package/dist/configs/vitest/scratch-namespace-authority.js.map +0 -1
- package/dist/configs/vitest/scratch-owner.d.ts +0 -131
- package/dist/configs/vitest/scratch-owner.d.ts.map +0 -1
- package/dist/configs/vitest/scratch-owner.js +0 -297
- package/dist/configs/vitest/scratch-owner.js.map +0 -1
- package/dist/configs/vitest/scratch-route-profile.d.ts +0 -46
- package/dist/configs/vitest/scratch-route-profile.d.ts.map +0 -1
- package/dist/configs/vitest/scratch-route-profile.js +0 -233
- package/dist/configs/vitest/scratch-route-profile.js.map +0 -1
- package/dist/configs/vitest/scratch-run-root-compatibility.d.ts +0 -33
- package/dist/configs/vitest/scratch-run-root-compatibility.d.ts.map +0 -1
- package/dist/configs/vitest/scratch-run-root-compatibility.js +0 -137
- package/dist/configs/vitest/scratch-run-root-compatibility.js.map +0 -1
- package/dist/configs/vitest/scratch-run-root-intent.d.ts +0 -66
- package/dist/configs/vitest/scratch-run-root-intent.d.ts.map +0 -1
- package/dist/configs/vitest/scratch-run-root-intent.js +0 -183
- package/dist/configs/vitest/scratch-run-root-intent.js.map +0 -1
- package/dist/configs/vitest/scratch-setup.d.ts +0 -46
- package/dist/configs/vitest/scratch-setup.d.ts.map +0 -1
- package/dist/configs/vitest/scratch-setup.js +0 -226
- package/dist/configs/vitest/scratch-setup.js.map +0 -1
- package/dist/configs/vitest/scratch-supervision-intent.d.ts +0 -8
- package/dist/configs/vitest/scratch-supervision-intent.d.ts.map +0 -1
- package/dist/configs/vitest/scratch-supervision-intent.js +0 -125
- package/dist/configs/vitest/scratch-supervision-intent.js.map +0 -1
- package/dist/configs/vitest/scratch-supervision-protocol.d.ts +0 -12
- package/dist/configs/vitest/scratch-supervision-protocol.d.ts.map +0 -1
- package/dist/configs/vitest/scratch-supervision-protocol.js +0 -230
- package/dist/configs/vitest/scratch-supervision-protocol.js.map +0 -1
- package/dist/configs/vitest/scratch-supervision.d.ts +0 -69
- package/dist/configs/vitest/scratch-supervision.d.ts.map +0 -1
- package/dist/configs/vitest/scratch-supervision.js +0 -244
- package/dist/configs/vitest/scratch-supervision.js.map +0 -1
- package/dist/configs/vitest/scratch-sweep.d.ts +0 -66
- package/dist/configs/vitest/scratch-sweep.d.ts.map +0 -1
- package/dist/configs/vitest/scratch-sweep.js +0 -82
- package/dist/configs/vitest/scratch-sweep.js.map +0 -1
- package/dist/configs/vitest/scratch-tmpdir-trust.d.ts +0 -48
- package/dist/configs/vitest/scratch-tmpdir-trust.d.ts.map +0 -1
- package/dist/configs/vitest/scratch-tmpdir-trust.js +0 -194
- package/dist/configs/vitest/scratch-tmpdir-trust.js.map +0 -1
- package/dist/configs/vitest/scratch.d.ts +0 -19
- package/dist/configs/vitest/scratch.d.ts.map +0 -1
- package/dist/configs/vitest/scratch.js +0 -34
- package/dist/configs/vitest/scratch.js.map +0 -1
- package/dist/configs/vitest/synthesis-scratch-reclaim.d.ts +0 -86
- package/dist/configs/vitest/synthesis-scratch-reclaim.d.ts.map +0 -1
- package/dist/configs/vitest/synthesis-scratch-reclaim.js +0 -226
- package/dist/configs/vitest/synthesis-scratch-reclaim.js.map +0 -1
|
@@ -10,16 +10,13 @@
|
|
|
10
10
|
* @see https://vitest.dev/config/
|
|
11
11
|
* @module configs/vitest/base
|
|
12
12
|
*/
|
|
13
|
-
import { existsSync
|
|
13
|
+
import { existsSync } from "node:fs";
|
|
14
14
|
import { availableParallelism } from "node:os";
|
|
15
|
-
import { basename, join } from "node:path";
|
|
16
15
|
import { env } from "node:process";
|
|
17
16
|
import { fileURLToPath } from "node:url";
|
|
17
|
+
import { testAccessMapPlugin, testAccessMapSetupFiles, } from "../../../scripts/lib/test-access-map.mjs";
|
|
18
18
|
import { isUnitCoverageScope } from "../coverage-scope.js";
|
|
19
19
|
import { isInsideWorktree } from "../worktrees.js";
|
|
20
|
-
import { scratchNamespaceDir } from "./scratch-namespace-authority.js";
|
|
21
|
-
import { parseScratchRunRootName } from "./scratch-owner.js";
|
|
22
|
-
import { SCRATCH_SUPERVISION_LEASE_ENV, parseScratchSupervisionLease, } from "./scratch-supervision.js";
|
|
23
20
|
/**
|
|
24
21
|
* Default coverage thresholds used when not specified in project config.
|
|
25
22
|
* Projects can override via vitest.thresholds.json.
|
|
@@ -102,17 +99,20 @@ export const MAX_WORKERS_OVERRIDE_VAR = "LISA_VITEST_MAX_WORKERS";
|
|
|
102
99
|
* Environment variable stating how many concurrent runs share this machine.
|
|
103
100
|
*
|
|
104
101
|
* Optional, and it is a statement of INTENT rather than an observation: "six
|
|
105
|
-
* runs are coming"
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
* It is no longer the only way the divisor is reached, and that correction is
|
|
109
|
-
* the whole of #3665. Shipped as the sole mechanism, it was set by nothing —
|
|
110
|
-
* one occurrence in the tree, its own declaration — so the divisor was inert
|
|
111
|
-
* for every consumer and the cap arrived as floor-only. Discovery is the layer
|
|
112
|
-
* that reaches a run nobody configured; this variable is now the way to
|
|
113
|
-
* override what discovery sees.
|
|
102
|
+
* runs are coming". Counting live sibling runs was retired with the scratch
|
|
103
|
+
* run roots it read (CodySwannGT/lisa#4602); headroom admission
|
|
104
|
+
* ({@link ADMITTED_WORKERS_VAR}) is what sizes a run to a busy machine now.
|
|
114
105
|
*/
|
|
115
106
|
export const FLEET_CONCURRENCY_VAR = "LISA_FLEET_CONCURRENCY";
|
|
107
|
+
/**
|
|
108
|
+
* Environment variable carrying the workers headroom admission granted.
|
|
109
|
+
*
|
|
110
|
+
* Set by `lisa admit` and `lisa-test-run` when `pushGate.admission` is on
|
|
111
|
+
* (CodySwannGT/lisa#4596). Admission has already measured the machine, so its
|
|
112
|
+
* grant replaces the floor and the divisor; only an explicit
|
|
113
|
+
* {@link MAX_WORKERS_OVERRIDE_VAR} outranks it.
|
|
114
|
+
*/
|
|
115
|
+
export const ADMITTED_WORKERS_VAR = "LISA_ADMITTED_WORKERS";
|
|
116
116
|
/**
|
|
117
117
|
* The pool size an uninstructed run gets.
|
|
118
118
|
*
|
|
@@ -149,157 +149,10 @@ const positiveInteger = (raw) => {
|
|
|
149
149
|
const value = Number(trimmed);
|
|
150
150
|
return value > 0 ? value : null;
|
|
151
151
|
};
|
|
152
|
-
/**
|
|
153
|
-
* How many Lisa test runs are live on this machine right now, including this one.
|
|
154
|
-
*
|
|
155
|
-
* ## Why this is discovered rather than declared
|
|
156
|
-
*
|
|
157
|
-
* The divisor shipped as an explicit signal, and for a release nothing set it:
|
|
158
|
-
* `LISA_FLEET_CONCURRENCY` occurred exactly once in the tree, at its own
|
|
159
|
-
* declaration. So the cap reached every consumer as floor-only, and the layer
|
|
160
|
-
* that addresses multi-agent contention was inert by default
|
|
161
|
-
* (CodySwannGT/lisa#3665).
|
|
162
|
-
*
|
|
163
|
-
* The obvious repair — pick a component and have it export the variable — fails
|
|
164
|
-
* its own test. **Nothing knows how many runs it is about to start.** Agents are
|
|
165
|
-
* launched independently, each in its own worktree, by whoever happens to be
|
|
166
|
-
* driving; there is no scheduler holding that number. A setter would have to
|
|
167
|
-
* guess, and a guessed fleet size that goes stale the moment the fleet resizes
|
|
168
|
-
* is a worse contract than no setter at all.
|
|
169
|
-
*
|
|
170
|
-
* What every run *can* do is look. Each supervised run already registers a
|
|
171
|
-
* `run-<pid>-<epoch>-<suffix>` root inside one namespace under `os.tmpdir()`,
|
|
172
|
-
* which on this platform is per-user and therefore shared by every checkout on
|
|
173
|
-
* the machine. Counting the roots whose owning process is still alive answers
|
|
174
|
-
* the question at the only moment it matters — when this run is about to size
|
|
175
|
-
* its pool — without anybody having to know the answer in advance.
|
|
176
|
-
*
|
|
177
|
-
* ## Fail open, never closed
|
|
178
|
-
*
|
|
179
|
-
* This runs inside a Vitest config factory, so a throw here does not degrade a
|
|
180
|
-
* test run, it prevents one. Every failure path returns 1 (no fleet detected),
|
|
181
|
-
* which yields the floor — the behaviour that shipped. An unreadable namespace,
|
|
182
|
-
* a permission error, a platform without `process.kill`, an absent directory on
|
|
183
|
-
* the very first run: all of them mean "no evidence of siblings", never "assume
|
|
184
|
-
* the worst and throttle".
|
|
185
|
-
*
|
|
186
|
-
* Our own pid is excluded rather than subtracted, because the config may load
|
|
187
|
-
* before or after this run registers its own root, and both orders must give
|
|
188
|
-
* the same count. The result adds one back for this run.
|
|
189
|
-
* @param deps - Injectable seams so tests state a fleet instead of spawning one.
|
|
190
|
-
* @param deps.namespaceDir - One directory holding run roots; overrides the candidates.
|
|
191
|
-
* @param deps.namespaceDirs - Every directory worth counting.
|
|
192
|
-
* @param deps.readDir - Directory lister.
|
|
193
|
-
* @param deps.isAlive - Process-liveness probe.
|
|
194
|
-
* @param deps.self - This process's id.
|
|
195
|
-
* @param deps.selfBasename - This run's own root basename, when supervised.
|
|
196
|
-
* @returns Live run count including this one; 1 when nothing else is detected.
|
|
197
|
-
*/
|
|
198
|
-
export function discoverFleetConcurrency(deps = {}) {
|
|
199
|
-
const { namespaceDir, namespaceDirs = namespaceDir === undefined
|
|
200
|
-
? candidateNamespaceDirs
|
|
201
|
-
: () => [namespaceDir()], readDir = (dir) => readdirSync(dir), isAlive = defaultIsAlive, self = process.pid, selfBasename = ownRunRootBasename, } = deps;
|
|
202
|
-
return (liveFleetRunRootNames({ namespaceDirs, readDir, isAlive }).filter(name => !isOwnRunRoot(name, self, selfBasename())).length + 1);
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* Every namespace a sibling run might have registered itself in.
|
|
206
|
-
*
|
|
207
|
-
* `scratchNamespaceDir()` is built on `os.tmpdir()`, which is `TMPDIR` when the
|
|
208
|
-
* environment sets one. Two agents with different `TMPDIR` values therefore
|
|
209
|
-
* enumerate different directories and each sees only its own cohort — a real,
|
|
210
|
-
* measured undercount, and the largest of the four named in #3941. The fix is
|
|
211
|
-
* not to relocate the scratch namespace, which the authority owns and which
|
|
212
|
-
* other machinery depends on: it is to LOOK in more than one place when
|
|
213
|
-
* counting. Reading a namespace that does not exist costs one `ENOENT`.
|
|
214
|
-
*
|
|
215
|
-
* `/tmp` is the platform default `os.tmpdir()` falls back to when `TMPDIR` is
|
|
216
|
-
* unset, so it is where a run with a plain environment registers. Including it
|
|
217
|
-
* makes a `TMPDIR`-carrying run see a plain one and vice versa. Windows has no
|
|
218
|
-
* such stable second location, so there the list is the resolved one alone.
|
|
219
|
-
* @returns Namespace directories to count, without duplicates.
|
|
220
|
-
*/
|
|
221
|
-
function candidateNamespaceDirs() {
|
|
222
|
-
const resolved = scratchNamespaceDir();
|
|
223
|
-
if (process.platform === "win32")
|
|
224
|
-
return [resolved];
|
|
225
|
-
const fallback = join("/tmp", basename(resolved));
|
|
226
|
-
return resolved === fallback ? [resolved] : [resolved, fallback];
|
|
227
|
-
}
|
|
228
|
-
/**
|
|
229
|
-
* This run's own scratch root basename, when it is supervised.
|
|
230
|
-
*
|
|
231
|
-
* The config factory runs inside the PAYLOAD process, whose pid is not the pid
|
|
232
|
-
* the run root is named for — the supervisor allocates the root before it forks
|
|
233
|
-
* the bootstrap that launches the payload. So `process.pid` never matches the
|
|
234
|
-
* run's own root, and a pid-only exclusion counts this run's root as a sibling
|
|
235
|
-
* and then adds one more for itself. The lease is the only thing in the payload
|
|
236
|
-
* that names the root, so it is what identifies it.
|
|
237
|
-
* @returns The run root basename, or undefined when this run is unsupervised.
|
|
238
|
-
*/
|
|
239
|
-
export function ownRunRootBasename() {
|
|
240
|
-
const raw = env[SCRATCH_SUPERVISION_LEASE_ENV];
|
|
241
|
-
if (raw === undefined)
|
|
242
|
-
return undefined;
|
|
243
|
-
try {
|
|
244
|
-
return parseScratchSupervisionLease(raw).suiteRootBasename;
|
|
245
|
-
}
|
|
246
|
-
catch {
|
|
247
|
-
return undefined;
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* Whether one run-root basename belongs to this run.
|
|
252
|
-
* @param name - Candidate run-root basename.
|
|
253
|
-
* @param self - This process's id.
|
|
254
|
-
* @param ownBasename - This run's own root basename, when it has one.
|
|
255
|
-
* @returns Whether the entry is this run rather than a sibling.
|
|
256
|
-
*/
|
|
257
|
-
function isOwnRunRoot(name, self, ownBasename) {
|
|
258
|
-
if (ownBasename !== undefined && name === ownBasename)
|
|
259
|
-
return true;
|
|
260
|
-
return parseScratchRunRootName(name)?.pid === self;
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* Names of every live run root across the namespaces worth counting.
|
|
264
|
-
*
|
|
265
|
-
* Fails open per namespace rather than per call: one unreadable directory must
|
|
266
|
-
* not erase the count from a readable one. An empty result means "no evidence
|
|
267
|
-
* of siblings", which yields the floor — the behaviour that shipped.
|
|
268
|
-
* @param deps - Injected seams; every one defaults to the real machine.
|
|
269
|
-
* @param deps.namespaceDirs - Directories to enumerate.
|
|
270
|
-
* @param deps.readDir - Directory lister.
|
|
271
|
-
* @param deps.isAlive - Process-liveness probe.
|
|
272
|
-
* @returns Live run-root basenames, de-duplicated across namespaces.
|
|
273
|
-
*/
|
|
274
|
-
export function liveFleetRunRootNames(deps = {}) {
|
|
275
|
-
const { namespaceDirs = candidateNamespaceDirs, readDir = (dir) => readdirSync(dir), isAlive = defaultIsAlive, } = deps;
|
|
276
|
-
const names = namespaceDirs().flatMap(dir => {
|
|
277
|
-
try {
|
|
278
|
-
return [...readDir(dir)];
|
|
279
|
-
}
|
|
280
|
-
catch {
|
|
281
|
-
// Absent namespace, unreadable directory, or a platform that refuses the
|
|
282
|
-
// probe. None of these is evidence of a fleet, and none may stop a run.
|
|
283
|
-
return [];
|
|
284
|
-
}
|
|
285
|
-
});
|
|
286
|
-
return [...new Set(names)].filter(name => {
|
|
287
|
-
const owner = parseScratchRunRootName(name);
|
|
288
|
-
if (owner === undefined)
|
|
289
|
-
return false;
|
|
290
|
-
try {
|
|
291
|
-
return isAlive(owner.pid);
|
|
292
|
-
}
|
|
293
|
-
catch {
|
|
294
|
-
return false;
|
|
295
|
-
}
|
|
296
|
-
});
|
|
297
|
-
}
|
|
298
152
|
/**
|
|
299
153
|
* The pool one run gets when a fleet of the stated size shares the machine.
|
|
300
154
|
*
|
|
301
|
-
*
|
|
302
|
-
* re-deriving the arithmetic. Never below {@link MIN_FLEET_WORKERS}, which is
|
|
155
|
+
* Never below {@link MIN_FLEET_WORKERS}, which is
|
|
303
156
|
* exactly why the product `fleetShare(cores, fleet) * fleet` grows without
|
|
304
157
|
* bound in `fleet` and why pool sizing alone cannot bound the fleet
|
|
305
158
|
* (CodySwannGT/lisa#3941).
|
|
@@ -310,43 +163,6 @@ export function liveFleetRunRootNames(deps = {}) {
|
|
|
310
163
|
export function fleetShare(cores, fleet) {
|
|
311
164
|
return Math.max(MIN_FLEET_WORKERS, Math.floor(cores / 2 / fleet));
|
|
312
165
|
}
|
|
313
|
-
/**
|
|
314
|
-
* Whether a pid names a live process.
|
|
315
|
-
*
|
|
316
|
-
* `EPERM` means the process exists and belongs to somebody else, which counts:
|
|
317
|
-
* another user's Lisa run still competes for this machine's cores. Only `ESRCH`
|
|
318
|
-
* — no such process — means the root is abandoned.
|
|
319
|
-
* @param pid - Process id to probe.
|
|
320
|
-
* @returns Whether it is alive.
|
|
321
|
-
*/
|
|
322
|
-
function defaultIsAlive(pid) {
|
|
323
|
-
try {
|
|
324
|
-
process.kill(pid, 0);
|
|
325
|
-
return true;
|
|
326
|
-
}
|
|
327
|
-
catch (error) {
|
|
328
|
-
return error.code === "EPERM";
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
/**
|
|
332
|
-
* Why discovery no longer truncates its listing.
|
|
333
|
-
*
|
|
334
|
-
* A `.slice(0, 4_096)` used to bound the entries inspected, and the stated
|
|
335
|
-
* reason was that an unbounded `readdir` over a pathologically grown directory
|
|
336
|
-
* is the shape that once turned a shared temp directory into a 24.8 MB inode.
|
|
337
|
-
* The concern is real; the slice did not address it. `readdirSync` materialises
|
|
338
|
-
* the WHOLE listing before anything can slice it, so the expensive part had
|
|
339
|
-
* already happened — the bound removed only the per-name regex, and bought that
|
|
340
|
-
* saving by silently undercounting the fleet the moment the namespace held more
|
|
341
|
-
* than 4,096 entries. This namespace has been measured holding 3,730
|
|
342
|
-
* (CodySwannGT/lisa#3032), so the undercount was reachable rather than
|
|
343
|
-
* theoretical, and it undercounts hardest exactly when the fleet is largest.
|
|
344
|
-
*
|
|
345
|
-
* A bound that protects nothing and corrupts the count is worse than no bound,
|
|
346
|
-
* so the listing is now counted in full. The real protection against a grown
|
|
347
|
-
* namespace lives where the reading happens — `MAX_SCRATCH_NAMESPACE_SCAN_ENTRIES`
|
|
348
|
-
* in the scratch authority — not here.
|
|
349
|
-
*/
|
|
350
166
|
/**
|
|
351
167
|
* Resolves the Vitest worker-pool cap for this run.
|
|
352
168
|
*
|
|
@@ -372,16 +188,19 @@ function defaultIsAlive(pid) {
|
|
|
372
188
|
* fleet's total pool is bounded by the machine rather than multiplied by its
|
|
373
189
|
* own size — never below {@link MIN_FLEET_WORKERS}. That number comes from
|
|
374
190
|
* {@link FLEET_CONCURRENCY_VAR} when something states it, and otherwise from
|
|
375
|
-
*
|
|
376
|
-
*
|
|
377
|
-
*
|
|
191
|
+
* the injected `discover` seam, which defaults to "this run alone". The
|
|
192
|
+
* live-sibling count it used to make read the scratch run roots retired in
|
|
193
|
+
* CodySwannGT/lisa#4602.
|
|
378
194
|
* 3. **Override.** {@link MAX_WORKERS_OVERRIDE_VAR} replaces both, upward or
|
|
379
195
|
* downward.
|
|
380
196
|
*
|
|
381
|
-
*
|
|
382
|
-
*
|
|
383
|
-
*
|
|
384
|
-
*
|
|
197
|
+
* Between the override and the divisor sits the **admitted grant**,
|
|
198
|
+
* {@link ADMITTED_WORKERS_VAR}: when headroom admission started this run it has
|
|
199
|
+
* already measured the machine, so its number replaces the fleet arithmetic.
|
|
200
|
+
*
|
|
201
|
+
* A stated signal outranks the `discover` seam rather than being reconciled
|
|
202
|
+
* with it. An operator who says "we are six" is describing an intent — six runs
|
|
203
|
+
* are coming, even if only two have started.
|
|
385
204
|
* ## Why the environment is imported rather than reached for
|
|
386
205
|
*
|
|
387
206
|
* The default comes from `node:process`'s `env` binding, not from the ambient
|
|
@@ -394,13 +213,18 @@ function defaultIsAlive(pid) {
|
|
|
394
213
|
* parameter injectable so tests state an environment rather than mutating one.
|
|
395
214
|
* @param environment - Environment to read; defaults to this process's.
|
|
396
215
|
* @param cores - Logical cores available; defaults to this machine's count.
|
|
397
|
-
* @param discover - Fleet
|
|
216
|
+
* @param discover - Fleet size when nothing states one; defaults to 1.
|
|
398
217
|
* @returns A value for Vitest's `maxWorkers` — a worker count, or a percentage.
|
|
399
218
|
*/
|
|
400
|
-
export function resolveMaxWorkers(environment = env, cores = availableParallelism(), discover =
|
|
219
|
+
export function resolveMaxWorkers(environment = env, cores = availableParallelism(), discover = () => 1) {
|
|
401
220
|
const override = positiveInteger(environment[MAX_WORKERS_OVERRIDE_VAR]);
|
|
402
221
|
if (override !== null)
|
|
403
222
|
return override;
|
|
223
|
+
// Headroom admission already sized this run to the machine
|
|
224
|
+
// (CodySwannGT/lisa#4596), so the grant wins over any fleet arithmetic.
|
|
225
|
+
const admitted = positiveInteger(environment[ADMITTED_WORKERS_VAR]);
|
|
226
|
+
if (admitted !== null)
|
|
227
|
+
return admitted;
|
|
404
228
|
const stated = positiveInteger(environment[FLEET_CONCURRENCY_VAR]);
|
|
405
229
|
const fleet = stated ?? discover();
|
|
406
230
|
if (fleet <= 1)
|
|
@@ -425,35 +249,55 @@ const resolveSiblingModule = (basename) => {
|
|
|
425
249
|
: fileURLToPath(new URL(`./${basename}.ts`, import.meta.url));
|
|
426
250
|
};
|
|
427
251
|
/**
|
|
428
|
-
*
|
|
429
|
-
*
|
|
430
|
-
*
|
|
431
|
-
*
|
|
432
|
-
*
|
|
433
|
-
*
|
|
434
|
-
*
|
|
435
|
-
*
|
|
252
|
+
* Per-worker setup files for the suite's temporary directories: none.
|
|
253
|
+
*
|
|
254
|
+
* This used to wire the scratch redirection and leak audit into every worker.
|
|
255
|
+
* That per-test policing was retired (CodySwannGT/lisa#4602): stale Lisa temp
|
|
256
|
+
* entries and orphaned test processes are now cleared once, by the
|
|
257
|
+
* start-of-run sweep in `lisa-test-run` and the gate runner
|
|
258
|
+
* (CodySwannGT/lisa#4597), and each test still removes what it creates. The
|
|
259
|
+
* function is kept so every stack factory and downstream config that spreads
|
|
260
|
+
* it keeps working.
|
|
261
|
+
* @returns An empty list to spread into `test.setupFiles`.
|
|
436
262
|
*/
|
|
437
263
|
export function scratchSetupFiles() {
|
|
264
|
+
return [];
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Per-worker setup for the test-to-file access map (CodySwannGT/lisa#4611).
|
|
268
|
+
*
|
|
269
|
+
* Names each test file for the tracer, and only when `LISA_ACCESS_MAP=1`, so
|
|
270
|
+
* an ordinary run gets nothing. CI sets that variable on a pull request, and
|
|
271
|
+
* the map it records is what lets a TypeScript host's push run only the tests
|
|
272
|
+
* a change can reach.
|
|
273
|
+
* @returns Setup files to spread into `test.setupFiles`.
|
|
274
|
+
*/
|
|
275
|
+
export function accessMapSetupFiles() {
|
|
276
|
+
return testAccessMapSetupFiles(env);
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* The Vite plugins every stack preset carries: the access-map recorder.
|
|
280
|
+
*
|
|
281
|
+
* It does nothing unless `LISA_ACCESS_MAP=1` and the project's effective
|
|
282
|
+
* `pushGate.affectedTests` is on, so it only costs anything on a CI run whose
|
|
283
|
+
* map a push will read.
|
|
284
|
+
* @returns Plugins for the preset's top-level `plugins`.
|
|
285
|
+
*/
|
|
286
|
+
export function accessMapPlugins() {
|
|
438
287
|
return [
|
|
439
|
-
|
|
440
|
-
resolveSiblingModule("scratch-leak-setup"),
|
|
288
|
+
testAccessMapPlugin(),
|
|
441
289
|
];
|
|
442
290
|
}
|
|
443
291
|
/**
|
|
444
|
-
* Global setup
|
|
292
|
+
* Global setup for the suite's temporary directories: none.
|
|
445
293
|
*
|
|
446
|
-
*
|
|
447
|
-
*
|
|
448
|
-
*
|
|
449
|
-
*
|
|
450
|
-
* @returns Absolute paths to spread into `test.globalSetup`.
|
|
294
|
+
* The residue audit that ran here was retired with the rest of the scratch
|
|
295
|
+
* policing (CodySwannGT/lisa#4602); see {@link scratchSetupFiles}. Kept so
|
|
296
|
+
* existing callers keep working.
|
|
297
|
+
* @returns An empty list to spread into `test.globalSetup`.
|
|
451
298
|
*/
|
|
452
299
|
export function scratchGlobalSetup() {
|
|
453
|
-
return [
|
|
454
|
-
resolveSiblingModule("fleet-admission-global-setup"),
|
|
455
|
-
resolveSiblingModule("scratch-global-setup"),
|
|
456
|
-
];
|
|
300
|
+
return [];
|
|
457
301
|
}
|
|
458
302
|
/**
|
|
459
303
|
* Global setup that refuses a coverage run measuring an empty file set.
|
|
@@ -560,9 +404,13 @@ export const mergeVitestConfigs = (...configs) => {
|
|
|
560
404
|
return configs.reduce((acc, config) => {
|
|
561
405
|
const accTest = (acc.test ?? {});
|
|
562
406
|
const configTest = (config.test ?? {});
|
|
407
|
+
// Plugins accumulate rather than replace, so a project's local plugins
|
|
408
|
+
// keep the preset's access-map recorder (CodySwannGT/lisa#4611).
|
|
409
|
+
const plugins = [...(acc.plugins ?? []), ...(config.plugins ?? [])];
|
|
563
410
|
return {
|
|
564
411
|
...acc,
|
|
565
412
|
...config,
|
|
413
|
+
...(plugins.length > 0 ? { plugins } : {}),
|
|
566
414
|
test: mergeObjects(accTest, configTest),
|
|
567
415
|
};
|
|
568
416
|
}, {});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/configs/vitest/base.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/configs/vitest/base.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,OAAO,EACL,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,0CAA0C,CAAC;A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E,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC;QAEpE,OAAO;YACL,GAAG,GAAG;YACN,GAAG,MAAM;YACT,GAAG,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC1C,IAAI,EAAE,YAAY,CAAC,OAAO,EAAE,UAAU,CAAC;SACxC,CAAC;IACJ,CAAC,EAAE,EAAgB,CAAC,CAAC;AACvB,CAAC,CAAC;AAEF,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACpB,6BAA6B,GAC9B,MAAM,iCAAiC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdk.d.ts","sourceRoot":"","sources":["../../../src/configs/vitest/cdk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,8DAA8D;AAC9D,KAAK,UAAU,GAAG,cAAc,CAAC;AAEjC,OAAO,
|
|
1
|
+
{"version":3,"file":"cdk.d.ts","sourceRoot":"","sources":["../../../src/configs/vitest/cdk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,8DAA8D;AAC9D,KAAK,UAAU,GAAG,cAAc,CAAC;AAEjC,OAAO,EAGL,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEpD,8EAA8E;AAC9E,eAAO,MAAM,kBAAkB,YAAY,CAAC;AAE5C,mEAAmE;AACnE,eAAO,MAAM,iBAAiB,QAAQ,CAAC;AAGvC,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,GAClB,CAAC;AAEF,YAAY,EAAE,kBAAkB,EAAE,CAAC;AAEnC;;GAEG;AACH,UAAU,gBAAgB;IACxB,mFAAmF;IACnF,QAAQ,CAAC,UAAU,CAAC,EAAE,kBAAkB,CAAC;CAC1C;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,GAAI,kBAEhC,gBAAqB,KAAG,UAgCzB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { coverageGlobalSetup, coverageReportsDirectory, defaultCoverageExclusions, defaultTestExclusions, defaultThresholds, mapThresholds, mergeThresholds, mergeVitestConfigs, resolveMaxWorkers, scratchGlobalSetup, scratchSetupFiles, } from "./base.js";
|
|
1
|
+
import { accessMapPlugins, accessMapSetupFiles, coverageGlobalSetup, coverageReportsDirectory, defaultCoverageExclusions, defaultTestExclusions, defaultThresholds, mapThresholds, mergeThresholds, mergeVitestConfigs, resolveMaxWorkers, scratchGlobalSetup, scratchSetupFiles, } from "./base.js";
|
|
2
2
|
/** Prefix used by AWS CDK's default CloudAssemblyBuilder output directory. */
|
|
3
3
|
export const CDK_SCRATCH_PREFIX = "cdk.out";
|
|
4
4
|
/** Opaque owner label recorded before a CDK suite is collected. */
|
|
@@ -17,8 +17,9 @@ export { coverageGlobalSetup, coverageReportsDirectory, defaultCoverageExclusion
|
|
|
17
17
|
* @returns Vitest UserConfig object with node environment and CDK-specific paths
|
|
18
18
|
*/
|
|
19
19
|
export const getCdkVitestConfig = ({ thresholds, } = {}) => ({
|
|
20
|
+
plugins: [...accessMapPlugins()],
|
|
20
21
|
test: {
|
|
21
|
-
setupFiles: [...scratchSetupFiles()],
|
|
22
|
+
setupFiles: [...scratchSetupFiles(), ...accessMapSetupFiles()],
|
|
22
23
|
globalSetup: [...scratchGlobalSetup(), ...coverageGlobalSetup()],
|
|
23
24
|
sequence: { setupFiles: "list", hooks: "stack" },
|
|
24
25
|
// Bounded so k concurrent runs do not claim k x cores. See resolveMaxWorkers.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdk.js","sourceRoot":"","sources":["../../../src/configs/vitest/cdk.ts"],"names":[],"mappings":"AAiBA,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,WAAW,CAAC;AAInB,8EAA8E;AAC9E,MAAM,CAAC,MAAM,kBAAkB,GAAG,SAAS,CAAC;AAE5C,mEAAmE;AACnE,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAEvC,mDAAmD;AACnD,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,GAClB,CAAC;AAYF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EACjC,UAAU,MACU,EAAE,EAAc,EAAE,CAAC,CAAC;IACxC,IAAI,EAAE;QACJ,UAAU,EAAE,CAAC,GAAG,iBAAiB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"cdk.js","sourceRoot":"","sources":["../../../src/configs/vitest/cdk.ts"],"names":[],"mappings":"AAiBA,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,EAC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O,EAAE,CAAC,GAAG,yBAAyB,CAAC;YACvC,UAAU,EAAE,aAAa,CACvB,UAAU;gBACR,CAAC,CAAC,eAAe,CAAC,iBAAiB,EAAE,UAAU,CAAC;gBAChD,CAAC,CAAC,iBAAiB,CACtB;SACF;KACF;CACF,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coverage-include-global-setup.d.ts","sourceRoot":"","sources":["../../../src/configs/vitest/coverage-include-global-setup.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"coverage-include-global-setup.d.ts","sourceRoot":"","sources":["../../../src/configs/vitest/coverage-include-global-setup.ts"],"names":[],"mappings":"AAgCA;;;;;;;;GAQG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,CAAC,EACZ;QACE,QAAQ,CAAC,QAAQ,CAAC,EACd;YACE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;YACvC,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;SAClD,GACD,SAAS,CAAC;QACd,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;KACpC,GACD,SAAS,CAAC;CACf;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,KAAK,GAAI,UAAU,eAAe,KAAG,IAiBjD,CAAC"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* the hook that acts on the verdict.
|
|
8
8
|
*
|
|
9
9
|
* IT LIVES IN `setup`, NOT `teardown`, and that placement is load-bearing for
|
|
10
|
-
*
|
|
10
|
+
* a measured reason: vitest SWALLOWS a throw
|
|
11
11
|
* from `globalSetup` teardown — it prints `error during close` and the process
|
|
12
12
|
* still exits 0 — while the same throw from `setup` exits 1. A guard placed in
|
|
13
13
|
* a hook the runner ignores is the very defect this file exists to stop,
|
|
@@ -20,8 +20,7 @@
|
|
|
20
20
|
* boundary is deliberate: the claim being protected is "coverage met the
|
|
21
21
|
* threshold", and nothing else here is a claim about coverage.
|
|
22
22
|
*
|
|
23
|
-
* It
|
|
24
|
-
* own. A refusal speaks twice, a banner before collection and a summary line at
|
|
23
|
+
* It uses the shared two-part announcement. A refusal speaks twice, a banner before collection and a summary line at
|
|
25
24
|
* exit, because those are the top and the bottom of a transcript nobody reads
|
|
26
25
|
* in full — and the summary line already says the exact thing that is true
|
|
27
26
|
* here: the run was refused before collection, so no coverage was measured.
|
|
@@ -29,7 +28,7 @@
|
|
|
29
28
|
* @module configs/vitest/coverage-include-global-setup
|
|
30
29
|
*/
|
|
31
30
|
import { describeCoverageIncludeFailure } from "./coverage-include-authority.js";
|
|
32
|
-
import { announceRefusal } from "./
|
|
31
|
+
import { announceRefusal } from "./refusal-announcement.js";
|
|
33
32
|
/**
|
|
34
33
|
* Refuses the run when coverage would be measured over an empty file set.
|
|
35
34
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coverage-include-global-setup.js","sourceRoot":"","sources":["../../../src/configs/vitest/coverage-include-global-setup.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"coverage-include-global-setup.js","sourceRoot":"","sources":["../../../src/configs/vitest/coverage-include-global-setup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,EAAE,8BAA8B,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAyB5D;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,OAAyB,EAAQ,EAAE;IACvD,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,CAAC;IAC/B,MAAM,IAAI,GAAG,MAAM,EAAE,IAAI,CAAC;IAC1B,IAAI,MAAM,KAAK,SAAS,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO;IAEvD,MAAM,OAAO,GAAG,8BAA8B,CAAC;QAC7C,OAAO,EAAE,MAAM,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI;QAC1C,OAAO,EAAE,MAAM,CAAC,QAAQ,EAAE,OAAO;QACjC,IAAI;KACL,CAAC,CAAC;IAEH,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,uEAAuE;QACvE,oCAAoC;QACpC,eAAe,CAAC,OAAO,CAAC,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Name one run directory from the identity of the run that owns it.
|
|
3
|
+
* @param owner - Process id owning the run
|
|
4
|
+
* @param startedAt - Epoch milliseconds the directory was named
|
|
5
|
+
* @param suffix - Opaque random suffix, free of `-`
|
|
6
|
+
* @returns The directory basename
|
|
7
|
+
*/
|
|
8
|
+
export declare function runRootName(owner: number, startedAt: number, suffix: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* Parse the owner fields encoded in a run directory basename.
|
|
11
|
+
* @param name - Directory basename
|
|
12
|
+
* @returns Parsed owner, or undefined for an unrelated name
|
|
13
|
+
*/
|
|
14
|
+
export declare function parseRunRootName(name: string): {
|
|
15
|
+
readonly pid: number;
|
|
16
|
+
readonly startedAt: number;
|
|
17
|
+
} | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Whether a pid names a live process. `EPERM` means it exists and belongs to
|
|
20
|
+
* somebody else, which counts as alive.
|
|
21
|
+
* @param owner - Process id to probe
|
|
22
|
+
* @returns Whether it is alive
|
|
23
|
+
*/
|
|
24
|
+
export declare const isProcessAlive: (owner: number) => boolean;
|
|
1
25
|
/**
|
|
2
26
|
* Directory under `coverage/` holding one run's isolated output.
|
|
3
27
|
*
|
|
@@ -90,11 +114,9 @@ export declare function removeOwnCoverageRunDirectory(directory: string, expecte
|
|
|
90
114
|
* always probes alive. The lock this module refuses has the opposite asymmetry
|
|
91
115
|
* — there, a wrong answer releases a lock somebody is holding.
|
|
92
116
|
*
|
|
93
|
-
*
|
|
94
|
-
* {@link isProcessAlive}
|
|
95
|
-
*
|
|
96
|
-
* that parser reads them unchanged. Anything it does not recognise is left
|
|
97
|
-
* alone.
|
|
117
|
+
* {@link parseRunRootName} reads the names {@link runRootName} writes, and
|
|
118
|
+
* {@link isProcessAlive} probes their owner. Anything it does not recognise
|
|
119
|
+
* is left alone.
|
|
98
120
|
* @param runsRoot - Directory holding the run directories
|
|
99
121
|
* @param alive - Liveness probe; defaults to the shared one
|
|
100
122
|
* @returns Basenames of the directories removed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coverage-reports-directory.d.ts","sourceRoot":"","sources":["../../../src/configs/vitest/coverage-reports-directory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"coverage-reports-directory.d.ts","sourceRoot":"","sources":["../../../src/configs/vitest/coverage-reports-directory.ts"],"names":[],"mappings":"AAmEA;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACb,MAAM,CAER;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,GACX;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAQlE;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM,KAAG,OAO9C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,UAAU,CAAC;AAEzC;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,wBAAwB,8BAA8B,CAAC;AAkBpE;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACb,MAAM,CAER;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,GACnB,OAAO,CAyBT;AAED;;;;;;;;;GASG;AACH,wBAAgB,6BAA6B,CAC3C,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,GACnB,OAAO,CAWT;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,sCAAsC,CACpD,QAAQ,GAAE,MAAoD,EAC9D,KAAK,GAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAwB,GACjD,SAAS,MAAM,EAAE,CAenB;AAYD;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,WAAW,GAAE,MAAM,CAAC,UAAgB,GACnC,MAAM,CAcR;AAkCD;;;;;;GAMG;AACH,wBAAgB,6BAA6B,IAAI,IAAI,CAGpD"}
|
|
@@ -43,9 +43,8 @@
|
|
|
43
43
|
* cleaning a directory two runs share is precisely what deletes the other
|
|
44
44
|
* run's files.
|
|
45
45
|
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* {@link runRootName} rather than re-spelled, so the two cannot drift apart.
|
|
46
|
+
* Each directory is named `run-<pid>-<startedAt>-<suffix>` by
|
|
47
|
+
* {@link runRootName}, so a dead owner can be recognised and reclaimed.
|
|
49
48
|
*
|
|
50
49
|
* ## What this does not change
|
|
51
50
|
*
|
|
@@ -62,8 +61,48 @@ import { randomBytes } from "node:crypto";
|
|
|
62
61
|
import * as fs from "node:fs";
|
|
63
62
|
import * as path from "node:path";
|
|
64
63
|
import { env, pid } from "node:process";
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
/** Prefix of every run directory name, `run-<pid>-<startedAt>-<suffix>`. */
|
|
65
|
+
const RUN_DIRECTORY_PREFIX = "run-";
|
|
66
|
+
/**
|
|
67
|
+
* Name one run directory from the identity of the run that owns it.
|
|
68
|
+
* @param owner - Process id owning the run
|
|
69
|
+
* @param startedAt - Epoch milliseconds the directory was named
|
|
70
|
+
* @param suffix - Opaque random suffix, free of `-`
|
|
71
|
+
* @returns The directory basename
|
|
72
|
+
*/
|
|
73
|
+
export function runRootName(owner, startedAt, suffix) {
|
|
74
|
+
return `${RUN_DIRECTORY_PREFIX}${String(owner)}-${String(startedAt)}-${suffix}`;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Parse the owner fields encoded in a run directory basename.
|
|
78
|
+
* @param name - Directory basename
|
|
79
|
+
* @returns Parsed owner, or undefined for an unrelated name
|
|
80
|
+
*/
|
|
81
|
+
export function parseRunRootName(name) {
|
|
82
|
+
const match = /^run-(\d+)-(\d+)-[^-]+$/.exec(name);
|
|
83
|
+
if (match === null)
|
|
84
|
+
return undefined;
|
|
85
|
+
const owner = Number(match[1]);
|
|
86
|
+
const startedAt = Number(match[2]);
|
|
87
|
+
return Number.isSafeInteger(owner) && Number.isSafeInteger(startedAt)
|
|
88
|
+
? { pid: owner, startedAt }
|
|
89
|
+
: undefined;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Whether a pid names a live process. `EPERM` means it exists and belongs to
|
|
93
|
+
* somebody else, which counts as alive.
|
|
94
|
+
* @param owner - Process id to probe
|
|
95
|
+
* @returns Whether it is alive
|
|
96
|
+
*/
|
|
97
|
+
export const isProcessAlive = (owner) => {
|
|
98
|
+
try {
|
|
99
|
+
process.kill(owner, 0);
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
return error.code === "EPERM";
|
|
104
|
+
}
|
|
105
|
+
};
|
|
67
106
|
/**
|
|
68
107
|
* Directory under `coverage/` holding one run's isolated output.
|
|
69
108
|
*
|
|
@@ -213,11 +252,9 @@ export function removeOwnCoverageRunDirectory(directory, expectedName) {
|
|
|
213
252
|
* always probes alive. The lock this module refuses has the opposite asymmetry
|
|
214
253
|
* — there, a wrong answer releases a lock somebody is holding.
|
|
215
254
|
*
|
|
216
|
-
*
|
|
217
|
-
* {@link isProcessAlive}
|
|
218
|
-
*
|
|
219
|
-
* that parser reads them unchanged. Anything it does not recognise is left
|
|
220
|
-
* alone.
|
|
255
|
+
* {@link parseRunRootName} reads the names {@link runRootName} writes, and
|
|
256
|
+
* {@link isProcessAlive} probes their owner. Anything it does not recognise
|
|
257
|
+
* is left alone.
|
|
221
258
|
* @param runsRoot - Directory holding the run directories
|
|
222
259
|
* @param alive - Liveness probe; defaults to the shared one
|
|
223
260
|
* @returns Basenames of the directories removed
|