@gfdelarue/testkit 0.4.5 → 0.6.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 +724 -495
- package/bin/testkit-windows-owner-arm64.exe +0 -0
- package/bin/testkit-windows-owner-x64.exe +0 -0
- package/dist/app/bugs/ci-report.js +2 -2
- package/dist/app/bugs/ci-summary.js +3 -3
- package/dist/app/bugs/draft.js +3 -3
- package/dist/app/bugs/file.js +1 -1
- package/dist/app/bugs/gate.js +1 -1
- package/dist/app/bugs/guide.js +3 -3
- package/dist/app/bugs/issue.js +4 -4
- package/dist/app/bugs/known-failures.js +1 -1
- package/dist/app/bugs/record.js +1 -1
- package/dist/app/bugs/run-reading.js +1 -1
- package/dist/app/bugs/supplied-reproduce.js +1 -0
- package/dist/app/campaigns/campaign.js +1 -1
- package/dist/app/campaigns/index.js +2 -2
- package/dist/app/cleanup/index.js +1 -1
- package/dist/app/db-schema/prepare.js +1 -1
- package/dist/app/destroy/index.js +1 -1
- package/dist/app/discover/index.js +2 -2
- package/dist/app/doctor/index.js +1 -1
- package/dist/app/environments/config-driven.js +1 -1
- package/dist/app/environments/environment-file.js +1 -0
- package/dist/app/environments/file-setup.js +1 -0
- package/dist/app/environments/routing.js +1 -1
- package/dist/app/environments/static-values.js +1 -0
- package/dist/app/environments/supplied-input.js +1 -0
- package/dist/app/environments/supplied.js +1 -1
- package/dist/app/environments/task-databases.js +2 -0
- package/dist/app/inspect/artifacts.js +1 -1
- package/dist/app/inspect/index.js +1 -1
- package/dist/app/lint/index.js +1 -1
- package/dist/app/lint/native.js +1 -1
- package/dist/app/lint/options.js +1 -1
- package/dist/app/lint/rules/engine-imports.js +1 -1
- package/dist/app/lint/rules/syntax.js +1 -1
- package/dist/app/lint/rules/unit.js +1 -1
- package/dist/app/reports/prepare.js +1 -1
- package/dist/app/run/caller-redaction.js +1 -0
- package/dist/app/run/engine-execution-failures.js +1 -1
- package/dist/app/run/engine-execution-reporting.js +1 -1
- package/dist/app/run/engine-execution.js +1 -1
- package/dist/app/run/engine-orchestration.js +1 -1
- package/dist/app/run/environment.js +1 -1
- package/dist/app/run/failure-details.js +1 -1
- package/dist/app/run/live-run.js +1 -1
- package/dist/app/run/orchestrator.js +1 -1
- package/dist/app/run/planning.js +1 -1
- package/dist/app/run/request.js +1 -1
- package/dist/app/run/results.js +1 -1
- package/dist/app/run/run-events.js +1 -1
- package/dist/app/run/run-finalization.js +1 -1
- package/dist/app/run/scheduler/estimates.js +1 -1
- package/dist/app/run/scheduler/identity.js +1 -1
- package/dist/app/run/scheduler/index.js +1 -1
- package/dist/app/run/setup/runtime-node-setup-protocol.js +1 -1
- package/dist/app/run/setup/runtime-node-setup-worker.js +1 -1
- package/dist/app/run/setup/runtime-node-setup.js +2 -2
- package/dist/app/run/task-batches.js +1 -1
- package/dist/app/run/worker-loop.js +1 -1
- package/dist/app/status/model.js +1 -1
- package/dist/app/status/runs.js +1 -1
- package/dist/app/typecheck/index.js +4 -4
- package/dist/cli/command-catalog.js +1 -1
- package/dist/cli/command-flags.js +1 -1
- package/dist/cli/commands/artifacts.js +2 -2
- package/dist/cli/commands/bug/file.js +2 -2
- package/dist/cli/commands/bug/record.js +2 -2
- package/dist/cli/commands/discover.js +1 -1
- package/dist/cli/commands/guard/unsafe-entrypoint.js +1 -1
- package/dist/cli/commands/run.js +2 -2
- package/dist/cli/commands/typecheck.js +1 -1
- package/dist/cli/commands/workspace.js +1 -1
- package/dist/cli/framework/errors.js +1 -1
- package/dist/cli/framework/execute.js +7 -6
- package/dist/cli/framework/parser.js +1 -1
- package/dist/cli/operations/run/operation.js +2 -2
- package/dist/cli/renderers/bug/text.js +1 -1
- package/dist/cli/renderers/discover/report.js +1 -1
- package/dist/cli/renderers/run/events.js +2 -2
- package/dist/cli/renderers/run/formatting.js +1 -1
- package/dist/cli/renderers/run/status.js +1 -1
- package/dist/cli/renderers/run/text-reporter.js +24 -22
- package/dist/cli/terminal/colors.js +1 -1
- package/dist/cli/terminal/layout.js +2 -2
- package/dist/config/authoring/database-fixture-discovery.js +1 -0
- package/dist/config/authoring/http-methods.js +1 -1
- package/dist/config/authoring/index.js +1 -1
- package/dist/config/loader/config-loader.js +1 -1
- package/dist/config/loader/decode-discovery.js +1 -1
- package/dist/config/loader/decode-execution.js +1 -1
- package/dist/config/loader/dependencies.js +1 -1
- package/dist/config/loader/discover-tests.js +1 -1
- package/dist/config/loader/discovery-summary.js +1 -1
- package/dist/config/loader/discovery.js +2 -2
- package/dist/config/loader/env.js +1 -1
- package/dist/config/loader/file-metadata.js +1 -1
- package/dist/config/loader/groups.js +2 -1
- package/dist/config/loader/index.js +1 -1
- package/dist/config/loader/load.js +1 -1
- package/dist/config/loader/managed-configs.js +1 -1
- package/dist/config/loader/owned-discovery.js +1 -0
- package/dist/config/loader/path-policy.js +1 -1
- package/dist/config/loader/runtime-isolation.js +1 -1
- package/dist/config/loader/runtime.js +1 -1
- package/dist/config/loader/skip-config.js +1 -1
- package/dist/config/loader/task-policy.js +1 -0
- package/dist/config/loader/test-selection.js +1 -1
- package/dist/config/loader/validation.js +1 -1
- package/dist/database/admin.js +2 -2
- package/dist/database/bindings.js +1 -0
- package/dist/database/cleanup.js +1 -1
- package/dist/database/configured-steps.js +1 -1
- package/dist/database/docker-metadata.js +3 -3
- package/dist/database/docker.js +3 -3
- package/dist/database/index.js +1 -1
- package/dist/database/local-postgres.js +1 -1
- package/dist/database/naming.js +1 -1
- package/dist/database/postgres/connection-check.js +1 -0
- package/dist/database/postgres/protocol.js +2 -0
- package/dist/database/schema-operations.js +1 -1
- package/dist/database/schema-source.js +3 -3
- package/dist/database/source-schema-env.js +1 -0
- package/dist/database/state-files.js +1 -1
- package/dist/database/state.js +1 -1
- package/dist/database/steps.js +3 -3
- package/dist/domain/file-timeout.js +1 -1
- package/dist/domain/identifiers.js +1 -1
- package/dist/domain/retired-test-types.js +1 -0
- package/dist/domain/runtime-isolation-contract.js +1 -1
- package/dist/domain/suite-selection.js +1 -1
- package/dist/domain/test-types.js +1 -1
- package/dist/engines/adapters/evidence-files.js +1 -1
- package/dist/engines/adapters/execution.js +1 -1
- package/dist/engines/adapters/json-bounds.js +2 -0
- package/dist/engines/adapters/native-report.js +1 -1
- package/dist/engines/api/execution.js +1 -1
- package/dist/engines/api/index.js +1 -1
- package/dist/engines/api/runtime-artifact.js +1 -1
- package/dist/engines/catalog.js +1 -1
- package/dist/engines/contracts/environment-values.js +1 -0
- package/dist/engines/definitions.js +1 -1
- package/dist/engines/environment/handles.js +1 -0
- package/dist/engines/environment/index.js +1 -0
- package/dist/engines/factory.js +1 -1
- package/dist/engines/installations/node-vitest.js +1 -1
- package/dist/engines/installations/package-resolution.js +1 -1
- package/dist/engines/installations/playwright.js +1 -1
- package/dist/engines/managed-module-resolution.js +8 -4
- package/dist/engines/manager.js +1 -1
- package/dist/engines/node-vitest/adapter/adapter.js +1 -1
- package/dist/engines/node-vitest/adapter/driver.js +2 -0
- package/dist/engines/node-vitest/adapter/evidence.js +2 -2
- package/dist/engines/node-vitest/adapter/failure-details.js +4 -2
- package/dist/engines/node-vitest/adapter/reporter.js +1 -1
- package/dist/engines/node-vitest/adapter/workspace.js +17 -195
- package/dist/engines/node-vitest/inventory/index.js +2 -0
- package/dist/engines/node-vitest/inventory/list-files.js +3 -0
- package/dist/engines/node-vitest/runtime/data/index.js +1 -1
- package/dist/engines/node-vitest/runtime/data/report.js +5 -6
- package/dist/engines/node-vitest/runtime/data/scenario.js +2 -2
- package/dist/engines/node-vitest/runtime/runtime-input.js +1 -1
- package/dist/engines/node-vitest/selection.js +1 -0
- package/dist/engines/playwright/adapter/adapter.js +1 -1
- package/dist/engines/playwright/adapter/config.js +3 -3
- package/dist/engines/playwright/adapter/evidence-validation.js +1 -1
- package/dist/engines/playwright/adapter/evidence.js +1 -1
- package/dist/engines/playwright/adapter/reporter.js +1 -1
- package/dist/engines/playwright/runtime/config-file.js +1 -1
- package/dist/engines/playwright/runtime/config.js +1 -1
- package/dist/engines/playwright/runtime/managed-test.js +1 -0
- package/dist/engines/playwright/runtime/runtime-input.js +29 -10
- package/dist/engines/runtime-input-file.js +1 -1
- package/dist/environment/lifecycle-controller.js +1 -1
- package/dist/environment/lifecycle.js +1 -1
- package/dist/environment/ready-environment.js +1 -1
- package/dist/environment/run-environment.js +1 -1
- package/dist/environment/run-stopping.js +1 -1
- package/dist/environment/runtime-contexts.js +1 -1
- package/dist/environment/runtime-manager.js +1 -1
- package/dist/environment/runtime-planning.js +1 -1
- package/dist/environment/runtime-preparation.js +1 -1
- package/dist/environment/services.js +3 -3
- package/dist/environment/template.js +1 -1
- package/dist/evidence/artifact-config.js +1 -1
- package/dist/evidence/artifacts.js +2 -2
- package/dist/evidence/bundles.js +1 -1
- package/dist/evidence/environment-record.js +1 -1
- package/dist/evidence/index.js +1 -1
- package/dist/evidence/maintenance.js +1 -0
- package/dist/evidence/read-run.js +1 -1
- package/dist/evidence/reading.js +1 -1
- package/dist/evidence/redaction.js +4 -0
- package/dist/evidence/reporting.js +1 -1
- package/dist/evidence/run-model.js +1 -0
- package/dist/evidence/storage.js +2 -2
- package/dist/evidence/timing.js +1 -1
- package/dist/kernel/error-serialization.js +1 -1
- package/dist/kernel/known-keys.js +1 -0
- package/dist/kernel/redaction-targets.js +1 -0
- package/dist/kernel/redaction.js +4 -1
- package/dist/kernel/unknown-values.js +1 -1
- package/dist/process/environment.js +1 -1
- package/dist/process/execa-bundle.json +3 -3
- package/dist/process/files/json-file.js +1 -1
- package/dist/process/host/platform.js +1 -1
- package/dist/process/host-process.js +1 -1
- package/dist/process/index.js +1 -1
- package/dist/process/locks.js +4 -4
- package/dist/process/port-listener.js +2 -0
- package/dist/process/process-group.js +1 -1
- package/dist/process/process.js +32 -32
- package/dist/process/readiness.js +1 -1
- package/dist/process/ready-deadline.js +1 -0
- package/dist/process/runs/ownership.js +1 -1
- package/dist/process/runs/stop.js +1 -1
- package/dist/process/service-processes.js +1 -1
- package/dist/process/windows-cli-owner.js +3 -3
- package/dist/process/windows-native.js +1 -1
- package/dist/repo/fingerprint-policy.js +1 -1
- package/dist/repo/managed-git.js +1 -1
- package/dist/repo/physical-tree.js +1 -1
- package/dist/repo/state.js +4 -4
- package/dist/steps/build-config.js +1 -1
- package/dist/steps/configured-step-testkit-modules.js +1 -1
- package/dist/steps/configured-steps.js +1 -1
- package/dist/steps/environment.js +1 -1
- package/dist/steps/index.js +1 -1
- package/dist/toolchains/index.js +3 -3
- package/dist/toolchains/semver.js +1 -1
- package/dist/toolchains/vitest/index.js +1 -1
- package/dist/tracker/redaction.js +1 -2
- package/dist/{config/runtime/build-assets.d.ts → types/config-build-assets.d.ts} +5 -3
- package/dist/{database/steps.d.ts → types/config-database-steps.d.ts} +7 -7
- package/dist/{config/runtime/next-runtime-tsconfig.d.ts → types/config-next-runtime-tsconfig.d.ts} +5 -3
- package/dist/types/config.d.ts +422 -0
- package/dist/types/drizzle.d.ts +13 -0
- package/dist/{config/runtime/env/index.d.ts → types/env.d.ts} +22 -20
- package/dist/types/environment.d.ts +46 -0
- package/dist/types/index.d.ts +21 -0
- package/dist/types/node-vitest-data.d.ts +191 -0
- package/dist/types/playwright.d.ts +130 -0
- package/dist/types/tooling-vitest.d.ts +13 -0
- package/dist/types/workspace.d.ts +633 -0
- package/docs/bug-records.md +35 -40
- package/docs/engines.md +259 -0
- package/docs/release-notes.md +2116 -0
- package/docs/test-types.md +37 -85
- package/package.json +22 -32
- package/testkit-config-schema.md +391 -260
- package/dist/app/bugs/areas.d.ts +0 -38
- package/dist/app/bugs/assessment.d.ts +0 -9
- package/dist/app/bugs/categories.d.ts +0 -41
- package/dist/app/bugs/ci-report.d.ts +0 -21
- package/dist/app/bugs/ci-summary.d.ts +0 -13
- package/dist/app/bugs/draft.d.ts +0 -70
- package/dist/app/bugs/facts.d.ts +0 -49
- package/dist/app/bugs/file.d.ts +0 -45
- package/dist/app/bugs/gate.d.ts +0 -22
- package/dist/app/bugs/guide.d.ts +0 -20
- package/dist/app/bugs/issue.d.ts +0 -18
- package/dist/app/bugs/known-failures.d.ts +0 -49
- package/dist/app/bugs/record.d.ts +0 -14
- package/dist/app/bugs/run-reading.d.ts +0 -51
- package/dist/app/bugs/store.d.ts +0 -34
- package/dist/app/campaigns/brief.d.ts +0 -7
- package/dist/app/campaigns/campaign.d.ts +0 -14
- package/dist/app/campaigns/index.d.ts +0 -38
- package/dist/app/campaigns/store.d.ts +0 -5
- package/dist/app/campaigns/summary.d.ts +0 -13
- package/dist/app/cleanup/index.d.ts +0 -52
- package/dist/app/db-schema/prepare.d.ts +0 -11
- package/dist/app/db-schema/refresh.d.ts +0 -17
- package/dist/app/db-schema/verify.d.ts +0 -11
- package/dist/app/destroy/index.d.ts +0 -16
- package/dist/app/discover/index.d.ts +0 -8
- package/dist/app/doctor/index.d.ts +0 -17
- package/dist/app/environments/config-driven.d.ts +0 -5
- package/dist/app/environments/routing.d.ts +0 -6
- package/dist/app/environments/supplied.d.ts +0 -3
- package/dist/app/file-selection.d.ts +0 -1
- package/dist/app/inspect/artifacts.d.ts +0 -30
- package/dist/app/inspect/index.d.ts +0 -112
- package/dist/app/lint/index.d.ts +0 -28
- package/dist/app/lint/native.d.ts +0 -10
- package/dist/app/lint/options.d.ts +0 -66
- package/dist/app/lint/policy.d.ts +0 -21
- package/dist/app/lint/rules/data.d.ts +0 -3
- package/dist/app/lint/rules/data.js +0 -1
- package/dist/app/lint/rules/engine-imports.d.ts +0 -3
- package/dist/app/lint/rules/syntax.d.ts +0 -4
- package/dist/app/lint/rules/unit.d.ts +0 -3
- package/dist/app/lint/shared.d.ts +0 -34
- package/dist/app/package-inspection.d.ts +0 -20
- package/dist/app/reports/files.d.ts +0 -13
- package/dist/app/reports/prepare.d.ts +0 -20
- package/dist/app/reports/publish.d.ts +0 -21
- package/dist/app/run/endpoint-readiness.d.ts +0 -43
- package/dist/app/run/endpoint-readiness.js +0 -1
- package/dist/app/run/engine-evidence-persistence.d.ts +0 -39
- package/dist/app/run/engine-execution-cleanup.d.ts +0 -8
- package/dist/app/run/engine-execution-cleanup.js +0 -1
- package/dist/app/run/engine-execution-failures.d.ts +0 -41
- package/dist/app/run/engine-execution-observer.d.ts +0 -21
- package/dist/app/run/engine-execution-reporting.d.ts +0 -17
- package/dist/app/run/engine-execution.d.ts +0 -65
- package/dist/app/run/engine-failure-stack.d.ts +0 -1
- package/dist/app/run/engine-orchestration.d.ts +0 -30
- package/dist/app/run/environment.d.ts +0 -33
- package/dist/app/run/failure-details.d.ts +0 -37
- package/dist/app/run/live-run.d.ts +0 -29
- package/dist/app/run/operation-progress.d.ts +0 -13
- package/dist/app/run/orchestrator.d.ts +0 -75
- package/dist/app/run/planning-types.d.ts +0 -68
- package/dist/app/run/planning.d.ts +0 -14
- package/dist/app/run/request.d.ts +0 -30
- package/dist/app/run/results.d.ts +0 -161
- package/dist/app/run/run-events.d.ts +0 -144
- package/dist/app/run/run-finalization.d.ts +0 -56
- package/dist/app/run/run-guards.d.ts +0 -3
- package/dist/app/run/runtime-failures.d.ts +0 -18
- package/dist/app/run/runtime-fixtures.d.ts +0 -2
- package/dist/app/run/runtime-task-types.d.ts +0 -20
- package/dist/app/run/scheduler/estimates.d.ts +0 -32
- package/dist/app/run/scheduler/identity.d.ts +0 -9
- package/dist/app/run/scheduler/index.d.ts +0 -124
- package/dist/app/run/scheduler/locks.d.ts +0 -6
- package/dist/app/run/scheduler/observations.d.ts +0 -20
- package/dist/app/run/selection.d.ts +0 -9
- package/dist/app/run/setup/runtime-node-setup-errors.d.ts +0 -13
- package/dist/app/run/setup/runtime-node-setup-protocol.d.ts +0 -85
- package/dist/app/run/setup/runtime-node-setup-worker.d.ts +0 -1
- package/dist/app/run/setup/runtime-node-setup.d.ts +0 -48
- package/dist/app/run/task-batches.d.ts +0 -23
- package/dist/app/run/task-leases.d.ts +0 -15
- package/dist/app/run/worker-loop.d.ts +0 -66
- package/dist/app/setup/playwright.d.ts +0 -22
- package/dist/app/status/index.d.ts +0 -9
- package/dist/app/status/model.d.ts +0 -29
- package/dist/app/status/runs.d.ts +0 -99
- package/dist/app/stop/index.d.ts +0 -14
- package/dist/app/tracker/index.d.ts +0 -13
- package/dist/app/tracker/remote.d.ts +0 -13
- package/dist/app/tracker/token.d.ts +0 -7
- package/dist/app/typecheck/index.d.ts +0 -63
- package/dist/cli/command-catalog.d.ts +0 -156
- package/dist/cli/command-flags.d.ts +0 -19
- package/dist/cli/command-registry.d.ts +0 -3
- package/dist/cli/commands/artifacts.d.ts +0 -48
- package/dist/cli/commands/bug/file.d.ts +0 -16
- package/dist/cli/commands/bug/guide.d.ts +0 -5
- package/dist/cli/commands/bug/record.d.ts +0 -9
- package/dist/cli/commands/campaign/finish.d.ts +0 -10
- package/dist/cli/commands/campaign/start.d.ts +0 -7
- package/dist/cli/commands/campaign/status.d.ts +0 -13
- package/dist/cli/commands/ci/report.d.ts +0 -15
- package/dist/cli/commands/cleanup.d.ts +0 -13
- package/dist/cli/commands/db/schema/refresh.d.ts +0 -2
- package/dist/cli/commands/db/schema/verify.d.ts +0 -2
- package/dist/cli/commands/destroy.d.ts +0 -9
- package/dist/cli/commands/discover.d.ts +0 -2
- package/dist/cli/commands/doctor.d.ts +0 -2
- package/dist/cli/commands/guard/unsafe-entrypoint.d.ts +0 -2
- package/dist/cli/commands/lint.d.ts +0 -2
- package/dist/cli/commands/report/prepare.d.ts +0 -12
- package/dist/cli/commands/report/publish.d.ts +0 -13
- package/dist/cli/commands/run/status.d.ts +0 -5
- package/dist/cli/commands/run/stop.d.ts +0 -7
- package/dist/cli/commands/run.d.ts +0 -9
- package/dist/cli/commands/setup/playwright.d.ts +0 -2
- package/dist/cli/commands/status.d.ts +0 -5
- package/dist/cli/commands/stop.d.ts +0 -12
- package/dist/cli/commands/typecheck.d.ts +0 -2
- package/dist/cli/commands/workspace.d.ts +0 -2
- package/dist/cli/entrypoint.d.ts +0 -1
- package/dist/cli/framework/command.d.ts +0 -21
- package/dist/cli/framework/definitions.d.ts +0 -100
- package/dist/cli/framework/errors.d.ts +0 -6
- package/dist/cli/framework/execute.d.ts +0 -14
- package/dist/cli/framework/help.d.ts +0 -11
- package/dist/cli/framework/index.d.ts +0 -3
- package/dist/cli/framework/parser.d.ts +0 -6
- package/dist/cli/index.d.ts +0 -4
- package/dist/cli/json-errors.d.ts +0 -3
- package/dist/cli/operations/db/schema/refresh/operation.d.ts +0 -7
- package/dist/cli/operations/db/schema/verify/operation.d.ts +0 -7
- package/dist/cli/operations/run/operation.d.ts +0 -26
- package/dist/cli/process-signal.d.ts +0 -1
- package/dist/cli/renderers/bug/text.d.ts +0 -8
- package/dist/cli/renderers/campaign/text.d.ts +0 -2
- package/dist/cli/renderers/ci/text.d.ts +0 -2
- package/dist/cli/renderers/cleanup/format.d.ts +0 -14
- package/dist/cli/renderers/db-schema/text.d.ts +0 -4
- package/dist/cli/renderers/destroy/text.d.ts +0 -4
- package/dist/cli/renderers/discover/report.d.ts +0 -7
- package/dist/cli/renderers/discover/text.d.ts +0 -3
- package/dist/cli/renderers/doctor/text.d.ts +0 -2
- package/dist/cli/renderers/lint/text.d.ts +0 -2
- package/dist/cli/renderers/run/events.d.ts +0 -8
- package/dist/cli/renderers/run/failure.d.ts +0 -8
- package/dist/cli/renderers/run/formatting.d.ts +0 -79
- package/dist/cli/renderers/run/status.d.ts +0 -6
- package/dist/cli/renderers/run/text-reporter.d.ts +0 -19
- package/dist/cli/renderers/status/text.d.ts +0 -2
- package/dist/cli/renderers/stop/text.d.ts +0 -7
- package/dist/cli/renderers/typecheck/text.d.ts +0 -2
- package/dist/cli/terminal/colors.d.ts +0 -10
- package/dist/cli/terminal/layout.d.ts +0 -11
- package/dist/cli/version-drift.d.ts +0 -25
- package/dist/config/authoring/build-config-contract.d.ts +0 -27
- package/dist/config/authoring/configured-step-contract.d.ts +0 -18
- package/dist/config/authoring/http-execution-contract.d.ts +0 -70
- package/dist/config/authoring/http-methods.d.ts +0 -18
- package/dist/config/authoring/index.d.ts +0 -372
- package/dist/config/authoring/preset-env.d.ts +0 -19
- package/dist/config/authoring/runtime.d.ts +0 -64
- package/dist/config/authoring/runtime.js +0 -1
- package/dist/config/loader/bugs.d.ts +0 -15
- package/dist/config/loader/config-loader.d.ts +0 -9
- package/dist/config/loader/database-materialization.d.ts +0 -19
- package/dist/config/loader/database-roles.d.ts +0 -2
- package/dist/config/loader/database.d.ts +0 -55
- package/dist/config/loader/decode-discovery.d.ts +0 -5
- package/dist/config/loader/decode-execution.d.ts +0 -7
- package/dist/config/loader/dependencies.d.ts +0 -7
- package/dist/config/loader/discover-tests.d.ts +0 -111
- package/dist/config/loader/discovery-summary.d.ts +0 -29
- package/dist/config/loader/discovery.d.ts +0 -53
- package/dist/config/loader/env.d.ts +0 -4
- package/dist/config/loader/execution-model.d.ts +0 -15
- package/dist/config/loader/file-metadata.d.ts +0 -19
- package/dist/config/loader/groups.d.ts +0 -33
- package/dist/config/loader/index.d.ts +0 -10
- package/dist/config/loader/load.d.ts +0 -89
- package/dist/config/loader/managed-configs.d.ts +0 -23
- package/dist/config/loader/path-policy.d.ts +0 -9
- package/dist/config/loader/paths.d.ts +0 -5
- package/dist/config/loader/runtime-isolation.d.ts +0 -44
- package/dist/config/loader/runtime.d.ts +0 -16
- package/dist/config/loader/skip-config.d.ts +0 -44
- package/dist/config/loader/test-selection.d.ts +0 -15
- package/dist/config/loader/validation.d.ts +0 -15
- package/dist/config/loader/values.d.ts +0 -3
- package/dist/config/loader/values.js +0 -1
- package/dist/database/activity-gate.d.ts +0 -22
- package/dist/database/admin.d.ts +0 -31
- package/dist/database/cleanup.d.ts +0 -36
- package/dist/database/configured-steps.d.ts +0 -27
- package/dist/database/constants.d.ts +0 -11
- package/dist/database/docker-metadata.d.ts +0 -3
- package/dist/database/docker.d.ts +0 -65
- package/dist/database/drizzle/index.d.ts +0 -13
- package/dist/database/fingerprint.d.ts +0 -12
- package/dist/database/index.d.ts +0 -39
- package/dist/database/lifecycle-cleanup.d.ts +0 -8
- package/dist/database/local-postgres.d.ts +0 -71
- package/dist/database/naming.d.ts +0 -17
- package/dist/database/postgres/index.d.ts +0 -71
- package/dist/database/progress.d.ts +0 -6
- package/dist/database/roles.d.ts +0 -19
- package/dist/database/runtime-config.d.ts +0 -16
- package/dist/database/runtime-reservations.d.ts +0 -19
- package/dist/database/schema-operations.d.ts +0 -18
- package/dist/database/schema-source.d.ts +0 -96
- package/dist/database/source-refresh-lock.d.ts +0 -8
- package/dist/database/source-url.d.ts +0 -21
- package/dist/database/state-files.d.ts +0 -13
- package/dist/database/state.d.ts +0 -26
- package/dist/database/template-steps.d.ts +0 -39
- package/dist/domain/file-timeout.d.ts +0 -25
- package/dist/domain/identifiers.d.ts +0 -9
- package/dist/domain/operation-display.d.ts +0 -10
- package/dist/domain/operation-reason.d.ts +0 -5
- package/dist/domain/postgres-route.d.ts +0 -4
- package/dist/domain/runtime-identity.d.ts +0 -1
- package/dist/domain/runtime-isolation-contract.d.ts +0 -5
- package/dist/domain/service-name.d.ts +0 -2
- package/dist/domain/suite-selection.d.ts +0 -20
- package/dist/domain/test-outcomes.d.ts +0 -2
- package/dist/domain/test-types.d.ts +0 -16
- package/dist/engines/adapters/evidence-files.d.ts +0 -32
- package/dist/engines/adapters/evidence-identity.d.ts +0 -12
- package/dist/engines/adapters/execution.d.ts +0 -41
- package/dist/engines/adapters/native-report.d.ts +0 -25
- package/dist/engines/adapters/node-startup-cache.d.ts +0 -8
- package/dist/engines/adapters/workspace.d.ts +0 -4
- package/dist/engines/api/capabilities.d.ts +0 -21
- package/dist/engines/api/capabilities.js +0 -1
- package/dist/engines/api/evidence.d.ts +0 -38
- package/dist/engines/api/execution-observer.d.ts +0 -8
- package/dist/engines/api/execution-scope.d.ts +0 -17
- package/dist/engines/api/execution.d.ts +0 -101
- package/dist/engines/api/index.d.ts +0 -5
- package/dist/engines/api/k6-runtime-input.d.ts +0 -26
- package/dist/engines/api/k6-runtime-input.js +0 -1
- package/dist/engines/api/runtime-artifact.d.ts +0 -19
- package/dist/engines/bundle-cache.d.ts +0 -32
- package/dist/engines/catalog.d.ts +0 -27
- package/dist/engines/contracts/fixture-manifest.d.ts +0 -34
- package/dist/engines/contracts/json-bounds.d.ts +0 -36
- package/dist/engines/contracts/json-bounds.js +0 -2
- package/dist/engines/contracts/k6-repository-configuration.d.ts +0 -12
- package/dist/engines/contracts/k6-repository-configuration.js +0 -1
- package/dist/engines/contracts/test-context.d.ts +0 -15
- package/dist/engines/contracts/test-context.js +0 -1
- package/dist/engines/definitions.d.ts +0 -23
- package/dist/engines/factory.d.ts +0 -6
- package/dist/engines/generated-performance.d.ts +0 -1
- package/dist/engines/installation-catalog.d.ts +0 -27
- package/dist/engines/installation-catalog.js +0 -1
- package/dist/engines/installations/k6.d.ts +0 -98
- package/dist/engines/installations/k6.js +0 -1
- package/dist/engines/installations/node-vitest.d.ts +0 -33
- package/dist/engines/installations/package-requirements.d.ts +0 -28
- package/dist/engines/installations/package-resolution.d.ts +0 -51
- package/dist/engines/installations/playwright-resolution-child.d.ts +0 -1
- package/dist/engines/installations/playwright.d.ts +0 -75
- package/dist/engines/installations/types.d.ts +0 -10
- package/dist/engines/k6/adapter/bundle.d.ts +0 -25
- package/dist/engines/k6/adapter/bundle.js +0 -112
- package/dist/engines/k6/adapter/evidence.d.ts +0 -15
- package/dist/engines/k6/adapter/evidence.js +0 -4
- package/dist/engines/k6/adapter/executor.d.ts +0 -13
- package/dist/engines/k6/adapter/executor.js +0 -1
- package/dist/engines/k6/adapter/index.d.ts +0 -1
- package/dist/engines/k6/adapter/index.js +0 -1
- package/dist/engines/k6/adapter/input.d.ts +0 -21
- package/dist/engines/k6/adapter/input.js +0 -1
- package/dist/engines/k6/adapter/native-summary.d.ts +0 -11
- package/dist/engines/k6/adapter/native-summary.js +0 -1
- package/dist/engines/k6/adapter/repository-configuration.d.ts +0 -2
- package/dist/engines/k6/adapter/repository-configuration.js +0 -1
- package/dist/engines/k6/authoring-type-paths.d.ts +0 -3
- package/dist/engines/k6/authoring-type-paths.js +0 -1
- package/dist/engines/k6/runtime/ambient-types/bundle-manifest.json +0 -146
- package/dist/engines/k6/runtime/ambient-types/k6/LICENSE +0 -21
- package/dist/engines/k6/runtime/ambient-types/k6/browser/index.d.ts +0 -6332
- package/dist/engines/k6/runtime/ambient-types/k6/crypto/index.d.ts +0 -218
- package/dist/engines/k6/runtime/ambient-types/k6/data/index.d.ts +0 -16
- package/dist/engines/k6/runtime/ambient-types/k6/encoding/index.d.ts +0 -46
- package/dist/engines/k6/runtime/ambient-types/k6/execution/index.d.ts +0 -127
- package/dist/engines/k6/runtime/ambient-types/k6/experimental/csv/index.d.ts +0 -96
- package/dist/engines/k6/runtime/ambient-types/k6/experimental/fs/index.d.ts +0 -104
- package/dist/engines/k6/runtime/ambient-types/k6/experimental/redis/index.d.ts +0 -821
- package/dist/engines/k6/runtime/ambient-types/k6/experimental/streams/index.d.ts +0 -198
- package/dist/engines/k6/runtime/ambient-types/k6/global.d.ts +0 -83
- package/dist/engines/k6/runtime/ambient-types/k6/html/index.d.ts +0 -1325
- package/dist/engines/k6/runtime/ambient-types/k6/http/index.d.ts +0 -806
- package/dist/engines/k6/runtime/ambient-types/k6/index.d.ts +0 -126
- package/dist/engines/k6/runtime/ambient-types/k6/metrics/index.d.ts +0 -66
- package/dist/engines/k6/runtime/ambient-types/k6/net/grpc/index.d.ts +0 -247
- package/dist/engines/k6/runtime/ambient-types/k6/options/index.d.ts +0 -459
- package/dist/engines/k6/runtime/ambient-types/k6/package.json +0 -79
- package/dist/engines/k6/runtime/ambient-types/k6/secrets/index.d.ts +0 -36
- package/dist/engines/k6/runtime/ambient-types/k6/timers/index.d.ts +0 -47
- package/dist/engines/k6/runtime/ambient-types/k6/websockets/index.d.ts +0 -324
- package/dist/engines/k6/runtime/ambient-types/k6/ws/index.d.ts +0 -283
- package/dist/engines/k6/runtime/ambient-types/xk6-sql/LICENSE +0 -201
- package/dist/engines/k6/runtime/ambient-types/xk6-sql/index.d.ts +0 -397
- package/dist/engines/k6/runtime/ambient-types/xk6-sql/package.json +0 -15
- package/dist/engines/k6/runtime/artifacts.d.ts +0 -2
- package/dist/engines/k6/runtime/artifacts.js +0 -1
- package/dist/engines/k6/runtime/checks.d.ts +0 -17
- package/dist/engines/k6/runtime/checks.js +0 -1
- package/dist/engines/k6/runtime/dal-fixtures.d.ts +0 -24
- package/dist/engines/k6/runtime/dal-fixtures.js +0 -1
- package/dist/engines/k6/runtime/dal-suite.d.ts +0 -24
- package/dist/engines/k6/runtime/dal-suite.js +0 -1
- package/dist/engines/k6/runtime/dal.d.ts +0 -10
- package/dist/engines/k6/runtime/dal.js +0 -1
- package/dist/engines/k6/runtime/fixtures.d.ts +0 -3
- package/dist/engines/k6/runtime/fixtures.js +0 -1
- package/dist/engines/k6/runtime/http-assertions.d.ts +0 -19
- package/dist/engines/k6/runtime/http-assertions.js +0 -1
- package/dist/engines/k6/runtime/http-checks.d.ts +0 -19
- package/dist/engines/k6/runtime/http-checks.js +0 -1
- package/dist/engines/k6/runtime/http-suite-runtime.d.ts +0 -103
- package/dist/engines/k6/runtime/http-suite-runtime.js +0 -1
- package/dist/engines/k6/runtime/http.d.ts +0 -15
- package/dist/engines/k6/runtime/http.js +0 -1
- package/dist/engines/k6/runtime/index.d.ts +0 -11
- package/dist/engines/k6/runtime/index.js +0 -1
- package/dist/engines/k6/runtime/input.d.ts +0 -3
- package/dist/engines/k6/runtime/input.js +0 -1
- package/dist/engines/k6/runtime/k6-repository-configuration.d.ts +0 -9
- package/dist/engines/k6/runtime/k6-repository-configuration.js +0 -1
- package/dist/engines/k6/runtime/node-setup.d.ts +0 -13
- package/dist/engines/k6/runtime/node-setup.js +0 -1
- package/dist/engines/k6/runtime/runtime-globals.d.ts +0 -10
- package/dist/engines/k6/runtime/runtime.d.ts +0 -54
- package/dist/engines/k6/runtime/runtime.js +0 -1
- package/dist/engines/k6/runtime/shared/assertion-details.d.ts +0 -19
- package/dist/engines/k6/runtime/shared/assertion-details.js +0 -2
- package/dist/engines/k6/runtime/shared/db-normalization.d.ts +0 -19
- package/dist/engines/k6/runtime/shared/db-normalization.js +0 -1
- package/dist/engines/k6/runtime/shared/error-body.d.ts +0 -3
- package/dist/engines/k6/runtime/shared/error-body.js +0 -1
- package/dist/engines/k6/runtime/shared/file-data.d.ts +0 -1
- package/dist/engines/k6/runtime/shared/file-data.js +0 -1
- package/dist/engines/k6/runtime/shared/fixture-engine.d.ts +0 -8
- package/dist/engines/k6/runtime/shared/fixture-engine.js +0 -2
- package/dist/engines/k6/runtime/shared/http-check-plan.d.ts +0 -29
- package/dist/engines/k6/runtime/shared/http-check-plan.js +0 -1
- package/dist/engines/k6/runtime/shared/http-parsing.d.ts +0 -10
- package/dist/engines/k6/runtime/shared/http-parsing.js +0 -3
- package/dist/engines/k6/runtime/shared/ordering.d.ts +0 -2
- package/dist/engines/k6/runtime/shared/ordering.js +0 -1
- package/dist/engines/k6/runtime/shared/properties.d.ts +0 -1
- package/dist/engines/k6/runtime/shared/properties.js +0 -1
- package/dist/engines/k6/runtime/suite.d.ts +0 -4
- package/dist/engines/k6/runtime/suite.js +0 -1
- package/dist/engines/k6/runtime/types.d.ts +0 -244
- package/dist/engines/k6/runtime/types.js +0 -1
- package/dist/engines/k6/runtime/xk6-sql-driver-postgres.d.ts +0 -7
- package/dist/engines/k6/runtime/xk6-sql-driver-postgres.js +0 -1
- package/dist/engines/managed-module-resolution-policy-input.d.ts +0 -8
- package/dist/engines/managed-module-resolution-policy.d.ts +0 -25
- package/dist/engines/managed-module-resolution.d.ts +0 -13
- package/dist/engines/manager.d.ts +0 -25
- package/dist/engines/node-vitest/adapter/adapter.d.ts +0 -16
- package/dist/engines/node-vitest/adapter/consumer-typescript-paths.d.ts +0 -17
- package/dist/engines/node-vitest/adapter/consumer-typescript-paths.js +0 -3
- package/dist/engines/node-vitest/adapter/evidence.d.ts +0 -33
- package/dist/engines/node-vitest/adapter/failure-details.d.ts +0 -3
- package/dist/engines/node-vitest/adapter/index.d.ts +0 -1
- package/dist/engines/node-vitest/adapter/reporter.d.ts +0 -7
- package/dist/engines/node-vitest/adapter/resolution.d.ts +0 -12
- package/dist/engines/node-vitest/adapter/resolution.js +0 -1
- package/dist/engines/node-vitest/adapter/workspace.d.ts +0 -19
- package/dist/engines/node-vitest/runtime/contract/index.d.ts +0 -64
- package/dist/engines/node-vitest/runtime/contract/index.js +0 -1
- package/dist/engines/node-vitest/runtime/data/http.d.ts +0 -4
- package/dist/engines/node-vitest/runtime/data/http.js +0 -1
- package/dist/engines/node-vitest/runtime/data/index.d.ts +0 -8
- package/dist/engines/node-vitest/runtime/data/primitives.d.ts +0 -1
- package/dist/engines/node-vitest/runtime/data/report.d.ts +0 -3
- package/dist/engines/node-vitest/runtime/data/runner.d.ts +0 -4
- package/dist/engines/node-vitest/runtime/data/runner.js +0 -1
- package/dist/engines/node-vitest/runtime/data/scenario.d.ts +0 -11
- package/dist/engines/node-vitest/runtime/data/types.d.ts +0 -384
- package/dist/engines/node-vitest/runtime/runtime-input.d.ts +0 -64
- package/dist/engines/playwright/adapter/adapter.d.ts +0 -18
- package/dist/engines/playwright/adapter/attachments.d.ts +0 -26
- package/dist/engines/playwright/adapter/config.d.ts +0 -45
- package/dist/engines/playwright/adapter/evidence-validation.d.ts +0 -9
- package/dist/engines/playwright/adapter/evidence.d.ts +0 -32
- package/dist/engines/playwright/adapter/failure-details.d.ts +0 -2
- package/dist/engines/playwright/adapter/index.d.ts +0 -3
- package/dist/engines/playwright/adapter/reporter.d.ts +0 -12
- package/dist/engines/playwright/runtime/config-file.d.ts +0 -2
- package/dist/engines/playwright/runtime/config.d.ts +0 -24
- package/dist/engines/playwright/runtime/index.d.ts +0 -4
- package/dist/engines/playwright/runtime/runtime-input.d.ts +0 -36
- package/dist/engines/playwright/runtime/sandbox.d.ts +0 -84
- package/dist/engines/runtime-input-file.d.ts +0 -27
- package/dist/environment/lifecycle-artifacts.d.ts +0 -7
- package/dist/environment/lifecycle-controller.d.ts +0 -60
- package/dist/environment/lifecycle.d.ts +0 -32
- package/dist/environment/maintenance.d.ts +0 -68
- package/dist/environment/planning-types.d.ts +0 -33
- package/dist/environment/ports.d.ts +0 -10
- package/dist/environment/ready-environment.d.ts +0 -16
- package/dist/environment/run-environment.d.ts +0 -39
- package/dist/environment/run-stopping.d.ts +0 -13
- package/dist/environment/runtime-contexts.d.ts +0 -37
- package/dist/environment/runtime-manager.d.ts +0 -87
- package/dist/environment/runtime-planning.d.ts +0 -16
- package/dist/environment/runtime-preparation.d.ts +0 -30
- package/dist/environment/runtime-service.d.ts +0 -12
- package/dist/environment/services.d.ts +0 -56
- package/dist/environment/state.d.ts +0 -15
- package/dist/environment/status-runtime.d.ts +0 -53
- package/dist/environment/template.d.ts +0 -164
- package/dist/evidence/artifact-config.d.ts +0 -14
- package/dist/evidence/artifact-validation.d.ts +0 -4
- package/dist/evidence/artifacts.d.ts +0 -75
- package/dist/evidence/bundles.d.ts +0 -27
- package/dist/evidence/ci-provenance.d.ts +0 -9
- package/dist/evidence/contracts.d.ts +0 -154
- package/dist/evidence/environment-record.d.ts +0 -22
- package/dist/evidence/file-evidence.d.ts +0 -23
- package/dist/evidence/finalization.d.ts +0 -9
- package/dist/evidence/index.d.ts +0 -8
- package/dist/evidence/logs.d.ts +0 -31
- package/dist/evidence/operation-timings.d.ts +0 -60
- package/dist/evidence/read-bundle.d.ts +0 -4
- package/dist/evidence/read-fields.d.ts +0 -21
- package/dist/evidence/read-provenance.d.ts +0 -2
- package/dist/evidence/read-redaction.d.ts +0 -2
- package/dist/evidence/read-retention.d.ts +0 -2
- package/dist/evidence/read-run.d.ts +0 -2
- package/dist/evidence/reading.d.ts +0 -28
- package/dist/evidence/reporting-types.d.ts +0 -349
- package/dist/evidence/reporting.d.ts +0 -3
- package/dist/evidence/secure-file-copy.d.ts +0 -24
- package/dist/evidence/setup-progress.d.ts +0 -63
- package/dist/evidence/step-output.d.ts +0 -16
- package/dist/evidence/storage-inventory.d.ts +0 -27
- package/dist/evidence/storage.d.ts +0 -25
- package/dist/evidence/timing.d.ts +0 -23
- package/dist/file.d.ts +0 -11
- package/dist/index.d.ts +0 -4
- package/dist/kernel/error-serialization.d.ts +0 -40
- package/dist/kernel/redaction.d.ts +0 -2
- package/dist/kernel/unknown-values.d.ts +0 -11
- package/dist/kernel/work-metrics.d.ts +0 -6
- package/dist/process/capture-output.d.ts +0 -7
- package/dist/process/command-shell.d.ts +0 -1
- package/dist/process/environment-overlay.d.ts +0 -17
- package/dist/process/environment.d.ts +0 -33
- package/dist/process/files/contained-path.d.ts +0 -8
- package/dist/process/files/directory-status.d.ts +0 -14
- package/dist/process/files/dotenv.d.ts +0 -2
- package/dist/process/files/file-snapshot.d.ts +0 -34
- package/dist/process/files/json-file.d.ts +0 -11
- package/dist/process/files/paths.d.ts +0 -3
- package/dist/process/files/product-dir.d.ts +0 -1
- package/dist/process/files/temp-dir.d.ts +0 -11
- package/dist/process/host/metadata.d.ts +0 -6
- package/dist/process/host/platform.d.ts +0 -57
- package/dist/process/host-command.d.ts +0 -4
- package/dist/process/host-inspection-command.d.ts +0 -13
- package/dist/process/host-process.d.ts +0 -19
- package/dist/process/index.d.ts +0 -9
- package/dist/process/lifecycle-fence.d.ts +0 -10
- package/dist/process/locks.d.ts +0 -28
- package/dist/process/process-contracts.d.ts +0 -78
- package/dist/process/process-group.d.ts +0 -12
- package/dist/process/process-identity.d.ts +0 -27
- package/dist/process/process-limits.d.ts +0 -6
- package/dist/process/process.d.ts +0 -12
- package/dist/process/readiness.d.ts +0 -43
- package/dist/process/recovery.d.ts +0 -3
- package/dist/process/runs/inspection.d.ts +0 -5
- package/dist/process/runs/manifest.d.ts +0 -86
- package/dist/process/runs/ownership.d.ts +0 -11
- package/dist/process/runs/product-state.d.ts +0 -2
- package/dist/process/runs/schema.d.ts +0 -3
- package/dist/process/runs/stop.d.ts +0 -19
- package/dist/process/runtime-socket.d.ts +0 -4
- package/dist/process/service-processes.d.ts +0 -13
- package/dist/process/shutdown.d.ts +0 -10
- package/dist/process/stoppable-settlement.d.ts +0 -26
- package/dist/process/url-redaction.d.ts +0 -1
- package/dist/process/windows-cli-owner.d.ts +0 -2
- package/dist/process/windows-native.d.ts +0 -12
- package/dist/process/windows-process-identity.d.ts +0 -4
- package/dist/repo/ci-environment.d.ts +0 -7
- package/dist/repo/fingerprint-policy.d.ts +0 -13
- package/dist/repo/git-path.d.ts +0 -2
- package/dist/repo/history.d.ts +0 -17
- package/dist/repo/managed-git.d.ts +0 -10
- package/dist/repo/metadata.d.ts +0 -3
- package/dist/repo/physical-tree.d.ts +0 -37
- package/dist/repo/publish-directory.d.ts +0 -20
- package/dist/repo/remote.d.ts +0 -6
- package/dist/repo/state.d.ts +0 -26
- package/dist/repo/tree-listing.d.ts +0 -10
- package/dist/steps/build-config.d.ts +0 -34
- package/dist/steps/configured-step-testkit-modules.d.ts +0 -19
- package/dist/steps/configured-steps.d.ts +0 -51
- package/dist/steps/environment.d.ts +0 -82
- package/dist/steps/index.d.ts +0 -2
- package/dist/steps/module-runner.d.ts +0 -1
- package/dist/steps/run.d.ts +0 -36
- package/dist/toolchains/archive.d.ts +0 -53
- package/dist/toolchains/esbuild.d.ts +0 -9
- package/dist/toolchains/host-node-support.d.ts +0 -3
- package/dist/toolchains/index.d.ts +0 -114
- package/dist/toolchains/managed-node-releases.d.ts +0 -28
- package/dist/toolchains/node-cache.d.ts +0 -20
- package/dist/toolchains/node-integrity.d.ts +0 -18
- package/dist/toolchains/node-provisioning.d.ts +0 -29
- package/dist/toolchains/semver.d.ts +0 -13
- package/dist/toolchains/shared-operation.d.ts +0 -11
- package/dist/toolchains/timeouts.d.ts +0 -1
- package/dist/toolchains/vitest/index.d.ts +0 -13
- package/dist/tracker/gitea.d.ts +0 -14
- package/dist/tracker/github.d.ts +0 -14
- package/dist/tracker/http.d.ts +0 -33
- package/dist/tracker/index.d.ts +0 -4
- package/dist/tracker/redaction.d.ts +0 -4
- package/dist/tracker/requests.d.ts +0 -17
- package/dist/tracker/responses.d.ts +0 -24
- package/dist/tracker/types.d.ts +0 -51
- package/docs/engine-architecture.md +0 -682
- /package/dist/engines/{k6/runtime/runtime-globals.js → api/profiles.js} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{ownedGeneratedScript as o}from"./generated-performance.js";import{inspectManagedNodeModuleResolutionPolicy as s}from"./managed-module-resolution-policy.js";export function createManagedNodeModuleResolution(
|
|
1
|
+
import{ownedGeneratedScript as o}from"./generated-performance.js";import{inspectManagedNodeModuleResolutionPolicy as s}from"./managed-module-resolution-policy.js";export function createManagedNodeModuleResolution(t){const e=s(t),n={...e.direct};for(const[a,i]of Object.entries(e.packageExports)){const r=i.import??i.default??i.require;r!==null&&(n[a]=r)}return Object.freeze({aliases:Object.freeze(n),bootstrapSource:c(e),dependencyRoots:e.managedImporterRoots})}function c(t){return o(`
|
|
2
2
|
const fs = require("node:fs");
|
|
3
3
|
const path = require("node:path");
|
|
4
4
|
const { isBuiltin, registerHooks } = require("node:module");
|
|
5
5
|
const { fileURLToPath, pathToFileURL } = require("node:url");
|
|
6
6
|
|
|
7
7
|
let canonicalPaths = null;
|
|
8
|
-
const POLICY = Object.freeze(${JSON.stringify(
|
|
8
|
+
const POLICY = Object.freeze(${JSON.stringify(t)});
|
|
9
9
|
const CONSUMER_ROOTS = Object.freeze(
|
|
10
10
|
POLICY.consumerRoots.map((root) => verifiedDirectory(root, "consumer root")),
|
|
11
11
|
);
|
|
@@ -229,8 +229,9 @@ function sameNativePackageEdge(origin, parentURL, targetURL) {
|
|
|
229
229
|
|
|
230
230
|
function resolveManagedSpecifier(specifier, conditions, parentURL) {
|
|
231
231
|
const direct = DIRECT.get(specifier);
|
|
232
|
-
|
|
233
|
-
|
|
232
|
+
const directUrl = direct === undefined ? null : pathToFileURL(direct).href;
|
|
233
|
+
if (directUrl !== null && parentURL !== directUrl)
|
|
234
|
+
return { shortCircuit: true, url: directUrl };
|
|
234
235
|
|
|
235
236
|
const packageName = matchingPackageName(specifier, PACKAGE_ROOTS);
|
|
236
237
|
if (packageName !== null) {
|
|
@@ -674,6 +675,8 @@ function exactExportedSubpathForFile(exportsDeclaration, packageRoot, file) {
|
|
|
674
675
|
if (exportsDeclaration === null || typeof exportsDeclaration !== "object")
|
|
675
676
|
return null;
|
|
676
677
|
const canonicalFile = canonicalPath(file);
|
|
678
|
+
const namedSubpath =
|
|
679
|
+
"./" + path.relative(packageRoot, file).split(path.sep).join("/");
|
|
677
680
|
for (const [subpath, declaration] of Object.entries(exportsDeclaration)) {
|
|
678
681
|
if (
|
|
679
682
|
(subpath !== "." && !subpath.startsWith("./")) ||
|
|
@@ -681,6 +684,7 @@ function exactExportedSubpathForFile(exportsDeclaration, packageRoot, file) {
|
|
|
681
684
|
) {
|
|
682
685
|
continue;
|
|
683
686
|
}
|
|
687
|
+
if (subpath === namedSubpath) return subpath;
|
|
684
688
|
for (const target of allExportTargets(declaration)) {
|
|
685
689
|
if (
|
|
686
690
|
target.startsWith("./") &&
|
package/dist/engines/manager.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{BUILT_IN_ENGINE_DEFINITIONS as E}from"./definitions.js";import{ENGINE_CLEANUP_TIMEOUT_MS as d,beginEngineExecution as h,createEngineInvocationScope as w}from"./api/index.js";import"../domain/identifiers.js";export class EngineExecutorLoadError extends Error{code="TESTKIT_ENGINE_EXECUTOR_LOAD_FAILED";engineId;constructor(t,o){super(`Resolved ${t} executor could not be loaded`,o),this.name="EngineExecutorLoadError",this.engineId=t}}export class EngineManager{productRoot;installations=new WeakMap;constructor(t){this.productRoot=t}async withEngine(t,o,i){const c=E[t];o.throwIfAborted();let n=this.installations.get(o);n||(n=new Map,this.installations.set(o,n));let r=n.get(t);if(!r){const a=n;r=c.resolveInstallation({productRoot:this.productRoot,signal:o}).catch(l=>{throw a.delete(t),l}),a.set(t,r)}const s=await r;return o.throwIfAborted(),i(f(c,s))}}function f(e,t){return Object.freeze({engineId:e.id,async execute(o){u(o.signal);const i=h(o),c=w({timeoutMs:d});let n=null,r,s=!1;try{const l=await p(e);u(o.signal),n=i.acceptResult(await l(i.request,t,c.scope))}catch(l){s=!0,r=l}finally{i.close()}const a=await c.drain();if(s)throw a.length===0?r:new AggregateError([r,...a],`Engine invocation failed and ${a.length.toString()} cleanup handler(s) also failed`,{cause:r});if(a.length>0)throw new AggregateError(a,`${a.length.toString()} engine invocation cleanup handler(s) failed`);if(n===null)throw new Error("Engine invocation completed without a result");return i.commit(),n}})}function u(e){if(e.aborted)throw e.reason instanceof Error?e.reason:new Error("Resolved engine invocation was cancelled",{cause:e.reason})}async function p(e){try{return await e.loadExecutor()}catch(t){throw new EngineExecutorLoadError(e.id,{cause:t})}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeTempDirAsync as h}from"../../../process/files/temp-dir.js";import{toError as R}from"../../../kernel/error-serialization.js";import{classifyManagedProcessResult as H,terminalOutcome as E,processOutputEvidence as J,emptyEvidence as x,failureFromError as p,firstOutputLine as M,processExitFailure as Y,executeEngineTasks as G,managedProcessFailure as Q,taskTimeoutFailure as X}from"../../adapters/execution.js";import{requireRootDirectory as Z,requireAbsoluteWorkspacePath as P,requireConsumerFile as L,safeSegment as A}from"../../adapters/workspace.js";import f from"node:fs/promises";import c from"node:path";import{pathToFileURL as q}from"node:url";import{isEngineTaskDeadlineExceededReason as tt,resolveEngineTaskInputs as et}from"../../api/index.js";import{createInvocationProcessEnvironment as it,runManagedProcess as rt}from"../../../process/index.js";import{preflightNodeVitestInstallation as ot}from"../../installations/node-vitest.js";import{collectNodeVitestEvidence as nt}from"./evidence.js";import{assertNodeVitestSpawnEnvironmentBudget as C,NODE_VITEST_RUNTIME_INPUT_FILE_ENV as at,NODE_VITEST_RUNTIME_INPUT_SHA256_ENV as st,selectNodeVitestForwardedEnvironment as ct,verifyOwnedNodeVitestRuntimeInput as ut,writeOwnedNodeVitestRuntimeInput as dt}from"../runtime/runtime-input.js";import{writeNodeVitestWorkspace as lt}from"./workspace.js";import{engineEvidenceIdentity as pt}from"../../adapters/evidence-identity.js";import{getNodeStartupCacheEnvironment as ft}from"../../adapters/node-startup-cache.js";const I={codePrefix:"NODE_VITEST",label:"Node/Vitest"};class b extends Error{constructor(e){const i=R(e);super(i.message,{cause:i}),this.name="NodeVitestConsumerPreparationError"}}export const nodeVitestExecutorDependencies={removeOwnedDirectory:t=>f.rm(t,{force:!0,recursive:!0}),writeRuntimeInput:dt,writeWorkspace:lt};export async function executeNodeVitestEngine(t,e,i,r=nodeVitestExecutorDependencies){const o=await mt(t,e,r,i);return G(t,o.tasks,I,(a,n)=>Et(t,o,a,n),yt(t,o.installation))}async function mt(t,e,i,r){const o=t.profile.id,a=e.packages.vitest.cli,n=await Z(t.workspace.rootDirectory);P(t.workspace.temporaryDirectory,"temporary directory"),P(t.workspace.artifactDirectory,"artifact directory"),await f.mkdir(t.workspace.temporaryDirectory,{recursive:!0}),await f.mkdir(t.workspace.artifactDirectory,{recursive:!0});const d=await f.realpath(t.workspace.temporaryDirectory),T=await f.realpath(t.workspace.artifactDirectory),l=Object.freeze({...e.authoringEntrypoints,cli:e.packages.vitest.cli,packages:e.packages}),m=await h(`node-vitest-${A(t.invocationId)}-`,{parentDir:d});r.defer(()=>i.removeOwnedDirectory(m));const U=await it(m),g=[];for(const[B,s]of t.tasks.entries()){const v=et(t,s),S=`${B.toString().padStart(3,"0")}-${A(s.id)}`,u=c.join(m,S),y=await h(`${S}-`,{parentDir:T}),w=c.join(u,"testkit-vitest-report.json"),$=c.join(y,"data","manifest.json"),z=c.join(u,"setup.mjs"),O=c.join(u,"input-bootstrap.mjs"),F=c.join(u,"resolution-bootstrap.cjs"),V=c.join(u,"vitest.config.mjs");try{await f.mkdir(u,{mode:448,recursive:!1});const D=await N(()=>L(n,s.file,"Node/Vitest task file")),k=await N(()=>gt(n,v)),W=await N(()=>vt(t,o,s,v)),_=await i.writeRuntimeInput(u,W);await i.writeWorkspace({report:{identity:{engineId:"node-vitest",invocationId:t.invocationId,taskId:s.id,sourceFile:s.file},reportFile:w,workspaceDirectory:u},configFile:k.testkitConfig,entrypoints:l,inputBootstrapFile:O,resolutionBootstrapFile:F,rootDirectory:n,runtimeInput:{expectedFile:_.file,expectedInvocationId:t.invocationId,expectedProfileId:o,expectedSha256:_.sha256,expectedSizeBytes:_.sizeBytes,expectedTaskId:s.id},setupFile:z,sourceFile:D,timeoutMs:Math.max(1,s.deadlineMs-Date.now()),tsconfigFile:k.tsconfig,vitestConfigFile:V}),g.push({artifactDirectory:y,inputs:v,task:s,preparationFailure:null,prepared:{dataManifestFile:$,inputBootstrapFile:O,reportFile:w,resolutionBootstrapFile:F,runtimeInput:_,vitestConfigFile:V}})}catch(D){g.push({artifactDirectory:y,inputs:v,task:s,preparationFailure:Dt(D),prepared:null})}}return Object.freeze({cliFile:a,installation:e,invocationEnvironment:U.environment,profileId:o,rootDirectory:n,tasks:Object.freeze(g)})}async function Et(t,e,i,r){try{await ut(i.prepared.runtimeInput)}catch(l){return E(i.task.id,"failed",r,x(),{...p(l,"NODE_VITEST_INPUT_INVALID"),classification:"infra"})}const o=await Tt(t,e,i),a=i.task.deadlineMs-Date.now();if(a<=0)return E(i.task.id,"failed",r,x(),X(i.task.timeoutMs,I));const n=await rt({args:[e.cliFile,"run","--config",i.prepared.vitestConfigFile,"--configLoader","runner"],cwd:e.rootDirectory,displayLabel:"Node/Vitest",env:o,executable:process.execPath,signal:t.signal,timeoutMs:a});let d;try{d=await nt({identity:{engineId:"node-vitest",invocationId:t.invocationId,taskId:i.task.id,sourceFile:i.task.file},artifactDirectory:i.artifactDirectory,dataManifestFile:i.prepared.dataManifestFile,profileId:e.profileId,reportFile:i.prepared.reportFile,rootDirectory:e.rootDirectory,stderr:n.stderr,stdout:n.stdout})}catch(l){const m=J(n);return E(i.task.id,"failed",r,m,nodeVitestEvidenceCollectionFailure(n,l))}if(d.reportSummary===null&&n.exitCode!==0&&!t.signal.aborted&&!n.timedOut&&!n.outputLimitExceeded&&n.terminationError===null&&n.error===null)try{await ot(e.installation,{signal:t.signal})}catch(l){if(!t.signal.aborted)return E(i.task.id,"failed",r,d.evidence,{...p(l,"NODE_VITEST_INSTALLATION_BROKEN"),classification:"infra"})}const T=classifyNodeVitestProcessResult(n,d,i.task.timeoutMs,tt(t.signal.reason));return E(i.task.id,T.status,r,d.evidence,T.failure)}export function classifyNodeVitestProcessResult(t,e,i,r){const o=H(t,i,r,I);return o!==null?o:e.reportSummary?.numTotalTests===0?{failure:{code:"NODE_VITEST_NO_TESTS",message:"Vitest did not discover any tests for the task file"},status:"failed"}:It(e.reportSummary)?{failure:null,status:"skipped"}:t.exitCode!==0?Y(t,I,e.reportFailureMessage??M(t.stderr)??M(t.stdout),"Vitest"):e.reportError!==null?{failure:{...p(e.reportError,"NODE_VITEST_REPORT_INVALID"),classification:"infra"},status:"failed"}:e.reportFailureMessage!==null?{failure:{code:"NODE_VITEST_REPORT_FAILED",message:e.reportFailureMessage},status:"failed"}:e.dataEvidenceError!==null?{failure:p(e.dataEvidenceError,"NODE_VITEST_DATA_EVIDENCE_INVALID"),status:"failed"}:e.reportSummary===null||!e.reportSummary.success||e.reportSummary.numFailedTests>0||e.reportSummary.numPassedTests===0?{failure:{code:"NODE_VITEST_REPORT_FAILED",message:"Vitest report did not contain a completed passing test"},status:"failed"}:{failure:null,status:"passed"}}export function nodeVitestEvidenceCollectionFailure(t,e){const i=R(e);return Q(t,I,i)??{...p(i,"NODE_VITEST_EVIDENCE_FAILED"),classification:"infra"}}function It(t){return t!==null&&t.success&&t.numTotalTests>0&&t.numPassedTests===0&&t.numFailedTests===0&&(t.numPendingTests>0||t.numTodoTests>0)}async function Tt(t,e,i){const r=i.task,o=j(t,r.serviceName),a={...e.invocationEnvironment};Object.assign(a,{...o===null?{}:{BASE_URL:o},FORCE_COLOR:"0",NODE_OPTIONS:_t(i.prepared.resolutionBootstrapFile,i.prepared.inputBootstrapFile),NO_COLOR:"1",TESTKIT_ACTIVE:"1",[at]:i.prepared.runtimeInput.file,[st]:i.prepared.runtimeInput.sha256,TESTKIT_INTERNAL_FILE_DEADLINE_MS:String(r.deadlineMs),TESTKIT_INTERNAL_FILE_TIMEOUT_SECONDS:String(Math.max(1,Math.ceil(r.timeoutMs/1e3))),TESTKIT_INVOCATION_ID:t.invocationId,TESTKIT_LEASE_DIR:r.orchestration.lease.directory,TESTKIT_LEASE_ID:r.orchestration.lease.id,TESTKIT_MODE:r.orchestration.mode,...r.orchestration.runtimeId===void 0?{}:{TESTKIT_RUNTIME_ID:r.orchestration.runtimeId},TESTKIT_TEST_FILE:r.file,TESTKIT_TEST_ID:r.id,...e.profileId==="node-vitest-data"?{TESTKIT_DATA_ARTIFACT_DIR:c.dirname(i.prepared.dataManifestFile)}:{}}),C(a),Object.assign(a,await ft(t.workspace.cacheDirectory,i.inputs.environment));try{C(a)}catch{delete a.NODE_COMPILE_CACHE}return a}function vt(t,e,i,r){const o=j(t,i.serviceName),a=ct(r.environment);return{context:{baseUrl:o,engineId:"node-vitest",invocationId:t.invocationId,profileId:e,serviceName:i.serviceName,task:{file:i.file,id:i.id,suiteName:i.suiteName,testType:i.testType}},engineId:"node-vitest",environment:a,fixtures:r.fixtures,invocationId:t.invocationId,profileId:e,...r.setupData===void 0?{}:{setupData:r.setupData},taskId:i.id,version:1}}function _t(t,e){return[`--require=${JSON.stringify(t)}`,`--import=${JSON.stringify(q(e).href)}`].join(" ")}function j(t,e){return Object.hasOwn(t.target.endpoints,e)?t.target.endpoints[e]:null}async function gt(t,e){return{testkitConfig:await K(t,e.supportModules,"testkitConfig"),tsconfig:await K(t,e.supportModules,"tsconfig")}}async function K(t,e,i){if(!Object.hasOwn(e,i))return null;const r=e[i];if(!c.isAbsolute(r))throw new Error(`supportModules.${i} must be an absolute path`);return L(t,r,`supportModules.${i}`)}function yt(t,e){return{...pt({engineId:"node-vitest",installationKind:"root-direct-packages",profile:t.profile}),directPackages:{esbuild:e.packages.esbuild.version,typescript:e.packages.typescript.version,vite:e.packages.vite.version,vitest:e.packages.vitest.version}}}function Dt(t){return{...p(t,"NODE_VITEST_PREPARE_FAILED"),classification:t instanceof b?"product":"infra"}}async function N(t){try{return await t()}catch(e){throw new b(e)}}
|
|
1
|
+
import{makeTempDirAsync as U}from"../../../process/files/temp-dir.js";import{toError as B}from"../../../kernel/error-serialization.js";import{isDeepStrictEqual as ee}from"node:util";import{classifyManagedProcessResult as te,engineExecutionResult as re,terminalOutcome as P,emptyEvidence as L,failureFromError as j,firstOutputLine as K,processExitDetails as ne,processExitFailure as W,taskBeforeStartOutcome as ie,managedProcessFailure as z,taskTimeoutFailure as oe}from"../../adapters/execution.js";import{requireRootDirectory as se,requireAbsoluteWorkspacePath as H,requireConsumerFile as ae,safeSegment as J}from"../../adapters/workspace.js";import w from"node:fs/promises";import I from"node:path";import{pathToFileURL as ce}from"node:url";import{isEngineTaskDeadlineExceededReason as de,resolveEngineTaskInputs as le}from"../../api/index.js";import{createInvocationProcessEnvironment as ue,runManagedProcess as pe}from"../../../process/index.js";import{managedVitestAliases as me}from"../../installations/node-vitest.js";import{decodeVitestSelection as fe,resolveRepositoryVitest as Ee}from"../selection.js";import{collectNodeVitestEvidence as ve,readNodeVitestRunReport as Te}from"./evidence.js";import{assertNodeVitestSpawnEnvironmentBudget as X,NODE_VITEST_RUNTIME_INPUT_FILE_ENV as Ie,NODE_VITEST_RUNTIME_INPUT_SHA256_ENV as ye,selectNodeVitestForwardedEnvironment as De,splitManagedNodeVitestEnvironment as he,verifyOwnedNodeVitestRuntimeInput as we,writeOwnedNodeVitestRuntimeInput as Ne}from"../runtime/runtime-input.js";import{NODE_VITEST_DRIVER_FILE as Y,writeNodeVitestWorkspace as ge}from"./workspace.js";import{nodeVitestReportOptions as _e}from"./reporter.js";import{engineEvidenceIdentity as Ve}from"../../adapters/evidence-identity.js";import{getNodeStartupCacheEnvironment as Oe}from"../../adapters/node-startup-cache.js";const g={codePrefix:"NODE_VITEST",label:"Node/Vitest"},G="Unhandled Reporter Error";class $ extends Error{constructor(t){const r=B(t);super(r.message,{cause:r}),this.name="NodeVitestConsumerPreparationError"}}export const nodeVitestExecutorDependencies={removeOwnedDirectory:e=>w.rm(e,{force:!0,recursive:!0}),writeRuntimeInput:Ne,writeWorkspace:ge};export async function executeNodeVitestEngine(e,t,r,m=nodeVitestExecutorDependencies){const l=await Re(e,t,m,r),o=Date.now(),s=l.tasks.map(c=>{e.observer?.taskStarted(c.task);const f=c.preparationFailure;return ie(c.task,e.signal,o,g)??(f===null?null:P(c.task.id,"failed",o,L(),f))}),p=l.tasks.filter((c,f)=>s[f]===null),i=[],v=p.length===0?[]:await Se(e,l,p,o,i);let E=0;return re(e,s.map(c=>c??v[E++]),ke(e,l),i)}async function Re(e,t,r,m){const l=e.profile.id,o=await se(e.workspace.rootDirectory);H(e.workspace.temporaryDirectory,"temporary directory"),H(e.workspace.artifactDirectory,"artifact directory"),await w.mkdir(e.workspace.temporaryDirectory,{recursive:!0}),await w.mkdir(e.workspace.artifactDirectory,{recursive:!0});const s=await w.realpath(e.workspace.temporaryDirectory),p=await w.realpath(e.workspace.artifactDirectory),i=await U(`node-vitest-${J(e.invocationId)}-`,{parentDir:s});m.defer(()=>r.removeOwnedDirectory(i));const v=I.join(i,"reports");await w.mkdir(v,{mode:448});const E=await ue(i);let c=[];for(const[n,u]of e.tasks.entries()){const a=le(e,u),N=`${n.toString().padStart(3,"0")}-${J(u.id)}`,y=await U(`${N}-`,{parentDir:p});try{const x=await Z(()=>ae(o,u.file,"Node/Vitest task file")),C=I.join(v,`${N}.json`),M={file:x,reportFile:C,sourceFile:u.file,taskId:u.id},A=I.join(y,"data");c.push({artifactDirectory:y,inputs:a,task:u,preparationFailure:null,prepared:{dataDirectory:A,module:M}})}catch(x){const C=Q(x);c.push({artifactDirectory:y,inputs:a,task:u,preparationFailure:C,prepared:null})}}const f=c.filter(n=>n.prepared!==null),d=I.join(i,"setup.mjs"),T=I.join(i,"input-bootstrap.mjs"),D=I.join(i,"driver-request.json"),R=I.join(v,"run.json"),_=I.join(i,"startup-failure.txt");let V=null,S=null,h=t.vitest;const F=`--import=${JSON.stringify(ce(T).href)}`;let O={...E.environment,FORCE_COLOR:"0",NODE_OPTIONS:F,NO_COLOR:"1"};if(f.length>0)try{xe(f);const{configuration:n}=f[0].inputs,u=n===void 0?null:fe(n),a=u!==null&&u.runner!=="managed"?u:null;a!==null&&(h=Ee(o));const N=Object.keys(f[0].inputs.supportModules);if(N.length>0)throw new $(new Error(`Node/Vitest engine does not support support module(s): ${N.join(", ")}`));let y=await Z(()=>Ce(e,l,f,a?.host??null));if(a===null){const k=he(y.environment);y={...y,environment:k.overlay},O={...O,...k.process}}else{const k=b=>process.platform==="win32"?b.toUpperCase():b,q=new Set(Object.keys(y.environment).map(k));O={...Object.fromEntries(Object.entries(a.host).filter(([b])=>!q.has(k(b)))),...y.environment,NODE_OPTIONS:[F,a.host.NODE_OPTIONS].join(" ").trim()}}V=await r.writeRuntimeInput(i,y);const{file:x,sha256:C,sizeBytes:M}=V;await r.writeWorkspace({inputBootstrapFile:T,runtimeInput:{expectedFile:x,expectedInvocationId:e.invocationId,expectedSha256:C,expectedSizeBytes:M,startupFailure:{driverFile:Y,file:_,vitestWorkersDirectory:I.join(h.root,"dist","workers")}},setupFile:d,vitestModule:h.index});const A={cacheDirectory:I.join(i,"cache"),invocationId:e.invocationId,runReportFile:R,setupFile:d,startupFailureFile:_,vitest:{entrypoint:h.entrypoint,name:"vitest",version:h.version}};S=a===null?{...A,aliases:me(t),config:!1,managed:{externalModules:[t.authoringEntrypoints.data.replaceAll(I.sep,"/")]},project:null,test:{disableConsoleIntercept:!0,environment:"node",fileParallelism:!1,isolate:!0,maxWorkers:1,pool:"forks"}}:{...A,aliases:{},config:a.config,managed:null,project:a.project,test:{}}}catch(n){const u=Q(n);c=c.map(a=>a.prepared===null?a:{...a,preparationFailure:u,prepared:null})}return Object.freeze({driverRequest:S,driverRequestFile:D,installation:t,processEnvironment:O,profileId:l,rootDirectory:o,runReportFile:R,runtimeInput:V,startupFailureFile:_,tasks:Object.freeze(c),vitest:h})}async function Se(e,t,r,m,l){const o=n=>r.map(({task:u})=>P(u.id,"failed",m,L(),n(u.timeoutMs)));try{if(t.runtimeInput===null||t.driverRequest===null)throw new Error("Node/Vitest run was not prepared");await we(t.runtimeInput)}catch(n){return o(()=>({...j(n,"NODE_VITEST_INPUT_INVALID"),classification:"infra"}))}const s=await Fe(e,t,t.runtimeInput,r[0]),p=Math.min(...r.map(({task:n})=>n.deadlineMs))-Date.now();if(p<=0)return o(n=>oe(n,g));const i=t.driverRequest.managed===null?{}:{hookTimeout:p,teardownTimeout:p,testTimeout:p},v=r.map(({prepared:n})=>n.module),E={...t.driverRequest,modules:v,test:{...t.driverRequest.test,...i}};await w.writeFile(t.driverRequestFile,JSON.stringify(E),{flag:"wx",mode:384});const c=await pe({args:[Y,t.driverRequestFile],cwd:t.rootDirectory,displayLabel:"Node/Vitest",env:s,executable:process.execPath,signal:e.signal,timeoutMs:p}),f=await w.readFile(t.startupFailureFile,"utf8").catch(()=>null),d=await Te(e.invocationId,t.runReportFile),T=d instanceof Error?[]:d.unhandledErrors.filter(({type:n})=>n!==G),D=[];for(const{artifactDirectory:n,prepared:u}of r)D.push(await ve({identity:_e(e.invocationId,u.module).identity,artifactDirectory:n,dataDirectory:u.dataDirectory,reportFile:u.module.reportFile,rootDirectory:t.rootDirectory,stderr:c.stderr,stdout:c.stdout,unhandledErrors:T.filter(({testPath:a})=>a===void 0||I.resolve(a)===I.resolve(u.module.file))}).catch(a=>nodeVitestEvidenceCollectionFailure(c,a)));const R=D.map(n=>"reportSummary"in n?n.reportSummary:null),_=de(e.signal.reason),V=c.cancelled||c.timedOut||_,S=V&&d instanceof Error&&R.includes(null),h=T.length>0||R.some(n=>n?.success===!1||n?.numTotalTests===0),F=d instanceof Error?0:c.exitCode??d.exitCode,O=d instanceof Error?S?{exitCode:0,unhandledErrors:[]}:d:{...d,exitCode:F===1&&(h||d.afterTests!==void 0)?0:F};return!(d instanceof Error)&&d.afterTests!==void 0&&l.push(`Vitest failed the run after its tests passed: ${d.afterTests.join("; ")}`),r.map(({task:n},u)=>{const a=D[u];if(f!==null&&!V)return P(n.id,"failed",m,"reportSummary"in a?a.evidence:L(),{classification:"infra",code:"NODE_VITEST_START_FAILED",message:`Vitest could not start: ${f}`});if(!("reportSummary"in a))return P(n.id,"failed",m,L(),a);const{failure:N,status:y}=classifyNodeVitestTaskResult(c,O,a,n.timeoutMs,_,S);return P(n.id,y,m,a.evidence,N)})}export function classifyNodeVitestTaskResult(e,t,r,m,l,o=!1){const s=d=>({failure:d,status:"failed"}),p=z(e,g);if(p!==null)return s(p);const i=r.reportSummary,v=i===null||!o?te(e,m,l,g):null;if(v!==null)return v;const E=t instanceof Error?void 0:t.unhandledErrors.find(({type:d})=>d===G),c=t instanceof Error?void 0:t.failure??(E&&{...E,phase:"reporter"});if(c!==void 0){const{message:d,phase:T,stack:D}=c;return{failure:{classification:"infra",code:"NODE_VITEST_RUN_FAILED",details:{phase:T},message:`Vitest ${T} failed: ${d}`,...D===void 0?{}:{stack:D}},status:T==="config"?"not_run":"failed"}}if(r.environmentFailure!==null)return s(r.environmentFailure);if(i===null||t instanceof Error){const d=K(e.stderr)??K(e.stdout),T=e.exitCode===0?null:W(e,g,d,"Vitest").failure;return s({...j(r.reportError??t,"NODE_VITEST_REPORT_INVALID"),...T===null?{}:{details:T.details,message:T.message},classification:"infra"})}const f=o?null:e.exitSignal;if(t.exitCode!==0||f!==null){const d=f===null?`exited with code ${t.exitCode.toString()}`:`was terminated by ${f}`;return s({classification:"infra",code:"NODE_VITEST_EXIT_CODE",details:ne(e),message:`Vitest ${d}, which its test results do not explain`})}return i.numTotalTests===0&&r.reportErrorCount===0?s({code:"NODE_VITEST_NO_TESTS",message:"Vitest did not discover any tests for the task file"}):!i.success||i.numFailedTests>0||r.reportErrorCount>0?W(e,g,r.reportFailureMessage,"Vitest"):i.numPassedTests===0&&(i.numPendingTests>0||i.numTodoTests>0)?{failure:null,status:"skipped"}:r.dataEvidenceError!==null?s(j(r.dataEvidenceError,"NODE_VITEST_DATA_EVIDENCE_INVALID")):i.numPassedTests===0?s({code:"NODE_VITEST_REPORT_FAILED",message:"Vitest report did not contain a completed passing test"}):{failure:null,status:"passed"}}export function nodeVitestEvidenceCollectionFailure(e,t){const r=B(t);return z(e,g,r)??{...j(r,"NODE_VITEST_EVIDENCE_FAILED"),classification:"infra"}}async function Fe(e,t,r,{inputs:m,task:l}){const o=e.target.baseUrl,s={...t.processEnvironment,...o===null?{}:{BASE_URL:o},TESTKIT_ACTIVE:"1",[Ie]:r.file,[ye]:r.sha256,TESTKIT_INVOCATION_ID:e.invocationId,TESTKIT_LEASE_DIR:l.orchestration.lease.directory,TESTKIT_LEASE_ID:l.orchestration.lease.id,TESTKIT_MODE:l.orchestration.mode,...l.orchestration.runtimeId===void 0?{}:{TESTKIT_RUNTIME_ID:l.orchestration.runtimeId}},p=t.driverRequest?.managed!==null;p&&X(s);const i={...t.processEnvironment,...m.environment};Object.assign(s,await Oe(e.workspace.cacheDirectory,i));try{p&&X(s)}catch{delete s.NODE_COMPILE_CACHE}return s}function xe(e){const t=({prepared:o})=>o.module.file,r=e.find((o,s)=>e.findIndex(p=>t(p)===t(o))!==s);if(r!==void 0)throw new Error(`Node/Vitest task ${r.task.id} selects a file that another task in the request selects`);const m=({inputs:o,task:s})=>[o.environment,o.supportModules,s.orchestration,s.timeoutMs],l=e.find(o=>!ee(m(o),m(e[0])));if(l!==void 0)throw new Error(`Node/Vitest task ${l.task.id} needs a different environment, support modules, orchestration or timeout than ${e[0].task.id}`)}function Ce(e,t,r,m){const{baseUrl:l,databases:o,endpoints:s,handles:p}=e.target;return{...m===null?{}:{host:m},baseUrl:l,databases:o,endpoints:s,engineId:"node-vitest",environment:De(r[0].inputs.environment),handles:p,invocationId:e.invocationId,profileId:t,tasks:r.map(({inputs:i,prepared:v,task:E})=>({context:{baseUrl:l,engineId:"node-vitest",invocationId:e.invocationId,profileId:t,serviceName:E.serviceName,task:{file:E.file,id:E.id,suiteName:E.suiteName,...E.testType===void 0?{}:{testType:E.testType}}},dataDirectory:v.dataDirectory,file:v.module.file,fixtures:i.fixtures,...i.setupData===void 0?{}:{setupData:i.setupData},taskId:E.id})),version:1}}function ke(e,t){return{...Ve({engineId:"node-vitest",installationKind:t.driverRequest?.managed===null?"repository-package":"root-direct-packages",profile:e.profile}),directPackages:{vitest:t.vitest.version}}}function Q(e){return{...j(e,"NODE_VITEST_PREPARE_FAILED"),classification:e instanceof $?"product":"infra"}}async function Z(e){try{return await e()}catch(t){throw new $(t)}}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{existsSync as w,realpathSync as d}from"node:fs";import x from"node:fs/promises";import E from"node:path";import{inspect as R}from"node:util";import{toError as m}from"../../../kernel/error-serialization.js";import{isUnknownRecord as F}from"../../../kernel/unknown-values.js";import{writeNativeReport as j}from"../../adapters/native-report.js";import{importResolvedPackageEntrypoint as k}from"../../installations/package-resolution.js";import{nodeVitestReportOptions as V,reportedError as p,TestkitVitestReporter as N}from"./reporter.js";const s=JSON.parse(await x.readFile(process.argv[2]??"","utf8")),T=new Map(s.modules.map(e=>[d(e.file),e])),O=V(s.invocationId,{reportFile:s.runReportFile,sourceFile:".",taskId:"run"}),a={unhandledErrors:[]},P=16*1024*1024;let g;const $=setInterval(()=>{w(s.startupFailureFile)&&process.exit(1)},100);$.unref(),process.env.TEST="true",process.env.VITEST="true",process.env.NODE_ENV??="test";try{const{createVitest:e}=await k(s.vitest),o={cacheDir:s.cacheDirectory,resolve:{alias:Object.entries(s.aliases).map(([i,u])=>({find:v(i),replacement:u})),...s.managed===null?{}:{tsconfigPaths:!0}},test:{...s.test,...s.managed===null?{}:{server:{deps:{external:s.managed.externalModules.map(v)}}}}},t=await e("test",{...{allowOnly:!1,includeTaskLocation:!0,passWithNoTests:!1,update:"none"},config:s.config??void 0,watch:!1},o);g=t,t.config.snapshotOptions.updateSnapshot="none",t.snapshot.options.updateSnapshot="none";for(const i of t.projects)i.config.setupFiles.push(s.setupFile);const n=await C(t),c=n.map(({moduleId:i,project:u})=>({...y(i),project:u.name})),{reporters:l}=t;s.managed!==null&&(l.length=0),l.unshift(new N(s.invocationId,c));const S=I(t,l),f=t;await(f.standalone===void 0?f.init():f.standalone()),a.unhandledErrors=(await t.runTestSpecifications(n,!1)).unhandledErrors.map(_);const h=S();h.length>0&&(a.afterTests=h)}catch(e){a.failure={phase:g===void 0?"config":"run",...p(m(e))},process.stderr.write(`${R(e)}
|
|
2
|
+
`),process.exitCode=1}finally{w(s.startupFailureFile)&&process.exit(1),await g?.close().catch(e=>{a.failure??={phase:"close",...p(m(e))}})}await j(O,{...a,exitCode:process.exitCode??0},P);async function C(e){if(s.config===!1)return s.modules.map(({file:t})=>{const n=t.split(E.sep).join("/");return e.getProjectByName("").createSpecification(n)});const o=(await e.globTestSpecifications()).filter(({moduleId:t,project:n})=>T.has(d(t))&&(s.project===null||n.name===s.project)),r=s.modules.find(({file:t})=>!o.some(({moduleId:n})=>y(n).file===t));if(r!==void 0){const t=r.sourceFile.split(E.sep).join("/");throw new Error(`Vitest's configuration no longer selects ${t}, which Testkit listed earlier`)}return o}function I(e,o){let r;const t=[],n=e.logger.error.bind(e.logger);return e.logger.error=(...c)=>{r!==void 0&&t.push(c.map(String).join(" ")),n(...c)},o.push({onTestRunEnd:()=>{r=process.exitCode??0}}),()=>r===0&&process.exitCode===1?t:[]}function y(e){const o=T.get(d(e));if(o===void 0)throw new Error(`Vitest selected ${e}, which Testkit did not request`);return o}function _(e){if(!F(e)||typeof e.message!="string")return p(m(e));const{name:o,stack:r,type:t,VITEST_TEST_PATH:n}=e;return{...p({message:e.message,...typeof o=="string"?{name:o}:{},...typeof r=="string"?{stack:r}:{}}),...typeof t=="string"?{type:t}:{},...typeof n=="string"?{testPath:n}:{}}}function v(e){return new RegExp(`^${e.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&")}$`,"u")}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
`,"utf8"));return{...await A(n,"application/json","testkit.failure-details","vitest-failure-details",[...e.length===0?[]:[
|
|
1
|
+
import y from"node:fs/promises";import w from"node:path";import{evidenceFileAccess as O,readStableEvidenceFile as x,writeOwnedEvidenceFile as $}from"../../adapters/evidence-files.js";import{NODE_VITEST_DATA_FAILURE_DETAILS_ARTIFACT_KIND as X,nodeVitestDataScenarioFile as Y}from"../runtime/runtime-input.js";import{dataFlowArtifacts as z}from"../runtime/data/report.js";import{readVitestReportCases as U,sharedVitestTitles as K,vitestErrorDetails as q,vitestReportErrors as D,vitestTestFailureDetails as G}from"./failure-details.js";import{parseEnvironmentValueMissingFailure as H}from"../../contracts/environment-values.js";import{readNativeReport as k,requireNativeEvidenceJson as Q}from"../../adapters/native-report.js";import{isUnknownRecord as g}from"../../../kernel/unknown-values.js";import{toError as N}from"../../../kernel/error-serialization.js";import{isPathWithin as Z}from"../../../process/files/paths.js";import{firstOutputLine as tt}from"../../adapters/execution.js";import{nodeVitestReportOptions as et}from"./reporter.js";const rt=16*1024*1024,j=1024;export const NODE_VITEST_DATA_ARTIFACT_MAX_BYTES=16*1024*1024,NODE_VITEST_DATA_EVIDENCE_MAX_BYTES=64*1024*1024;const nt=".testkit-owned-evidence";export async function collectNodeVitestEvidence(t,e=O){await y.mkdir(t.artifactDirectory,{recursive:!0});const r=await y.realpath(t.artifactDirectory),s=w.join(r,nt);await y.mkdir(s,{mode:448,recursive:!1});const n=[],a=[];t.stdout.length>0&&(a.push({stream:"stdout",text:t.stdout}),n.push(await R(r,"stdout.log","node-vitest-stdout",t.stdout))),t.stderr.length>0&&(a.push({stream:"stderr",text:t.stderr}),n.push(await R(r,"stderr.log","node-vitest-stderr",t.stderr)));const o=await st(t,s,e);n.push(...o.artifacts);const u=await at(t,r,s,o.cases,e);return n.push(...u.artifacts),{dataEvidenceError:u.error,environmentFailure:o.environmentFailure,evidence:{artifacts:n,logs:a,metrics:[],...o.summary===null?{}:{native:{vitest:o.summary}}},reportError:o.error,reportErrorCount:o.errorCount,reportFailureMessage:o.failureMessage,reportSummary:o.summary}}async function st({identity:t,reportFile:e,rootDirectory:r,unhandledErrors:s=[]},n,a){try{const o=await b(e,a);if(!o.exists||o.contents===null)throw new Error("Vitest did not produce its Testkit native report");const u=k(o.value,t).result;if(!g(u)||!g(u.summary))throw new Error("Vitest native report must contain result and summary objects");const f=ct(u.summary),m=U(u.cases,f),l=G(u.failures,r,K(m));if(f.numFailedTests!==l.length)throw new Error("Vitest native report failure count does not match its summary");const h=D(u.errors);if(f.success&&h.length>0)throw new Error("Vitest native report success conflicts with runtime errors");const V=[...h,...s],E=H(u.environmentFailure,"Vitest native report environment failure"),i=await $(n,"testkit-vitest-report.json",E===null?o.contents:Buffer.from(it(o.value))),c=await A(i,"application/json","engine.testkit-vitest-report","testkit-vitest-report","Testkit native Vitest report"),T=await ot(n,l,q(V)),p=[c,...T===null?[]:[T]];if(u.pending!==void 0){const v=new Error("Vitest did not finish the file in every project that selects it");return{artifacts:p,cases:m,environmentFailure:null,error:v,errorCount:0,failureMessage:null,summary:null}}return{artifacts:p,cases:m,environmentFailure:E,error:null,errorCount:V.length,failureMessage:typeof l[0]?.message=="string"?l[0].message:V.find(v=>v.message.trim().length>0)?.message??null,summary:f}}catch(o){return{artifacts:[],cases:[],environmentFailure:null,error:N(o),errorCount:0,failureMessage:null,summary:null}}}function it(t){if(!g(t)||!g(t.result))throw new Error("Vitest native report must contain result and summary objects");const e=Object.fromEntries(Object.entries(t.result).filter(([r])=>r!=="environmentFailure"));return JSON.stringify({...t,result:e})}async function ot(t,e,r){if(e.length+r.length===0)return null;const s={failures:[...e,...r],phase:"exec"},n=await $(t,"vitest-failure-details.json",Buffer.from(`${JSON.stringify(s,null,2)}
|
|
2
|
+
`,"utf8"));return{...await A(n,"application/json","testkit.failure-details","vitest-failure-details",[...e.length===0?[]:[I(e.length,"failed Vitest test")],...r.length===0?[]:[`${I(r.length,"Vitest error")} outside a test`]].join(" and ")),data:s}}function I(t,e){return`${t.toString()} ${e}${t===1?"":"s"}`}async function at({dataDirectory:t,identity:e},r,s,n,a){const o=w.dirname(Y(t,"")),u=[];try{const m=(await y.readdir(o).catch(i=>{if(J(i)&&i.code==="ENOENT")return[];throw i})).filter(i=>i.endsWith(".json")).sort();if(m.length>j)throw new Error(`Data evidence exceeds its ${j.toString()} test limit`);let l=0;const h=[];for(const i of m){const c=`Data scenario ${i}`,T=await mt(r,w.join(o,i),c),{contents:p}=await x(T,NODE_VITEST_DATA_ARTIFACT_MAX_BYTES,c,a);if(l+=p.byteLength,l>NODE_VITEST_DATA_EVIDENCE_MAX_BYTES)throw new Error(`Data evidence exceeds its ${NODE_VITEST_DATA_EVIDENCE_MAX_BYTES.toString()} byte aggregate limit`);h.push({contents:p,label:c,name:i})}const E=h.flatMap(({contents:i,label:c,name:T})=>{const p=F(C(i,c),c),v=d(p.attempt,`${c}.attempt`),_=d(p.repeat,`${c}.repeat`),B=d(p.repeats,`${c}.repeats`),L=ut(p.scenario,`${c}.scenario`),S=n.find(({id:W})=>W===decodeURIComponent(T.slice(0,-5)));return S!==void 0&&S.state!=="skipped"&&S.attempts===v&&S.repeat===_&&_===B?[{index:n.indexOf(S),scenario:L}]:[]}).sort((i,c)=>i.index-c.index).map(({scenario:i})=>i);for(const i of E.length===0?[]:z(E,e.sourceFile,e.taskId)){const c=i.contentType==="text/markdown"?".md":".json",T=await $(s,`${i.name}${c}`,Buffer.from(i.contents,"utf8"));u.push({...await A(T,i.contentType,i.kind,i.name,i.summary),...i.kind===X?{data:F(JSON.parse(i.contents),i.name)}:{}})}}catch(f){return{artifacts:u,error:N(f)}}return{artifacts:u,error:null}}function ut(t,e){const r=F(t,e);if(M(r.name,`${e}.name`),M(F(r.location,`${e}.location`).path,`${e}.location.path`),r.status!=="failed"&&r.status!=="passed")throw new Error(`${e}.status must be failed or passed`);const n=["budgetFailures","budgets","events","evidence","findings","metrics","sequences"].find(a=>!Array.isArray(r[a]));if(n!==void 0)throw new Error(`${e}.${n} must be an array`);return r}async function R(t,e,r,s){const n=w.join(t,e);return await y.writeFile(n,s,"utf8"),A(n,"text/plain; charset=utf-8","engine.output",r,tt(s)??"captured output")}async function A(t,e,r,s,n){const a=await y.stat(t);if(!a.isFile())throw new Error(`${s} artifact is not a regular file`);return{contentType:e,kind:r,metadata:{sizeBytes:a.size},name:s,path:t,summary:n}}async function b(t,e){let r;try{({contents:r}=await x(t,rt,t,e))}catch(n){if(J(n)&&n.code==="ENOENT")return{contents:null,exists:!1,value:null};throw n}const s=C(r,t);return{contents:r,exists:!0,value:s}}function C(t,e){const r=JSON.parse(t.toString("utf8"));return Q(r,e),r}function ct(t){const e={numFailedTests:d(t.numFailedTests,"Vitest native report.summary.numFailedTests"),numPassedTests:d(t.numPassedTests,"Vitest native report.summary.numPassedTests"),numPendingTests:d(t.numPendingTests,"Vitest native report.summary.numPendingTests"),numTodoTests:d(t.numTodoTests,"Vitest native report.summary.numTodoTests"),numTotalTests:d(t.numTotalTests,"Vitest native report.summary.numTotalTests"),numFailedTestSuites:d(t.numFailedTestSuites,"Vitest native report.summary.numFailedTestSuites"),numPassedTestSuites:d(t.numPassedTestSuites,"Vitest native report.summary.numPassedTestSuites"),numPendingTestSuites:d(t.numPendingTestSuites,"Vitest native report.summary.numPendingTestSuites"),numTotalTestSuites:d(t.numTotalTestSuites,"Vitest native report.summary.numTotalTestSuites"),success:dt(t.success,"Vitest native report.summary.success")};if(e.numTotalTests!==e.numFailedTests+e.numPassedTests+e.numPendingTests+e.numTodoTests||e.numTotalTestSuites!==e.numFailedTestSuites+e.numPassedTestSuites+e.numPendingTestSuites||e.success&&(e.numFailedTests>0||e.numFailedTestSuites>0||e.numTotalTestSuites===0))throw new Error("Vitest native report summary contains inconsistent counts or success");return e}async function mt(t,e,r){const s=w.isAbsolute(e)?e:w.resolve(t,e),n=await y.lstat(s);if(!n.isFile()||n.isSymbolicLink())throw new Error(`${r} must be a regular non-symbolic-link file`);const a=await y.realpath(s);if(!Z(t,a))throw new Error(`${r} must stay within the task artifact directory`);return a}function F(t,e){if(!g(t))throw new Error(`${e} must contain an object`);const r={};for(const[s,n]of Object.entries(t))r[s]=P(n,`${e}.${s}`);return r}function P(t,e){if(t===null||typeof t=="boolean"||typeof t=="string")return t;if(typeof t=="number"){if(!Number.isFinite(t))throw new Error(`${e} must be finite`);return t}return Array.isArray(t)?t.map((r,s)=>P(r,`${e}[${s.toString()}]`)):F(t,e)}function M(t,e){if(typeof t!="string"||t.trim().length===0)throw new Error(`${e} must be a non-empty string`);return t}function d(t,e){if(typeof t!="number"||!Number.isSafeInteger(t)||t<0)throw new Error(`${e} must be a non-negative safe integer`);return t}function dt(t,e){if(typeof t!="boolean")throw new Error(`${e} must be boolean`);return t}function J(t){return t instanceof Error}export async function readNodeVitestRunReport(t,e,r=O){try{const{identity:s}=et(t,{reportFile:e,sourceFile:".",taskId:"run"}),{result:n}=k((await b(e,r)).value,s);if(!g(n)||!Number.isSafeInteger(n.exitCode)||!Array.isArray(n.unhandledErrors))throw new Error("Vitest run report must contain an exit code and unhandled errors");const a=n.unhandledErrors,o=n.failure===void 0?[]:[n.failure];D([...a,...o],"Vitest run report errors");const u=m=>g(m)&&[m.testPath,m.type].every(l=>l===void 0||typeof l=="string"),f=n.afterTests===void 0?[]:n.afterTests;if(!Array.isArray(f)||!f.every(m=>typeof m=="string")||!a.every(u)||!o.every(m=>g(m)&&["close","config","run"].includes(m.phase)))throw new Error("Vitest run report errors are malformed");return n}catch(s){return N(s)}}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
`);return{classification:"product",count:1,key:o
|
|
1
|
+
import l from"node:path";export function vitestTestFailureDetails(t,e,s=new Set){if(!Array.isArray(t))throw new Error("Vitest native report failures must be an array");const i=new Set;return t.map(n=>{if(typeof n!="object"||n===null||Array.isArray(n))throw new Error("Vitest native report failure must contain an object");const r=n,c=p(r.id,"id");if(i.has(c))throw new Error("Vitest native report contains a duplicate test identity");i.add(c);const o=p(r.title,"title"),a=v(r.project),f=p(r.file,"file"),m=k(e,f),d=V(r.line),w=V(r.column),h=vitestReportErrors(r.errors,"Vitest native report failure errors");vitestReportErrors(r.previousAttemptErrors,"Vitest native report failure previous attempt errors");const g=h.at(0),y=[g?.stack??"",...h.slice(1).map(u=>u.stack??u.message)].map(u=>u.trim()).filter(Boolean).join(`
|
|
2
|
+
`);if(r.classification!==void 0&&r.classification!=="infra")throw new Error("Vitest native report failure classification must be infra when present");return{classification:r.classification??"product",count:1,key:a===""?o:`${a}: ${o}`,kind:"vitest-test",location:{path:m,...a===""?{}:{project:a},...d===null?{}:{line:d},...w===null?{}:{column:w}},message:g?.message.trim()||`Vitest assertion failed: ${o}`,...s.has(E(a,f,o))?{sharedTitle:!0}:{},...y.length===0?{}:{stack:y},title:o}})}function E(t,e,s){return`${t}
|
|
3
|
+
${e}
|
|
4
|
+
${s}`}function v(t){if(t!==void 0&&typeof t!="string")throw new Error("Vitest native report project must be text");return t??""}const b=new Set(["failed","passed","pending","skipped"]);export function vitestReportErrors(t,e="Vitest native report errors"){if(!Array.isArray(t))throw new Error(`${e} must be an array`);return t.map(s=>{if(typeof s!="object"||s===null||Array.isArray(s))throw new Error(`${e} must contain objects`);const i=s;if(typeof i.message!="string")throw new Error(`${e} must each have a string message`);if(i.stack!==void 0&&typeof i.stack!="string")throw new Error(`${e} must each have a string stack when present`);return{message:i.message,...i.stack===void 0?{}:{stack:i.stack}}})}export function readVitestReportCases(t,e){if(!Array.isArray(t))throw new Error("Vitest native report cases must be an array");const s=new Set,i=t.map(n=>{if(typeof n!="object"||n===null||Array.isArray(n))throw new Error("Vitest native report case must contain an object");const r=n,c=p(r.id,"case id");if(s.has(c))throw new Error("Vitest native report contains a duplicate case identity");s.add(c);const o=p(r.title,"case title"),a=p(r.file,"case file");if(!b.has(r.state))throw new Error("Vitest native report case state is invalid");if(typeof r.attempts!="number"||!Number.isSafeInteger(r.attempts)||r.attempts<0)throw new Error("Vitest native report case attempts must be a non-negative integer");if(typeof r.repeat!="number"||!Number.isSafeInteger(r.repeat)||r.repeat<0)throw new Error("Vitest native report case repeat must be a non-negative integer");const{attempts:f,repeat:m}=r;return{attempts:f,file:a,id:c,project:v(r.project),repeat:m,state:r.state,title:o}});if(i.length!==e.numTotalTests||i.filter(n=>n.state==="failed").length!==e.numFailedTests||i.filter(n=>n.state==="passed").length!==e.numPassedTests)throw new Error("Vitest native report cases do not match its summary");return i}export function sharedVitestTitles(t){const e=new Set,s=new Set;for(const i of t){const n=E(i.project,i.file,i.title);e.has(n)&&s.add(n),e.add(n)}return s}export function vitestErrorDetails(t){const e="Vitest error outside a test";return t.map((s,i)=>{const n=s.stack?.trim()??"";return{count:1,key:`error ${String(i+1)}`,kind:"vitest-error",message:s.message.trim()||e,...n.length===0?{}:{stack:n},title:e}})}function k(t,e){if(!l.isAbsolute(e))return e;const s=l.relative(t,e);return s.length===0||s.startsWith("..")||l.isAbsolute(s)?e:s.split(l.sep).join("/")}function V(t){if(t===null)return null;if(typeof t!="number"||!Number.isSafeInteger(t)||t<0)throw new Error("Vitest native report failure coordinate must be a non-negative integer or null");return t}function p(t,e){if(typeof t!="string"||t.trim().length===0)throw new Error(`Vitest native report failure ${e} must be a non-empty string`);return t}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{writeNativeReport as
|
|
1
|
+
import M from"node:fs/promises";import c from"node:path";import{writeNativeReport as y}from"../../adapters/native-report.js";import{boundEnvironmentValueMissingText as S,environmentValueMissingFailure as F,readEnvironmentValueMissing as f}from"../../contracts/environment-values.js";export const ATTEMPT_ERROR_STARTS_META_KEY="testkitAttemptErrorStarts";export function nodeVitestReportOptions(t,{reportFile:n,sourceFile:s,taskId:i}){return{identity:{engineId:"node-vitest",invocationId:t,sourceFile:s,taskId:i},reportFile:n,workspaceDirectory:c.dirname(n)}}export class TestkitVitestReporter{invocationId;modules;finished=new Map;written=new Map;constructor(n,s){this.invocationId=n,this.modules=s}async onTestModuleEnd(n){const s=this.modules.find(({file:e,project:r})=>c.resolve(e)===c.resolve(n.moduleId)&&r===n.project.name);if(s===void 0)return;const i=[...this.finished.get(s.taskId)??[],n];this.finished.set(s.taskId,i);const a=this.modules.filter(({taskId:e})=>e===s.taskId).length-i.length,l=i.flatMap(e=>[e,...e.children.allSuites()]),o=i.flatMap(e=>[...e.children.allTests()]),u=o.filter(e=>e.result().state==="failed"),d=l.filter(e=>e.state()==="failed").length,g=l.filter(e=>e.state()==="pending"||e.state()==="queued"||e.type==="suite"&&e.options.mode==="todo").length,h=l.flatMap(e=>e.errors().filter(r=>!A(e,r))),T=h.map(reportedError),m=[...o.flatMap(e=>e.result().errors??[]),...h].flatMap(e=>{const r=f(e);return r===null?[]:[{message:e.message,missing:r}]}),k={...a===0?{}:{pending:a},summary:{numFailedTestSuites:d,numFailedTests:u.length,numPassedTestSuites:l.length-d-g,numPassedTests:o.filter(e=>e.result().state==="passed").length,numPendingTestSuites:g,numPendingTests:o.filter(e=>e.options.mode!=="todo"&&(e.result().state==="pending"||e.result().state==="skipped")).length,numTodoTests:o.filter(e=>e.options.mode==="todo").length,numTotalTestSuites:l.length,numTotalTests:o.length,success:d===0&&u.length===0&&T.length===0},...m.length===0?{}:{environmentFailure:F(m.map(({missing:e})=>e),m[0].message)},cases:o.map(e=>({attempts:R(e),file:e.module.moduleId,id:e.id,project:e.project.name,repeat:e.diagnostic()?.repeatCount??0,state:e.result().state,title:I(e)})),failures:u.map(e=>({...e.result().errors?.some(r=>f(r)!==null)?{classification:"infra"}:{},id:e.id,project:e.project.name,title:I(e),file:e.module.moduleId,line:e.location?.line??null,column:e.location?.column??null,errors:v(e).final.map(reportedError),previousAttemptErrors:v(e).earlier.map(reportedError)})),errors:T},p={...s,reportFile:`${s.reportFile}.next`},E=(this.written.get(s.taskId)??Promise.resolve()).then(async()=>{await M.rm(p.reportFile,{force:!0}),await y(nodeVitestReportOptions(this.invocationId,p),k,16*1024*1024),await M.rename(p.reportFile,s.reportFile)});this.written.set(s.taskId,E),await E}}function A(t,n){return t.type==="module"&&n.message===`No test suite found in file ${t.moduleId}`}function v(t){const n=t.result().errors??[],s=t.meta()[ATTEMPT_ERROR_STARTS_META_KEY],i=Array.isArray(s)?s.at(-1):void 0,a=typeof i=="number"&&i<n.length?i:0;return{earlier:n.slice(0,a),final:n.slice(a)}}function R(t){const n=t.diagnostic();return n===void 0?0:n.retryCount+1}export function reportedError(t){return{message:w(t,t.name?`${t.name}: ${t.message}`:t.message),...t.stack?{stack:w(t,t.stack)}:{}}}function w(t,n){return f(t)===null?n:S(n)}function I(t){const n=[];let s=t.parent;for(;s.type==="suite";)n.unshift(s.name),s=s.parent;return[...n,t.name].join(" ")}
|
|
@@ -1,202 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
await installNodeVitestRuntimeInput(${JSON.stringify(e)});
|
|
5
|
-
const configRuntimeSymbol = Symbol.for(${JSON.stringify(p)});
|
|
6
|
-
if (Object.hasOwn(globalThis, configRuntimeSymbol))
|
|
7
|
-
throw new Error("Managed Node/Vitest config runtime is already installed");
|
|
8
|
-
// Only the Vitest parent requests config policy. Fork workers still validate
|
|
9
|
-
// their own input, but do not load the unused TypeScript alias-policy graph.
|
|
10
|
-
let loadedConfigRuntime;
|
|
11
|
-
const load = Object.freeze(() => {
|
|
12
|
-
loadedConfigRuntime ??= (async () => {
|
|
13
|
-
const consumerResolutionRuntime = await import(${JSON.stringify(n)});
|
|
14
|
-
const configRuntimeFunctions = [
|
|
15
|
-
consumerResolutionRuntime.assertNodeVitestConsumerResolution,
|
|
16
|
-
consumerResolutionRuntime.createConsumerTypeScriptPathsPlugin,
|
|
17
|
-
consumerResolutionRuntime.isNodeVitestManagedDependencyImporter,
|
|
18
|
-
];
|
|
19
|
-
for (const value of configRuntimeFunctions) {
|
|
20
|
-
if (typeof value !== "function")
|
|
21
|
-
throw new Error("Managed Node/Vitest config runtime is invalid");
|
|
22
|
-
Object.freeze(value);
|
|
23
|
-
}
|
|
24
|
-
return Object.freeze({
|
|
25
|
-
assertNodeVitestConsumerResolution: configRuntimeFunctions[0],
|
|
26
|
-
createConsumerTypeScriptPathsPlugin: configRuntimeFunctions[1],
|
|
27
|
-
isNodeVitestManagedDependencyImporter: configRuntimeFunctions[2],
|
|
28
|
-
managedTypeScriptFile: consumerResolutionRuntime.managedTypeScriptFile,
|
|
29
|
-
version: 1,
|
|
30
|
-
});
|
|
31
|
-
})();
|
|
32
|
-
return loadedConfigRuntime;
|
|
33
|
-
});
|
|
34
|
-
const configRuntime = Object.freeze({ load, version: 1 });
|
|
35
|
-
Object.defineProperty(
|
|
36
|
-
globalThis,
|
|
37
|
-
configRuntimeSymbol,
|
|
38
|
-
{
|
|
39
|
-
configurable: false,
|
|
40
|
-
enumerable: false,
|
|
41
|
-
value: configRuntime,
|
|
42
|
-
writable: false,
|
|
43
|
-
},
|
|
44
|
-
);
|
|
45
|
-
`}function I(e,t){const n=`
|
|
1
|
+
import e from"node:fs/promises";import i from"node:path";import{fileURLToPath as a,pathToFileURL as s}from"node:url";import{NODE_VITEST_RUNTIME_INPUT_SYMBOL as l}from"../runtime/runtime-input.js";import{ATTEMPT_ERROR_STARTS_META_KEY as r}from"./reporter.js";const n=a(new URL("../../../../dist/engines/node-vitest/",import.meta.url));export const NODE_VITEST_DRIVER_FILE=i.join(n,"adapter/driver.js");const o=i.join(n,"runtime/runtime-input.js");export async function writeNodeVitestWorkspace(t){await e.mkdir(i.dirname(t.setupFile),{recursive:!0}),await Promise.all([e.writeFile(t.setupFile,p(t.vitestModule),"utf8"),e.writeFile(t.inputBootstrapFile,`const { installNodeVitestRuntimeInput } = await import(${JSON.stringify(s(o).href)});
|
|
2
|
+
await installNodeVitestRuntimeInput(${JSON.stringify(t.runtimeInput)});
|
|
3
|
+
`,"utf8")])}function p(t){return`
|
|
46
4
|
const installedRuntimeInput = globalThis[
|
|
47
|
-
Symbol.for(${JSON.stringify(
|
|
5
|
+
Symbol.for(${JSON.stringify(l)})
|
|
48
6
|
];
|
|
49
7
|
if (installedRuntimeInput === undefined)
|
|
50
8
|
throw new Error("Node/Vitest runtime input is not installed");
|
|
51
|
-
const baseUrl = installedRuntimeInput.
|
|
9
|
+
const baseUrl = installedRuntimeInput.baseUrl;
|
|
52
10
|
if (typeof baseUrl === "string") process.env.BASE_URL = baseUrl;
|
|
53
11
|
else delete process.env.BASE_URL;
|
|
54
|
-
|
|
55
|
-
${
|
|
56
|
-
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const
|
|
64
|
-
${
|
|
65
|
-
`}function O(e){return e===null?"const testkitRepositoryConfiguration = null;":`const testkitConfigModule = await import(${JSON.stringify(a(e).href)});
|
|
66
|
-
const testkitRepositoryConfiguration =
|
|
67
|
-
testkitConfigModule.default ??
|
|
68
|
-
testkitConfigModule.config ??
|
|
69
|
-
testkitConfigModule;`}function v(e,t){const n=`const installedRuntimeInput = globalThis[
|
|
70
|
-
Symbol.for(${JSON.stringify(c)})
|
|
71
|
-
];
|
|
72
|
-
if (installedRuntimeInput?.invocationId !== ${JSON.stringify(e.runtimeInput.expectedInvocationId)}
|
|
73
|
-
|| installedRuntimeInput.profileId !== ${JSON.stringify(e.runtimeInput.expectedProfileId)}
|
|
74
|
-
|| installedRuntimeInput.taskId !== ${JSON.stringify(e.runtimeInput.expectedTaskId)})
|
|
75
|
-
throw new Error("Managed Node/Vitest input bootstrap was not installed in the Vitest parent");`,s=`const configRuntimeSupplier = globalThis[
|
|
76
|
-
Symbol.for(${JSON.stringify(p)})
|
|
77
|
-
];
|
|
78
|
-
if (
|
|
79
|
-
typeof configRuntimeSupplier !== "object" ||
|
|
80
|
-
configRuntimeSupplier === null ||
|
|
81
|
-
!Object.isFrozen(configRuntimeSupplier) ||
|
|
82
|
-
Reflect.ownKeys(configRuntimeSupplier).length !== 2 ||
|
|
83
|
-
configRuntimeSupplier.version !== 1 ||
|
|
84
|
-
typeof configRuntimeSupplier.load !== "function" ||
|
|
85
|
-
!Object.isFrozen(configRuntimeSupplier.load)
|
|
86
|
-
)
|
|
87
|
-
throw new Error("Managed Node/Vitest config runtime supplier is invalid");
|
|
88
|
-
const configRuntime = await configRuntimeSupplier.load();
|
|
89
|
-
const configRuntimeKeys = [
|
|
90
|
-
"assertNodeVitestConsumerResolution",
|
|
91
|
-
"createConsumerTypeScriptPathsPlugin",
|
|
92
|
-
"isNodeVitestManagedDependencyImporter",
|
|
93
|
-
"managedTypeScriptFile",
|
|
94
|
-
"version",
|
|
95
|
-
];
|
|
96
|
-
if (
|
|
97
|
-
typeof configRuntime !== "object" ||
|
|
98
|
-
configRuntime === null ||
|
|
99
|
-
!Object.isFrozen(configRuntime) ||
|
|
100
|
-
Reflect.ownKeys(configRuntime).length !== configRuntimeKeys.length ||
|
|
101
|
-
!configRuntimeKeys.every((key) => Object.hasOwn(configRuntime, key)) ||
|
|
102
|
-
configRuntime.version !== 1 ||
|
|
103
|
-
typeof configRuntime.managedTypeScriptFile !== "string" ||
|
|
104
|
-
!configRuntimeKeys.slice(0, 3).every(
|
|
105
|
-
(key) =>
|
|
106
|
-
typeof configRuntime[key] === "function" &&
|
|
107
|
-
Object.isFrozen(configRuntime[key]),
|
|
108
|
-
)
|
|
109
|
-
)
|
|
110
|
-
throw new Error("Managed Node/Vitest config runtime is invalid");
|
|
111
|
-
const {
|
|
112
|
-
assertNodeVitestConsumerResolution,
|
|
113
|
-
createConsumerTypeScriptPathsPlugin,
|
|
114
|
-
isNodeVitestManagedDependencyImporter,
|
|
115
|
-
managedTypeScriptFile,
|
|
116
|
-
} = configRuntime;
|
|
117
|
-
if (managedTypeScriptFile !== ${JSON.stringify(e.entrypoints.packages.typescript.entrypoint)})
|
|
118
|
-
throw new Error("Managed Node/Vitest TypeScript plugin resolved outside its selected installation");`,d=e.tsconfigFile===null?"":`createConsumerTypeScriptPathsPlugin(${JSON.stringify(e.tsconfigFile)}, consumerResolutionPolicy),`;return`
|
|
119
|
-
${n}
|
|
120
|
-
${s}
|
|
121
|
-
const managedAliases = Object.freeze(${JSON.stringify(t.aliases)});
|
|
122
|
-
const managedPackageNames = Object.freeze(${JSON.stringify(R.map(({packageName:r})=>r))});
|
|
123
|
-
const managedDependencyRoots = Object.freeze(${JSON.stringify(t.dependencyRoots)});
|
|
124
|
-
const consumerResolutionPolicy = Object.freeze({
|
|
125
|
-
aliases: managedAliases,
|
|
126
|
-
dependencyRoots: managedDependencyRoots,
|
|
12
|
+
const { beforeEach, expect } = await import(${JSON.stringify(s(t).href)});
|
|
13
|
+
const { nodeVitestDataScenarioFile, selectNodeVitestRuntimeTask } = await import(${JSON.stringify(s(o).href)});
|
|
14
|
+
const { rmSync } = await import("node:fs");
|
|
15
|
+
const task = selectNodeVitestRuntimeTask(expect.getState().testPath);
|
|
16
|
+
process.env.TESTKIT_TEST_FILE = task.context.task.file;
|
|
17
|
+
process.env.TESTKIT_TEST_ID = task.taskId;
|
|
18
|
+
process.env.TESTKIT_DATA_ARTIFACT_DIR = task.dataDirectory;
|
|
19
|
+
beforeEach(({ task: test }) => {
|
|
20
|
+
rmSync(nodeVitestDataScenarioFile(task.dataDirectory, test.id), { force: true });
|
|
21
|
+
const starts = test.meta[${JSON.stringify(r)}] ?? [];
|
|
22
|
+
test.meta[${JSON.stringify(r)}] = [...starts, test.result?.errors?.length ?? 0];
|
|
127
23
|
});
|
|
128
|
-
|
|
129
|
-
function exactSpecifierPattern(specifier) {
|
|
130
|
-
return new RegExp("^" + specifier.replace(/[.*+?^\${}()|[\\]\\\\]/g, "\\\\$&") + "$");
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
export default {
|
|
134
|
-
plugins: [
|
|
135
|
-
{
|
|
136
|
-
enforce: "pre",
|
|
137
|
-
name: "testkit-node-vitest-managed-direct-packages",
|
|
138
|
-
async resolveId(specifier, importer, options) {
|
|
139
|
-
|
|
140
|
-
const managedImporter = isNodeVitestManagedDependencyImporter(
|
|
141
|
-
importer,
|
|
142
|
-
managedDependencyRoots,
|
|
143
|
-
);
|
|
144
|
-
if (specifier.startsWith("@vitest/") && !managedImporter)
|
|
145
|
-
throw new Error("Node/Vitest consumers may not import private Vitest package " + specifier.split("/", 2).join("/"));
|
|
146
|
-
const managedAlias = managedAliases[specifier];
|
|
147
|
-
if (managedAlias !== undefined) return assertNodeVitestConsumerResolution(
|
|
148
|
-
specifier, managedAlias, importer, consumerResolutionPolicy,
|
|
149
|
-
);
|
|
150
|
-
if (managedPackageNames.some(
|
|
151
|
-
(packageName) => specifier === packageName || specifier.startsWith(packageName + "/"),
|
|
152
|
-
))
|
|
153
|
-
throw new Error("Managed Node/Vitest package does not support runtime subpath " + specifier);
|
|
154
|
-
const resolved = await this.resolve(specifier, importer, {
|
|
155
|
-
...options,
|
|
156
|
-
skipSelf: true,
|
|
157
|
-
});
|
|
158
|
-
if (resolved === null) return null;
|
|
159
|
-
const id = assertNodeVitestConsumerResolution(
|
|
160
|
-
specifier,
|
|
161
|
-
resolved.id,
|
|
162
|
-
importer,
|
|
163
|
-
consumerResolutionPolicy,
|
|
164
|
-
);
|
|
165
|
-
return id === resolved.id ? resolved : { ...resolved, id };
|
|
166
|
-
},
|
|
167
|
-
},
|
|
168
|
-
${d}
|
|
169
|
-
],
|
|
170
|
-
root: ${JSON.stringify(e.rootDirectory)},
|
|
171
|
-
cacheDir: ${JSON.stringify(i.join(i.dirname(e.vitestConfigFile),"cache"))},
|
|
172
|
-
resolve: {
|
|
173
|
-
alias: Object.entries(managedAliases).map(([specifier, replacement]) => ({
|
|
174
|
-
find: exactSpecifierPattern(specifier),
|
|
175
|
-
replacement,
|
|
176
|
-
})),
|
|
177
|
-
},
|
|
178
|
-
test: {
|
|
179
|
-
${e.runtimeInput.expectedProfileId==="node-vitest-data"?`runner: ${JSON.stringify(f)},`:""}
|
|
180
|
-
// The installed SDK is compiled JavaScript. Use its native module instance
|
|
181
|
-
// for setup and consumer imports instead of transforming a second instance.
|
|
182
|
-
server: { deps: { external: ${JSON.stringify([e.entrypoints.config,...e.runtimeInput.expectedProfileId==="node-vitest-data"?[f,e.entrypoints.data]:[]].map(r=>r.replaceAll(i.sep,"/")))}.map(exactSpecifierPattern) } },
|
|
183
|
-
reporters: [[${JSON.stringify(S("node-vitest"))}, ${JSON.stringify(e.report)}]],
|
|
184
|
-
allowOnly: false,
|
|
185
|
-
disableConsoleIntercept: true,
|
|
186
|
-
environment: "node",
|
|
187
|
-
fileParallelism: false,
|
|
188
|
-
hookTimeout: ${e.timeoutMs.toString()},
|
|
189
|
-
include: [${JSON.stringify(toVitestIncludePattern(e.sourceFile))}],
|
|
190
|
-
isolate: true,
|
|
191
|
-
maxWorkers: 1,
|
|
192
|
-
minWorkers: 1,
|
|
193
|
-
passWithNoTests: false,
|
|
194
|
-
pool: "forks",
|
|
195
|
-
setupFiles: [${JSON.stringify(e.setupFile)}],
|
|
196
|
-
teardownTimeout: ${e.timeoutMs.toString()},
|
|
197
|
-
testTimeout: ${e.timeoutMs.toString()},
|
|
198
|
-
update: "none",
|
|
199
|
-
watch: false,
|
|
200
|
-
},
|
|
201
|
-
};
|
|
202
|
-
`}const h=new Set(["!","(",")","*","+","?","@","[","\\","]","{","}"]);export function toVitestIncludePattern(e){return Array.from(e.replaceAll(i.sep,"/"),t=>h.has(t)?`\\${t}`:t).join("")}
|
|
24
|
+
`}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import T from"node:path";import{fileURLToPath as m}from"node:url";import{isTypedTestFile as O}from"../../../domain/identifiers.js";import{isUnknownRecord as E}from"../../../kernel/unknown-values.js";import{managedHostProcessInfrastructureError as h,runManagedHostProcess as y}from"../../../process/index.js";import{NODE_VITEST_INVENTORY_MARKER as u,resolveRepositoryVitest as d}from"../selection.js";const R=m(new URL("../../../../dist/engines/node-vitest/inventory/list-files.js",import.meta.url)),j=6e4,v=m(new URL("../../../../",import.meta.url));export async function listPlainVitestFiles(n,e){const s=e.runner==="managed",i=s?d(v):d(n,e.runner==="auto");if(i===null)return[];const a=s?!1:e.config,l=`Vitest ${i.version} at ${i.root} listing test files${a?` for ${a}`:""}`,o=await y({args:[R,JSON.stringify({config:a,project:e.project,root:n,vitest:i})],cwd:n,displayLabel:l,env:s?Object.fromEntries(Object.entries(e.host).filter(([t])=>t!=="NODE_OPTIONS")):e.host,executable:process.execPath,timeoutMs:j}),p=h(l,o);if(p)throw p;const c=(o.exitCode===0?o.stdout.split(/\r?\n/u):[]).filter(t=>t.startsWith(u)).at(-1),f=c===void 0?null:JSON.parse(c.slice(u.length));if(!Array.isArray(f)||!f.every(t=>E(t)&&typeof t.file=="string"&&typeof t.project=="string"&&Array.isArray(t.setupFiles)&&t.setupFiles.every(r=>typeof r=="string"))){const t=s||e.config!==null||e.project!==null?"":`
|
|
2
|
+
Fix the error above, or pass --vitest-runner managed.`;throw new Error(`${l} failed with exit code ${String(o.exitCode)}: ${o.stderr.trim()}${t}`)}return f.map(({file:t,project:r,setupFiles:g})=>({file:t.split(T.sep).join("/"),project:r,setupFiles:g})).filter(({file:t})=>!O(t)).sort((t,r)=>t.file.localeCompare(r.file)||t.project.localeCompare(r.project))}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import p from"node:fs";import r from"node:path";import{importResolvedPackageEntrypoint as f}from"../../installations/package-resolution.js";import{NODE_VITEST_INVENTORY_MARKER as l}from"../selection.js";const t=JSON.parse(process.argv[2]??"");process.env.TEST="true",process.env.VITEST="true",process.env.NODE_ENV??="test";const{createVitest:m}=await f(t.vitest),s=await m("test",{config:t.config??void 0,watch:!1});try{const i=s.projects.map(({name:e})=>JSON.stringify(e));if(t.project!==null&&!i.includes(JSON.stringify(t.project)))throw new Error(`Vitest has no project named ${JSON.stringify(t.project)}; its projects are ${i.join(", ")}`);const n=p.realpathSync(t.root),c=(await s.globTestSpecifications()).filter(({project:e})=>t.project===null||e.name===t.project).map(({moduleId:e,project:o})=>({file:r.relative(n,e),project:o.name,setupFiles:o.config.setupFiles.map(a=>r.resolve(o.config.root,a))}));process.stdout.write(`
|
|
2
|
+
${l}${JSON.stringify(c)}
|
|
3
|
+
`)}finally{await s.close()}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export{renderDataFlowMarkdown}from"./report.js";export{dataFlow,measureJsonBytes,stableHash}from"./scenario.js";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import{stringFromUnknown as m}from"./primitives.js";import i from"node:fs";import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
`)
|
|
5
|
-
`)}function
|
|
6
|
-
`).trimEnd()}function _(t,n){if(t.push("### Evidence"),n.length===0){t.push(""),t.push("No structured data-flow evidence recorded."),t.push("");return}t.push(""),t.push("| Kind | Name | Status | Details |"),t.push("| --- | --- | --- | --- |");for(const e of n)t.push(`| ${a(e.kind)} | ${a(e.name)} | ${a(e.status||"")} | ${a(N(e.details))} |`);t.push("")}function b(t,n){if(t.push("### Metrics"),n.length===0){t.push(""),t.push("No metrics recorded."),t.push("");return}t.push(""),t.push("| Metric | Value | Unit | Kind |"),t.push("| --- | ---: | --- | --- |");for(const e of n)t.push(`| ${a(e.name)} | ${j(e.value)} | ${a(e.unit||"")} | ${a(e.kind||"")} |`);t.push("")}function w(t,n){if(t.push("### Sequences"),n.length===0){t.push(""),t.push("No sequences recorded."),t.push("");return}t.push(""),t.push("| Sequence | Values |"),t.push("| --- | --- |");for(const e of n)t.push(`| ${a(e.name)} | ${a(e.values.join(" -> "))} |`);t.push("")}function F(t,n){if(t.push("### Budgets"),n.length===0){t.push(""),t.push("No budgets declared."),t.push("");return}t.push("");for(const e of n)t.push(`- ${e.status.toUpperCase()} ${e.name}: ${e.message}`);t.push("")}function I(t,n){if(t.push("### Findings"),n.length===0){t.push(""),t.push("No findings recorded."),t.push("");return}t.push("");for(const e of n)t.push(`- ${e.severity.toUpperCase()}: ${e.message}`);t.push("")}function N(t){const n=Object.entries(t||{}).filter(([e])=>e!=="status").slice(0,6);return n.length===0?"":n.map(([e,s])=>`${e}: ${k(s)}`).join(", ")}function k(t){return t==null?"":typeof t=="string"||typeof t=="number"||typeof t=="boolean"?String(t):JSON.stringify(t)}function O(t){const n={info:0,watch:0,waste:0,error:0};for(const e of t)n[e.severity]+=1;return n}function a(t){return m(t??"").replaceAll("|","\\|").replace(/\s+/gu," ").trim()}function j(t){return Number.isInteger(t)?String(t):String(Number(t.toFixed(4)))}
|
|
1
|
+
import{stringFromUnknown as m}from"./primitives.js";import i from"node:fs";import h from"node:path";import{NODE_VITEST_DATA_BUDGET_FAILURE_DETAIL_KIND as g,NODE_VITEST_DATA_FAILURE_DETAILS_ARTIFACT_KIND as l,NODE_VITEST_DATA_FAILURE_DETAILS_ARTIFACT_NAME as $,nodeVitestDataScenarioFile as S}from"../runtime-input.js";import{DATA_ARTIFACT_KIND as p,DATA_REPORT_KIND as T,DATA_SCHEMA_VERSION as y}from"./types.js";import{isUnknownArray as A,isUnknownRecord as D}from"../../../../kernel/unknown-values.js";export function writeDataFlowScenario(t,n,e){const r=process.env.TESTKIT_DATA_ARTIFACT_DIR;if(!r)return;const u=S(r,t);i.mkdirSync(h.dirname(u),{recursive:!0}),i.writeFileSync(`${u}.tmp`,JSON.stringify({...n,scenario:e})),i.renameSync(`${u}.tmp`,u)}export function dataFlowArtifacts(t,n,e){const r=_(t,n,e),u=E(r),a=u?.failures.length??0;return[{contentType:"application/json",contents:`${JSON.stringify(r,null,2)}
|
|
2
|
+
`,kind:p,name:"data-flow",summary:r.summaryText},{contentType:"text/markdown",contents:`${renderDataFlowMarkdown(r)}
|
|
3
|
+
`,kind:T,name:"data-flow-report",summary:r.summaryText},...u===null?[]:[{contentType:"application/json",contents:`${JSON.stringify(u,null,2)}
|
|
4
|
+
`,kind:l,name:$,summary:`${String(a)} failed data-flow budget${a===1?"":"s"}`}]]}function E(t){const n=t.scenarios.flatMap(e=>e.budgetFailures.map(r=>{const u=`${r.target} budget "${r.name}" (${r.operator})`;return{actual:c(r.actual,`${e.name} ${r.name} actual value`),checkName:r.name,count:1,expected:c(r.expected,`${e.name} ${r.name} expected value`),groupPath:[e.name],key:`${e.name} > ${u}`,kind:g,location:e.location,message:r.message,title:u}}));return n.length===0?null:{failures:n,phase:"exec"}}function c(t,n){let e;try{e=JSON.stringify(t)}catch(u){throw new TypeError(`${n} must be JSON-serializable`,{cause:u})}const r=JSON.parse(e);if(!N(r))throw new TypeError(`${n} must be a finite JSON value`);return r}function N(t){const n=[t];for(;n.length>0;){const e=n.pop();if(!(e===null||typeof e=="boolean"||typeof e=="string")){if(typeof e=="number"){if(!Number.isFinite(e))return!1;continue}if(A(e)){n.push(...e);continue}if(!D(e))return!1;n.push(...Object.values(e))}}return!0}function _(t,n,e){const r=t.filter(o=>o.status==="failed").length,u=t.reduce((o,d)=>o+d.budgetFailures.length,0),a=x(t.flatMap(o=>o.findings)),f=`${String(t.length-r)}/${String(t.length)} data scenario(s) passed, ${String(u)} budget failure(s)`;return{schemaVersion:y,kind:p,generatedAt:new Date().toISOString(),file:n,taskId:e,summary:{budgetFailures:u,failed:r,findingCounts:a,passed:t.length-r,scenarios:t.length,status:r>0?"failed":"passed"},summaryText:f,scenarios:t}}export function renderDataFlowMarkdown(t){const n=[];n.push("# Data Flow Report"),n.push(""),n.push(`Status: ${t.summary.status}`),n.push(`Scenarios: ${String(t.summary.passed)}/${String(t.summary.scenarios)} passed`),n.push(`Budget failures: ${String(t.summary.budgetFailures)}`),n.push("");for(const e of t.scenarios)n.push(`## ${e.name}`),n.push(""),n.push(`Status: ${e.status}`),n.push(`Duration: ${String(e.durationMs)}ms`),e.error?.message&&n.push(`Error: ${e.error.message}`),n.push(""),w(n,e.metrics),F(n,e.sequences),b(n,e.evidence),I(n,e.budgets),O(n,e.findings);return n.join(`
|
|
5
|
+
`).trimEnd()}function b(t,n){if(t.push("### Evidence"),n.length===0){t.push(""),t.push("No structured data-flow evidence recorded."),t.push("");return}t.push(""),t.push("| Kind | Name | Status | Details |"),t.push("| --- | --- | --- | --- |");for(const e of n)t.push(`| ${s(e.kind)} | ${s(e.name)} | ${s(e.status||"")} | ${s(k(e.details))} |`);t.push("")}function w(t,n){if(t.push("### Metrics"),n.length===0){t.push(""),t.push("No metrics recorded."),t.push("");return}t.push(""),t.push("| Metric | Value | Unit | Kind |"),t.push("| --- | ---: | --- | --- |");for(const e of n)t.push(`| ${s(e.name)} | ${V(e.value)} | ${s(e.unit||"")} | ${s(e.kind||"")} |`);t.push("")}function F(t,n){if(t.push("### Sequences"),n.length===0){t.push(""),t.push("No sequences recorded."),t.push("");return}t.push(""),t.push("| Sequence | Values |"),t.push("| --- | --- |");for(const e of n)t.push(`| ${s(e.name)} | ${s(e.values.join(" -> "))} |`);t.push("")}function I(t,n){if(t.push("### Budgets"),n.length===0){t.push(""),t.push("No budgets declared."),t.push("");return}t.push("");for(const e of n)t.push(`- ${e.status.toUpperCase()} ${e.name}: ${e.message}`);t.push("")}function O(t,n){if(t.push("### Findings"),n.length===0){t.push(""),t.push("No findings recorded."),t.push("");return}t.push("");for(const e of n)t.push(`- ${e.severity.toUpperCase()}: ${e.message}`);t.push("")}function k(t){const n=Object.entries(t||{}).filter(([e])=>e!=="status").slice(0,6);return n.length===0?"":n.map(([e,r])=>`${e}: ${R(r)}`).join(", ")}function R(t){return t==null?"":typeof t=="string"||typeof t=="number"||typeof t=="boolean"?String(t):JSON.stringify(t)}function x(t){const n={info:0,watch:0,waste:0,error:0};for(const e of t)n[e.severity]+=1;return n}function s(t){return m(t??"").replaceAll("|","\\|").replace(/\s+/gu," ").trim()}function V(t){return Number.isInteger(t)?String(t):String(Number(t.toFixed(4)))}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{stringFromUnknown as g}from"./primitives.js";import
|
|
2
|
-
`)}function
|
|
1
|
+
import{stringFromUnknown as g}from"./primitives.js";import B from"node:crypto";import{writeDataFlowScenario as M}from"./report.js";import{isUnknownArray as z,isUnknownRecord as p}from"../../../../kernel/unknown-values.js";const A=/(authorization|cookie|password|secret|token|api[_-]?key|private[_-]?key)/iu,$=String,y=new WeakMap;export function dataFlow(e){return E(e)}function E(e){const t=e?.task;if(t?.result===void 0||t.result.duration!==void 0||e?.onTestFinished===void 0)throw new Error("dataFlow(context) needs the context of a running Vitest test: test(name, (context) => { dataFlow(context); })");const r=y.get(e);if(r!==void 0)return r;const n=D(F(t),{path:process.env.TESTKIT_TEST_FILE??t.file.name,...t.location}),s=T(n);return y.set(e,s),e.onTestFinished(()=>{if(y.delete(e),t.result?.state==="skip")return;const i=N(n,t.result),a={attempt:(t.result?.retryCount??0)+1,repeat:t.result?.repeatCount??0,repeats:t.repeats??0};if(M(t.id,a,i),i.budgetFailures.length>0)throw new Error(R(i))}),s}function F(e){const t=[e.name];for(let r=e.suite;r!==void 0&&r!==e.file;r=r.suite)t.unshift(r.name);return t.join(" ")}export function measureJsonBytes(e){return Buffer.byteLength(JSON.stringify(e??null))}export function stableHash(e){const t=x(e);if(t===void 0)throw new TypeError("stableHash(...) requires a serializable value");return B.createHash("sha256").update(t).digest("hex")}function T(e){const t={addFinding(r,n,s={}){return e.findings.push({severity:J(r),message:o(n,"finding message"),details:l(s)}),t},actor(r,n={}){return d(e,"actor",r,n),t},budget(r){return S(e,r)},bytes(r,n,s={}){return t.metric(r,n,{...s,kind:"bytes",unit:s.unit||"bytes"})},count(r,n=1,s={}){return t.metric(r,n,{...s,kind:"count",unit:s.unit||"count"})},duration(r,n,s={}){return t.metric(r,n,{...s,kind:"duration",unit:s.unit||"ms"})},event(r,n={}){return e.events.push({atMs:Date.now()-e.startedAtMs,name:o(r,"event name"),details:l(n)}),t},externalCall(r,n={}){const s=h(n);return d(e,"external-call",r,s),typeof s.durationMs=="number"&&t.duration(`${r}.external.duration`,s.durationMs),typeof s.requestBytes=="number"&&t.bytes(`${r}.external.request.bytes`,s.requestBytes),typeof s.responseBytes=="number"&&t.bytes(`${r}.external.response.bytes`,s.responseBytes),typeof s.costMinor=="number"&&t.money(`${r}.external.cost`,s.costMinor),t},expectMetric(r){return S(e,r)},expectSequence(r){return k(e,r)},finding(r,n,s={}){return t.addFinding(r,n,s)},metric(r,n,s={}){return O(e,r,n,s),t},money(r,n,s={}){return t.metric(r,n,{...s,kind:"money",unit:s.unit||"minor"})},ratio(r,n,s={}){return t.metric(r,n,{...s,kind:"ratio",unit:s.unit||"ratio"})},reconcile(r,n={}){return d(e,"reconciliation",r,n),t},record(r,n={}){const s=h(n);return d(e,"record",r,s),typeof s.count=="number"&&t.count(`${r}.record.count`,s.count),t},recordCache(r,{hits:n=0,misses:s=0,reads:i=0,writes:a=0}={}){const c=o(r,"cache metric name");t.count(`${c}.cache.hits`,n),t.count(`${c}.cache.misses`,s),t.count(`${c}.cache.reads`,i),t.count(`${c}.cache.writes`,a);const m=n+s;return m>0&&t.ratio(`${c}.cache.hit_rate`,n/m),t},recordHttpRequest(r){return t.count("http.request.count",1),t.bytes("http.request.bytes",r.bodyBytes||0),t.bytes("http.response.bytes",r.responseBytes||0),t.duration("http.request.duration",r.durationMs||0),t.sequence("http.methods",[r.method]),t.sequence("http.paths",[r.path]),t.event("http.request",{durationMs:r.durationMs||0,method:r.method,path:r.path,requestBytes:r.bodyBytes||0,responseBytes:r.responseBytes||0,status:r.status}),t},recordLlmUsage(r,n={}){const s=o(r,"llm usage name");for(const[i,a]of Object.entries(n))typeof a=="number"&&Number.isFinite(a)&&t.count(`${s}.${I(i)}`,a,{unit:i.toLowerCase().includes("cost")?"minor":"tokens"});return t},recordRpc(r,{method:n,requestBytes:s=0,responseBytes:i=0}={}){const a=o(r,"rpc metric name");return t.count(`${a}.rpc.count`,1),n&&t.sequence(`${a}.rpc.methods`,[n]),t.bytes(`${a}.rpc.request.bytes`,s),t.bytes(`${a}.rpc.response.bytes`,i),t},sequence(r,n,s={}){return v(e,r,n,s),t},sequenceBudget(r){return k(e,r)},system(r,n={}){return d(e,"system",r,n),t},transition(r,n={}){return d(e,"transition",r,n),t}};return Object.freeze(t)}function S(e,t){const r=o(t,"metric budget name");return{atLeast(n,s={}){return u(e,{name:r,target:"metric",operator:">=",expected:n,message:s.message}),this},atMost(n,s={}){return u(e,{name:r,target:"metric",operator:"<=",expected:n,message:s.message}),this},equals(n,s={}){return u(e,{name:r,target:"metric",operator:"==",expected:n,message:s.message}),this},greaterThan(n,s={}){return u(e,{name:r,target:"metric",operator:">",expected:n,message:s.message}),this},lessThan(n,s={}){return u(e,{name:r,target:"metric",operator:"<",expected:n,message:s.message}),this},required(n={}){return u(e,{name:r,target:"metric",operator:"exists",message:n.message}),this}}}function k(e,t){const r=o(t,"sequence budget name");return{equals(n,s={}){return u(e,{name:r,target:"sequence",operator:"sequence==",expected:w(n),message:s.message}),this},includesOnly(n,s={}){return u(e,{name:r,target:"sequence",operator:"sequenceOnly",expected:w(n),message:s.message}),this},required(n={}){return u(e,{name:r,target:"sequence",operator:"exists",message:n.message}),this}}}function D(e,t){return{budgets:[],events:[],evidence:[],findings:[],location:t,metrics:[],name:o(e,"data scenario name"),sequences:[],startedAtMs:Date.now()}}function N(e,t){const{budgets:r,startedAtMs:n,...s}=e,i=r.map(m=>V(e,m)),a=i.filter(m=>m.status==="failed"),c=t?.state==="fail"?U(t.errors?.at(-1)):null;return{...s,budgetFailures:a,budgets:i,durationMs:Date.now()-n,error:c,status:c||a.length>0?"failed":"passed"}}function O(e,t,r,n={}){const s=r;if(!Number.isFinite(s))throw new Error(`Data metric "${t}" must be a finite number`);e.metrics.push({description:f(n.description),dimensions:b(n.dimensions??{}),kind:f(n.kind)||"metric",name:o(t,"metric name"),unit:f(n.unit),value:s})}function v(e,t,r,n={}){const s=w(r).map(i=>$(i));e.sequences.push({description:f(n.description),dimensions:b(n.dimensions??{}),name:o(t,"sequence name"),values:s})}function u(e,t){e.budgets.push({...t,message:f(t.message)})}function d(e,t,r,n={}){const s=h(n);e.evidence.push({atMs:Date.now()-e.startedAtMs,details:l(s),kind:t,name:o(r,`${t} evidence name`),status:f(s.status)||null})}function h(e){return p(e)?e:{value:e}}function V(e,t){const r=t.target==="sequence"?C(e,t.name):j(e,t.name),n=_(t,r),s=t.message||L(t,r,n);return t.target==="metric"?{...t,actual:r,expected:t.expected??null,message:s,status:n?"passed":"failed"}:{...t,actual:r,expected:t.expected??null,message:s,status:n?"passed":"failed"}}function _(e,t){if(e.target==="metric")return e.operator==="exists"?t!==null:typeof t!="number"?!1:e.operator==="<="?t<=Number(e.expected):e.operator===">="?t>=Number(e.expected):e.operator==="<"?t<Number(e.expected):e.operator===">"?t>Number(e.expected):Object.is(t,Number(e.expected));if(e.operator==="exists")return t!==null;if(!Array.isArray(t))return!1;if(e.operator==="sequence==")return H(t,e.expected);const r=new Set((e.expected??[]).map(n=>g(n)));return t.every(n=>r.has(n))}function j(e,t){for(let r=e.metrics.length-1;r>=0;r-=1)if(e.metrics[r].name===t)return e.metrics[r].value;return null}function C(e,t){const r=[];for(const n of e.sequences)n.name===t&&r.push(...n.values);return r.length>0?r:null}function L(e,t,r){return e.operator==="exists"?r?`${e.target} "${e.name}" was recorded`:`${e.target} "${e.name}" was not recorded`:`${e.target} "${e.name}" expected ${e.operator} ${JSON.stringify(e.expected)}, got ${JSON.stringify(t)}`}function R(e){return[`Data-flow budgets failed in "${e.name}":`,...e.budgetFailures.map(t=>`- ${t.message}`)].join(`
|
|
2
|
+
`)}function w(e){return z(e)?[...e]:[e]}function o(e,t){const r=g(e).trim();if(!r)throw new Error(`${t} must be a non-empty string`);return r}function f(e){if(e==null)return null;const t=g(e).trim();return t||null}function J(e){const t=g(e||"info").toLowerCase();return K(t)?t:"info"}function l(e){if(Array.isArray(e))return e.map(r=>l(r));if(!p(e))return e;const t={};for(const[r,n]of Object.entries(e))t[r]=A.test(r)?"[redacted]":l(n);return t}function U(e){return e instanceof Error?{message:e.message,name:e.name,stack:e.stack??null}:{message:q(e,"message")??P(e),name:q(e,"name")??"Error",stack:q(e,"stack")}}function x(e){return Array.isArray(e)?`[${e.map(t=>x(t)).join(",")}]`:p(e)?`{${Object.keys(e).sort().map(t=>{const r=x(e[t]);return`${JSON.stringify(t)}:${r??"undefined"}`}).join(",")}}`:JSON.stringify(e)}function H(e,t){return!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length?!1:e.every((r,n)=>String(r)===String(t[n]))}function I(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/[^a-zA-Z0-9]+/g,"_").replace(/^_+|_+$/g,"").toLowerCase()}function b(e){const t=l(e);return p(t)?t:{}}function q(e,t){if(!p(e))return null;try{const r=Reflect.get(e,t);return typeof r=="string"?r:null}catch{return null}}function P(e){try{return $(e)}catch{return"Unknown thrown value"}}function K(e){return e==="error"||e==="info"||e==="waste"||e==="watch"}
|