mootant 0.1.0 → 0.3.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/bin/mootant.js +3 -2
- package/dist/adapters/jest/build-dry-file.d.ts +12 -12
- package/dist/adapters/jest/collect-jest-dependencies.d.ts +15 -12
- package/dist/adapters/jest/collect-jest-dependencies.js +20 -14
- package/dist/adapters/jest/get-jest-cache-inputs.d.ts +14 -13
- package/dist/adapters/jest/index.d.ts +3 -1
- package/dist/adapters/jest/run-dry.js +20 -20
- package/dist/adapters/jest/runner.d.ts +1 -1
- package/dist/adapters/jest/runner.js +1 -1
- package/dist/adapters/jest/start-jest-session.d.ts +6 -2
- package/dist/adapters/jest/start-jest-session.js +9 -2
- package/dist/adapters/jest/types/jest-handle.d.ts +2 -1
- package/dist/adapters/jest/types/jest-record.d.ts +5 -4
- package/dist/adapters/jest/types/unit-worker.d.ts +16 -8
- package/dist/adapters/jest/types/worker-channel.d.ts +7 -0
- package/dist/adapters/jest/types/worker-session.d.ts +6 -7
- package/dist/adapters/jest/worker/boot-worker.d.ts +5 -3
- package/dist/adapters/jest/worker/create-test-runner.d.ts +4 -1
- package/dist/adapters/jest/worker/keep-reset-loads.d.ts +13 -0
- package/dist/adapters/jest/worker/list-runtime-files.d.ts +13 -0
- package/dist/adapters/jest/worker/run-unit.d.ts +24 -17
- package/dist/adapters/jest/worker/vm-setup.js +1 -1
- package/dist/adapters/jest/worker/worker.js +1 -1
- package/dist/adapters/jest/write-worker-session.d.ts +1 -2
- package/dist/adapters/jest/write-worker-session.js +2 -2
- package/dist/adapters/node-test/check-typescript.js +2 -2
- package/dist/adapters/node-test/collect-node-dependencies.d.ts +7 -5
- package/dist/adapters/node-test/collect-node-dependencies.js +26 -20
- package/dist/adapters/node-test/create-spare-processes.d.ts +26 -0
- package/dist/adapters/node-test/create-spare-processes.js +53 -0
- package/dist/adapters/node-test/filter-exec-argv.d.ts +2 -1
- package/dist/adapters/node-test/filter-exec-argv.js +13 -12
- package/dist/adapters/node-test/get-node-cache-inputs.js +1 -1
- package/dist/adapters/node-test/get-unit-deadline.d.ts +6 -5
- package/dist/adapters/node-test/index.d.ts +2 -2
- package/dist/adapters/node-test/index.js +1 -0
- package/dist/adapters/node-test/is-group-alive.d.ts +8 -0
- package/dist/adapters/node-test/is-group-alive.js +8 -0
- package/dist/adapters/node-test/list-setup-files.js +2 -2
- package/dist/adapters/node-test/place-preload.d.ts +2 -1
- package/dist/adapters/node-test/place-preload.js +24 -18
- package/dist/adapters/node-test/preload/create-commonjs-route.js +1 -1
- package/dist/adapters/node-test/preload/preload.js +54 -49
- package/dist/adapters/node-test/preload/read-line-sync.d.ts +11 -0
- package/dist/adapters/node-test/preload/read-line-sync.js +25 -0
- package/dist/adapters/node-test/preload/read-unit.d.ts +11 -5
- package/dist/adapters/node-test/preload/read-unit.js +5 -4
- package/dist/adapters/node-test/run-isolated.d.ts +19 -10
- package/dist/adapters/node-test/run-isolated.js +68 -52
- package/dist/adapters/node-test/run-test-file.d.ts +12 -4
- package/dist/adapters/node-test/run-test-file.js +19 -14
- package/dist/adapters/node-test/run-test-process.d.ts +30 -13
- package/dist/adapters/node-test/run-test-process.js +38 -40
- package/dist/adapters/node-test/start-node-test-session.d.ts +10 -2
- package/dist/adapters/node-test/start-node-test-session.js +90 -84
- package/dist/adapters/node-test/start-test-process.d.ts +30 -0
- package/dist/adapters/node-test/start-test-process.js +27 -0
- package/dist/adapters/node-test/types/node-test-handle.d.ts +14 -1
- package/dist/adapters/node-test/types/node-test-record.d.ts +3 -3
- package/dist/adapters/node-test/types/node-test-unit.d.ts +6 -1
- package/dist/adapters/node-test/types/process-watch.d.ts +4 -3
- package/dist/adapters/node-test/types/spare-processes.d.ts +20 -0
- package/dist/adapters/node-test/types/test-process-outcome.d.ts +8 -1
- package/dist/adapters/shared/allows-spares.d.ts +11 -0
- package/dist/adapters/shared/allows-spares.js +23 -0
- package/dist/adapters/shared/create-environment-proxy.d.ts +4 -3
- package/dist/adapters/shared/create-input-filter.d.ts +29 -0
- package/dist/adapters/shared/create-input-filter.js +32 -0
- package/dist/adapters/shared/enable-compile-cache.d.ts +32 -0
- package/dist/adapters/shared/enable-compile-cache.js +7 -0
- package/dist/adapters/shared/find-tsconfig-property.d.ts +13 -0
- package/dist/adapters/shared/find-tsconfig-property.js +6 -0
- package/dist/adapters/shared/get-spare-limit.d.ts +10 -0
- package/dist/adapters/shared/get-spare-limit.js +5 -0
- package/dist/adapters/shared/index-environment-hashes.d.ts +2 -2
- package/dist/adapters/shared/index-environment-hashes.js +5 -13
- package/dist/adapters/{node-test → shared}/list-flag-values.d.ts +2 -1
- package/dist/adapters/shared/list-flag-values.js +10 -0
- package/dist/adapters/shared/list-tsconfig-files.d.ts +14 -5
- package/dist/adapters/shared/list-tsconfig-files.js +15 -13
- package/dist/adapters/shared/parse-tsconfig.d.ts +10 -0
- package/dist/adapters/shared/parse-tsconfig.js +19 -0
- package/dist/adapters/shared/read-flag-name.d.ts +9 -0
- package/dist/adapters/shared/read-flag-name.js +5 -0
- package/dist/adapters/shared/read-node-options.d.ts +11 -0
- package/dist/adapters/shared/read-node-options.js +6 -0
- package/dist/adapters/shared/read-prefork-switch.d.ts +10 -0
- package/dist/adapters/shared/read-prefork-switch.js +5 -0
- package/dist/adapters/shared/read-tsconfig-extends.d.ts +2 -5
- package/dist/adapters/shared/read-tsconfig-extends.js +16 -31
- package/dist/adapters/shared/read-tsconfig-references.d.ts +12 -0
- package/dist/adapters/shared/read-tsconfig-references.js +13 -0
- package/dist/adapters/shared/track-file-inputs.d.ts +7 -3
- package/dist/adapters/shared/track-file-inputs.js +16 -7
- package/dist/adapters/shared/track-file-reads.d.ts +13 -8
- package/dist/adapters/shared/track-file-reads.js +122 -69
- package/dist/adapters/shared/track-inputs.d.ts +13 -6
- package/dist/adapters/shared/track-inputs.js +7 -7
- package/dist/adapters/shared/track-process-group.d.ts +2 -1
- package/dist/adapters/shared/track-process-group.js +7 -2
- package/dist/adapters/shared/types/file-input-tracking.d.ts +6 -0
- package/dist/adapters/shared/types/input-tracking.d.ts +3 -3
- package/dist/adapters/vitest/build-isolated-facts.d.ts +4 -3
- package/dist/adapters/vitest/collect-dependencies.d.ts +10 -3
- package/dist/adapters/vitest/collect-dependencies.js +36 -26
- package/dist/adapters/vitest/configure-project.d.ts +3 -2
- package/dist/adapters/vitest/configure-project.js +1 -1
- package/dist/adapters/vitest/create-forks-pool.d.ts +34 -7
- package/dist/adapters/vitest/create-forks-pool.js +102 -24
- package/dist/adapters/vitest/create-interleaved-sequencer.d.ts +3 -2
- package/dist/adapters/vitest/drop-signal-listeners.d.ts +14 -0
- package/dist/adapters/vitest/drop-signal-listeners.js +15 -0
- package/dist/adapters/vitest/get-cache-inputs.d.ts +3 -1
- package/dist/adapters/vitest/get-cache-inputs.js +46 -29
- package/dist/adapters/vitest/get-module-file.d.ts +3 -5
- package/dist/adapters/vitest/get-module-file.js +1 -1
- package/dist/adapters/vitest/get-spare-key.d.ts +15 -0
- package/dist/adapters/vitest/get-spare-key.js +15 -0
- package/dist/adapters/vitest/index.d.ts +2 -1
- package/dist/adapters/vitest/index.js +1 -0
- package/dist/adapters/vitest/is-virtual-module.d.ts +10 -0
- package/dist/adapters/vitest/is-virtual-module.js +8 -0
- package/dist/adapters/vitest/list-script-defines.d.ts +13 -0
- package/dist/adapters/vitest/list-script-defines.js +22 -0
- package/dist/adapters/vitest/read-out-files.d.ts +7 -2
- package/dist/adapters/vitest/read-out-files.js +5 -5
- package/dist/adapters/vitest/read-out-records.d.ts +17 -0
- package/dist/adapters/vitest/read-out-records.js +27 -0
- package/dist/adapters/vitest/read-strays.d.ts +20 -0
- package/dist/adapters/vitest/read-strays.js +53 -0
- package/dist/adapters/vitest/read-unit-inputs.d.ts +9 -2
- package/dist/adapters/vitest/read-unit-inputs.js +1 -1
- package/dist/adapters/vitest/run-dry.js +17 -17
- package/dist/adapters/vitest/run-plan.d.ts +10 -6
- package/dist/adapters/vitest/run-plan.js +16 -16
- package/dist/adapters/vitest/run-specifications.d.ts +11 -3
- package/dist/adapters/vitest/run-specifications.js +22 -12
- package/dist/adapters/vitest/runner.d.ts +92 -46
- package/dist/adapters/vitest/runner.js +126 -104
- package/dist/adapters/vitest/start-vitest-session.d.ts +5 -1
- package/dist/adapters/vitest/start-vitest-session.js +64 -59
- package/dist/adapters/vitest/stop-hung-worker.d.ts +11 -4
- package/dist/adapters/vitest/stop-hung-worker.js +20 -7
- package/dist/adapters/vitest/types/mootant-forks-pool.d.ts +47 -0
- package/dist/adapters/vitest/types/stray-decisions.d.ts +8 -0
- package/dist/adapters/vitest/types/unit-outcome.d.ts +2 -1
- package/dist/adapters/vitest/types/vitest-session-state.d.ts +9 -8
- package/dist/adapters/vitest/types/vitest-worker.d.ts +118 -32
- package/dist/adapters/vitest/wait-for-workers.d.ts +5 -2
- package/dist/adapters/vitest/wait-for-workers.js +15 -15
- package/dist/adapters/vitest/worker/encode-stray.d.ts +16 -0
- package/dist/adapters/vitest/worker/encode-stray.js +16 -0
- package/dist/adapters/vitest/worker/intercept-strays.d.ts +26 -0
- package/dist/adapters/vitest/worker/intercept-strays.js +13 -0
- package/dist/adapters/vitest/worker/read-try-facts.d.ts +5 -4
- package/dist/adapters/vitest/worker/track-meta-defines.d.ts +39 -0
- package/dist/adapters/vitest/worker/track-meta-defines.js +23 -0
- package/dist/adapters/vitest/worker/track-values.d.ts +38 -0
- package/dist/adapters/vitest/worker/track-values.js +45 -0
- package/dist/adapters/vitest/worker/value-prefixes.d.ts +12 -0
- package/dist/adapters/vitest/worker/value-prefixes.js +6 -0
- package/dist/adapters/vitest/worker/wait-for-turn.d.ts +8 -6
- package/dist/adapters/vitest/worker/watch-property.d.ts +17 -0
- package/dist/adapters/vitest/worker/watch-property.js +27 -0
- package/dist/adapters/vitest/worker/write-out-record.d.ts +2 -2
- package/dist/cli/create-run-progress.d.ts +8 -1
- package/dist/cli/create-run-progress.js +4 -1
- package/dist/cli/ensure-exit.d.ts +11 -0
- package/dist/cli/ensure-exit.js +15 -0
- package/dist/cli/html/build-html-report.js +2 -1
- package/dist/cli/html/client/main.js +1 -1
- package/dist/cli/html/client/render-change.d.ts +3 -2
- package/dist/cli/html/client/render-code.d.ts +1 -1
- package/dist/cli/html/client/render-overview.d.ts +3 -3
- package/dist/cli/html/pack-replacement.d.ts +1 -1
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +3 -2
- package/dist/cli/parse-arguments.d.ts +4 -0
- package/dist/cli/parse-arguments.js +4 -1
- package/dist/cli/report/build-list-report.js +1 -1
- package/dist/cli/report/build-run-report.js +2 -1
- package/dist/cli/report/format-command.d.ts +5 -0
- package/dist/cli/report/format-command.js +1 -1
- package/dist/cli/report/format-file-groups.d.ts +1 -1
- package/dist/cli/report/format-run-text-report.d.ts +5 -4
- package/dist/cli/report/format-run-text-report.js +10 -10
- package/dist/cli/report/slim-run-report.d.ts +10 -10
- package/dist/cli/report/slim-run-report.js +1 -0
- package/dist/cli/run-mutation.d.ts +5 -1
- package/dist/cli/run-mutation.js +55 -47
- package/dist/cli/terminal/create-spinner.d.ts +2 -3
- package/dist/cli/terminal/create-spinner.js +23 -32
- package/dist/cli/terminal/get-text-style.js +4 -4
- package/dist/cli/watch-interrupts.d.ts +41 -0
- package/dist/cli/watch-interrupts.js +32 -0
- package/dist/core/cache/apply-cached-units.d.ts +8 -7
- package/dist/core/cache/build-hash.d.ts +9 -0
- package/dist/core/cache/build-hash.js +2 -0
- package/dist/core/cache/cache-version.d.ts +4 -4
- package/dist/core/cache/check-dry-snapshot.d.ts +25 -0
- package/dist/core/cache/check-dry-snapshot.js +13 -0
- package/dist/core/cache/create-dry-reuse-miss.d.ts +12 -0
- package/dist/core/cache/create-dry-reuse-miss.js +7 -0
- package/dist/core/cache/create-dry-snapshot.d.ts +71 -0
- package/dist/core/cache/create-dry-snapshot.js +27 -0
- package/dist/core/cache/create-run-cache.d.ts +20 -2
- package/dist/core/cache/create-run-cache.js +31 -22
- package/dist/core/cache/create-snapshot-session.d.ts +12 -0
- package/dist/core/cache/create-snapshot-session.js +19 -0
- package/dist/core/cache/get-build-id.d.ts +11 -0
- package/dist/core/cache/get-build-id.js +7 -0
- package/dist/core/cache/get-cache-path.d.ts +1 -1
- package/dist/core/cache/get-cache-path.js +1 -1
- package/dist/core/cache/get-dry-snapshot-key.d.ts +47 -0
- package/dist/core/cache/get-dry-snapshot-key.js +43 -0
- package/dist/core/cache/get-dry-snapshot-path.d.ts +9 -0
- package/dist/core/cache/get-dry-snapshot-path.js +5 -0
- package/dist/core/cache/get-environment-key.d.ts +9 -4
- package/dist/core/cache/get-environment-key.js +5 -4
- package/dist/core/cache/get-test-file-keys.d.ts +2 -1
- package/dist/core/cache/get-test-file-keys.js +11 -10
- package/dist/core/cache/hash-files.d.ts +11 -6
- package/dist/core/cache/hash-files.js +22 -17
- package/dist/core/cache/hash-project-tree.d.ts +22 -0
- package/dist/core/cache/hash-project-tree.js +69 -0
- package/dist/core/cache/is-dry-reuse-miss.d.ts +8 -0
- package/dist/core/cache/is-dry-reuse-miss.js +4 -0
- package/dist/core/cache/list-file-hashes.d.ts +4 -0
- package/dist/core/cache/list-file-hashes.js +5 -2
- package/dist/core/cache/list-install-states.d.ts +12 -0
- package/dist/core/cache/list-install-states.js +19 -0
- package/dist/core/cache/list-variable-hashes.d.ts +15 -0
- package/dist/core/cache/list-variable-hashes.js +14 -0
- package/dist/core/cache/prepare-run-cache.d.ts +64 -16
- package/dist/core/cache/prepare-run-cache.js +109 -62
- package/dist/core/cache/read-dry-snapshot.d.ts +10 -0
- package/dist/core/cache/read-dry-snapshot.js +15 -0
- package/dist/core/cache/read-run-cache.js +6 -2
- package/dist/core/cache/save-dry-snapshot.d.ts +34 -0
- package/dist/core/cache/save-dry-snapshot.js +32 -0
- package/dist/core/cache/save-run-cache.d.ts +8 -7
- package/dist/core/cache/save-run-cache.js +2 -1
- package/dist/core/cache/unknown-hash.d.ts +7 -0
- package/dist/core/cache/unknown-hash.js +2 -0
- package/dist/core/cache/volatile-variables.d.ts +7 -0
- package/dist/core/cache/volatile-variables.js +11 -0
- package/dist/core/cache/write-run-cache.js +1 -1
- package/dist/core/config/load-typescript-config.d.ts +6 -1
- package/dist/core/config/load-typescript-config.js +26 -10
- package/dist/core/config/prepare-run.d.ts +7 -3
- package/dist/core/config/prepare-run.js +1 -0
- package/dist/core/config/resolve-run-settings.d.ts +3 -2
- package/dist/core/config/resolve-run-settings.js +1 -0
- package/dist/core/config/validate-config.js +3 -2
- package/dist/core/files/get-package-manifest.d.ts +12 -0
- package/dist/core/files/get-package-manifest.js +7 -0
- package/dist/core/files/select-changed-mutants.d.ts +11 -6
- package/dist/core/files/select-changed-mutants.js +38 -13
- package/dist/core/generate/apply-solitary-rule.d.ts +8 -5
- package/dist/core/generate/apply-solitary-rule.js +36 -29
- package/dist/core/generate/collect-candidates.d.ts +23 -5
- package/dist/core/generate/collect-candidates.js +202 -92
- package/dist/core/generate/compare-targets.d.ts +14 -0
- package/dist/core/generate/compare-targets.js +6 -0
- package/dist/core/generate/deduplicate-candidates.d.ts +6 -4
- package/dist/core/generate/deduplicate-candidates.js +11 -9
- package/dist/core/generate/find-list-removal.d.ts +20 -0
- package/dist/core/generate/find-list-removal.js +26 -0
- package/dist/core/generate/generate-file-mutants.js +49 -47
- package/dist/core/generate/get-mutant-site.d.ts +18 -0
- package/dist/core/generate/get-mutant-site.js +4 -0
- package/dist/core/generate/get-target.d.ts +14 -0
- package/dist/core/generate/get-target.js +4 -0
- package/dist/core/generate/pick-host.d.ts +10 -0
- package/dist/core/generate/pick-host.js +16 -0
- package/dist/core/generate/validate-replacement.d.ts +15 -4
- package/dist/core/generate/validate-replacement.js +28 -13
- package/dist/core/ignore/find-ignore-rule.d.ts +8 -7
- package/dist/core/index.d.ts +18 -0
- package/dist/core/instrument/find-attribute-values.d.ts +12 -0
- package/dist/core/instrument/find-attribute-values.js +13 -0
- package/dist/core/instrument/get-site-syntax.d.ts +14 -0
- package/dist/core/instrument/get-site-syntax.js +12 -0
- package/dist/core/instrument/group-mutant-ranges.d.ts +7 -3
- package/dist/core/instrument/group-mutant-ranges.js +25 -19
- package/dist/core/instrument/instrument-file.d.ts +5 -3
- package/dist/core/instrument/instrument-file.js +10 -9
- package/dist/core/instrument/instrumenter-version.d.ts +1 -1
- package/dist/core/instrument/render-branch.d.ts +17 -0
- package/dist/core/instrument/render-branch.js +81 -0
- package/dist/core/instrument/render-mutant-range.d.ts +17 -6
- package/dist/core/instrument/render-mutant-range.js +39 -13
- package/dist/core/list-mutants.d.ts +7 -5
- package/dist/core/list-mutants.js +2 -2
- package/dist/core/mutators/array-element.d.ts +7 -6
- package/dist/core/mutators/array-element.js +13 -13
- package/dist/core/mutators/assignment-operator.js +34 -33
- package/dist/core/mutators/boolean-literal.d.ts +3 -2
- package/dist/core/mutators/number-literal.d.ts +1 -1
- package/dist/core/mutators/object-property.d.ts +4 -3
- package/dist/core/mutators/object-property.js +7 -8
- package/dist/core/mutators/return-value.js +65 -33
- package/dist/core/mutators/shared/get-branch-copy-skip.d.ts +14 -9
- package/dist/core/mutators/shared/get-branch-copy-skip.js +34 -35
- package/dist/core/mutators/shared/get-canonical-falsy-default.d.ts +32 -0
- package/dist/core/mutators/shared/get-canonical-falsy-default.js +11 -0
- package/dist/core/mutators/shared/get-comparison-plan.d.ts +2 -2
- package/dist/core/mutators/shared/get-comparison-plan.js +86 -85
- package/dist/core/mutators/shared/get-condition-constants.d.ts +8 -8
- package/dist/core/mutators/shared/get-condition-constants.js +3 -3
- package/dist/core/mutators/shared/get-default-option-skip.d.ts +2 -2
- package/dist/core/mutators/shared/get-endless-value.d.ts +20 -0
- package/dist/core/mutators/shared/get-endless-value.js +25 -0
- package/dist/core/mutators/shared/get-forced-test-justifier.d.ts +44 -0
- package/dist/core/mutators/shared/get-forced-test-justifier.js +25 -0
- package/dist/core/mutators/shared/get-group-constant.d.ts +6 -6
- package/dist/core/mutators/shared/get-group-constant.js +2 -2
- package/dist/core/mutators/shared/get-literal-skip.d.ts +9 -9
- package/dist/core/mutators/shared/get-literal-skip.js +2 -2
- package/dist/core/mutators/shared/get-logical-drops.d.ts +8 -8
- package/dist/core/mutators/shared/get-logical-drops.js +80 -82
- package/dist/core/mutators/shared/get-loop-running-skip.d.ts +2 -2
- package/dist/core/mutators/shared/get-nullish-swap-skip.d.ts +2 -2
- package/dist/core/mutators/shared/get-or-default-skip.d.ts +2 -2
- package/dist/core/mutators/shared/get-owned-constants.d.ts +2 -2
- package/dist/core/mutators/shared/get-owner-constant.d.ts +3 -1
- package/dist/core/mutators/shared/get-running-value.d.ts +5 -4
- package/dist/core/mutators/shared/get-toward-mutant.d.ts +10 -2
- package/dist/core/mutators/shared/get-toward-mutant.js +45 -40
- package/dist/core/mutators/shared/has-other-exit.js +16 -36
- package/dist/core/mutators/shared/is-loop-exit.d.ts +20 -0
- package/dist/core/mutators/shared/is-loop-exit.js +32 -0
- package/dist/core/mutators/shared/is-read-only.d.ts +26 -0
- package/dist/core/mutators/shared/is-read-only.js +53 -0
- package/dist/core/mutators/shared/leave-now-skip.d.ts +2 -2
- package/dist/core/mutators/shared/no-op-callback-skip.d.ts +2 -2
- package/dist/core/mutators/statement-removal.d.ts +4 -3
- package/dist/core/mutators/statement-removal.js +69 -73
- package/dist/core/mutators/string-literal.d.ts +15 -5
- package/dist/core/mutators/string-literal.js +79 -50
- package/dist/core/plugins/create-mutator-registry.d.ts +4 -2
- package/dist/core/plugins/create-mutator-registry.js +15 -5
- package/dist/core/plugins/validate-plugin.d.ts +3 -3
- package/dist/core/plugins/validate-plugin.js +32 -10
- package/dist/core/presets/recommended.d.ts +2 -2
- package/dist/core/presets/strict.d.ts +4 -2
- package/dist/core/regex/collect-pattern-changes.d.ts +2 -2
- package/dist/core/regex/create-regex-replacement.d.ts +2 -2
- package/dist/core/run/apply-batch-result.d.ts +23 -22
- package/dist/core/run/apply-batch-result.js +5 -5
- package/dist/core/run/apply-isolated-result.d.ts +21 -12
- package/dist/core/run/apply-isolated-result.js +45 -25
- package/dist/core/run/classify-try.d.ts +9 -8
- package/dist/core/run/count-run.d.ts +2 -1
- package/dist/core/run/create-run-state.d.ts +5 -0
- package/dist/core/run/create-run-state.js +1 -0
- package/dist/core/run/create-work-directory.d.ts +4 -1
- package/dist/core/run/create-work-directory.js +15 -12
- package/dist/core/run/decide-evidence.d.ts +4 -3
- package/dist/core/run/get-test-file-limits.d.ts +13 -0
- package/dist/core/run/get-test-file-limits.js +13 -0
- package/dist/core/run/get-unit-evidence.d.ts +12 -3
- package/dist/core/run/get-unit-evidence.js +1 -1
- package/dist/core/run/guard-session.d.ts +18 -0
- package/dist/core/run/guard-session.js +30 -0
- package/dist/core/run/live-work-directories.d.ts +5 -0
- package/dist/core/run/live-work-directories.js +2 -0
- package/dist/core/run/plan-batch.d.ts +6 -3
- package/dist/core/run/plan-batch.js +36 -31
- package/dist/core/run/plan-isolated.d.ts +3 -1
- package/dist/core/run/plan-isolated.js +8 -14
- package/dist/core/run/read-isolated-unit.d.ts +9 -6
- package/dist/core/run/read-isolated-unit.js +77 -38
- package/dist/core/run/remove-live-work-directories.d.ts +7 -0
- package/dist/core/run/remove-live-work-directories.js +12 -0
- package/dist/core/run/run-batch-phases.d.ts +4 -3
- package/dist/core/run/run-dry-phase.d.ts +35 -19
- package/dist/core/run/run-dry-phase.js +127 -77
- package/dist/core/run/run-isolated-rounds.d.ts +15 -10
- package/dist/core/run/run-isolated-rounds.js +4 -2
- package/dist/core/run/validate-adapter.d.ts +1 -1
- package/dist/core/run/validate-adapter.js +1 -1
- package/dist/core/run-mutants.d.ts +59 -22
- package/dist/core/run-mutants.js +356 -208
- package/dist/core/runtime/create-hit-limit-error.d.ts +5 -3
- package/dist/core/runtime/create-hit-limit-error.js +1 -1
- package/dist/core/runtime/install-mutant-runtime.js +23 -6
- package/dist/core/runtime/runtime-version.d.ts +4 -4
- package/dist/core/skips/skip-rules.d.ts +7 -1
- package/dist/core/skips/skip-rules.js +4 -0
- package/dist/core/syntax/is-brace-sensitive-attribute.d.ts +18 -0
- package/dist/core/syntax/is-brace-sensitive-attribute.js +28 -0
- package/dist/core/syntax/is-spread-safe-member.d.ts +18 -0
- package/dist/core/syntax/is-spread-safe-member.js +18 -0
- package/dist/core/syntax/is-value-position.d.ts +3 -1
- package/dist/core/text/get-list-removal-range.d.ts +22 -0
- package/dist/core/text/get-list-removal-range.js +46 -0
- package/dist/core/text/is-plain-attribute-string.d.ts +10 -0
- package/dist/core/text/is-plain-attribute-string.js +5 -0
- package/dist/core/text/parse-expression.d.ts +8 -4
- package/dist/core/text/parse-expression.js +1 -0
- package/dist/core/text/remove-list-element.d.ts +2 -4
- package/dist/core/text/remove-list-element.js +4 -45
- package/dist/docs/styles/colors.js +1 -1
- package/dist/package.js +1 -1
- package/dist/types/adapter/adapter-context.d.ts +20 -0
- package/dist/types/adapter/adapter-session.d.ts +2 -1
- package/dist/types/adapter/cache-inputs.d.ts +3 -2
- package/dist/types/adapter/dry-file.d.ts +6 -3
- package/dist/types/adapter/dry-run-request.d.ts +5 -4
- package/dist/types/adapter/isolated-plan.d.ts +2 -1
- package/dist/types/adapter/isolated-result.d.ts +3 -1
- package/dist/types/adapter/mutant-runtime.d.ts +30 -1
- package/dist/types/adapter/run-inputs.d.ts +5 -4
- package/dist/types/adapter/test-adapter.d.ts +7 -0
- package/dist/types/cache/cache-entry.d.ts +9 -7
- package/dist/types/cache/cached-inputs.d.ts +2 -2
- package/dist/types/cache/dry-snapshot.d.ts +76 -0
- package/dist/types/cache/project-tree.d.ts +16 -0
- package/dist/types/cache/run-cache-file.d.ts +1 -1
- package/dist/types/cache/run-cache.d.ts +6 -5
- package/dist/types/cli/text-style.d.ts +1 -1
- package/dist/types/config/plugin.d.ts +11 -2
- package/dist/types/config/preset-settings.d.ts +2 -2
- package/dist/types/config/run-config.d.ts +22 -4
- package/dist/types/config/run-settings.d.ts +6 -0
- package/dist/types/html/indexed-mutant.d.ts +4 -2
- package/dist/types/html/shown-change.d.ts +4 -3
- package/dist/types/mutant/core-note.d.ts +12 -0
- package/dist/types/mutant/diagnostic.d.ts +1 -0
- package/dist/types/mutant/list-removal.d.ts +37 -0
- package/dist/types/mutant/mutant-candidate.d.ts +11 -17
- package/dist/types/mutant/mutant-host.d.ts +49 -0
- package/dist/types/mutant/mutant-kind.d.ts +18 -0
- package/dist/types/mutant/mutant-range.d.ts +15 -8
- package/dist/types/mutant/mutant.d.ts +9 -15
- package/dist/types/mutant/registered-skip-rule.d.ts +11 -0
- package/dist/types/mutant/site-syntax.d.ts +14 -0
- package/dist/types/mutant/skip-justifier.d.ts +3 -1
- package/dist/types/mutant/skip-note.d.ts +7 -6
- package/dist/types/mutant/skip-rule-id.d.ts +3 -2
- package/dist/types/mutant/skip-rule.d.ts +2 -1
- package/dist/types/mutant/skipped-candidate.d.ts +27 -17
- package/dist/types/mutant/skipped-mutant.d.ts +15 -12
- package/dist/types/mutator/mutator.d.ts +3 -2
- package/dist/types/mutator/registered-mutator.d.ts +8 -0
- package/dist/types/mutator/replacement.d.ts +14 -3
- package/dist/types/regex/regex-change.d.ts +2 -2
- package/dist/types/report/html-report.d.ts +13 -9
- package/dist/types/report/list-report-focus.d.ts +3 -2
- package/dist/types/report/list-report-justifier.d.ts +4 -2
- package/dist/types/report/list-report-mutant.d.ts +15 -9
- package/dist/types/report/list-report-skipped.d.ts +6 -4
- package/dist/types/report/list-report.d.ts +1 -1
- package/dist/types/report/run-report.d.ts +13 -4
- package/dist/types/report/slim-list-report.d.ts +6 -3
- package/dist/types/report/slim-run-report.d.ts +2 -2
- package/dist/types/run/isolated-evidence.d.ts +3 -2
- package/dist/types/run/isolated-reason.d.ts +6 -4
- package/dist/types/run/mutant-state.d.ts +1 -1
- package/dist/types/run/run-durations.d.ts +8 -3
- package/dist/types/run/run-event.d.ts +11 -8
- package/dist/types/run/run-kind.d.ts +3 -2
- package/dist/types/run/run-result.d.ts +17 -5
- package/dist/types/run/run-state.d.ts +30 -1
- package/dist/types/run/run-status.d.ts +2 -2
- package/dist/types/run/try-cause.d.ts +10 -7
- package/dist/types/syntax/syntax-helpers.d.ts +5 -3
- package/package.json +5 -5
- package/readme.md +85 -68
- package/skills/mootant/SKILL.md +50 -31
- package/skills/mootant/references/mutators.md +31 -23
- package/dist/adapters/node-test/list-flag-values.js +0 -9
- package/dist/core/instrument/get-site-check.d.ts +0 -9
- package/dist/core/instrument/get-site-check.js +0 -5
- package/dist/core/instrument/get-template-site-check.d.ts +0 -12
- package/dist/core/instrument/get-template-site-check.js +0 -5
- /package/dist/adapters/{node-test → shared}/loader-flags.d.ts +0 -0
- /package/dist/adapters/{node-test → shared}/loader-flags.js +0 -0
- /package/dist/cli/{built-in-adapters.d.ts → get-built-in-adapters.d.ts} +0 -0
- /package/dist/cli/{built-in-adapters.js → get-built-in-adapters.js} +0 -0
- /package/dist/cli/terminal/{colors.d.ts → create-colors.d.ts} +0 -0
- /package/dist/cli/terminal/{colors.js → create-colors.js} +0 -0
- /package/dist/{adapters/shared → core/files}/list-package-files.d.ts +0 -0
- /package/dist/{adapters/shared → core/files}/list-package-files.js +0 -0
- /package/dist/{adapters/shared → core/files}/read-package-type.d.ts +0 -0
- /package/dist/{adapters/shared → core/files}/read-package-type.js +0 -0
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import { getSettingsProblem as e } from "./get-settings-problem.js";
|
|
2
2
|
import { isMutatorSetting as t } from "./is-mutator-setting.js";
|
|
3
3
|
import { isRecord as n } from "./is-record.js";
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const r = {
|
|
5
|
+
equivalent: !0,
|
|
6
|
+
duplicate: !0,
|
|
7
|
+
subsumed: !0,
|
|
8
|
+
timeout: !0,
|
|
9
|
+
invalid: !0,
|
|
10
|
+
owned: !0,
|
|
11
|
+
noise: !0
|
|
12
|
+
};
|
|
13
|
+
function i(e, t) {
|
|
14
|
+
let n = o(e);
|
|
6
15
|
if (n !== null) throw Error(`Plugin "${t}" is invalid: ${n}.`);
|
|
7
16
|
return e;
|
|
8
17
|
}
|
|
9
|
-
function
|
|
18
|
+
function a(r) {
|
|
10
19
|
if (!n(r)) return "must be an object";
|
|
11
20
|
if (typeof r.description != "string") return "has no description";
|
|
12
21
|
if (!n(r.mutators)) return "has \"mutators\" that is not an object";
|
|
@@ -20,27 +29,40 @@ function i(r) {
|
|
|
20
29
|
}
|
|
21
30
|
return null;
|
|
22
31
|
}
|
|
23
|
-
function
|
|
32
|
+
function o(e) {
|
|
24
33
|
if (!n(e)) return "it must be an object";
|
|
25
34
|
if (!n(e.mutators)) return "\"mutators\" must be an object";
|
|
26
35
|
let t = Object.entries(e.mutators);
|
|
27
36
|
for (let [e, n] of t) {
|
|
28
|
-
let t =
|
|
37
|
+
let t = c(n);
|
|
29
38
|
if (t !== null) return `mutator "${e}" ${t}`;
|
|
30
39
|
}
|
|
40
|
+
let r = s(e.skipRules);
|
|
41
|
+
if (r !== null) return r;
|
|
31
42
|
if (e.presets === void 0) return null;
|
|
32
43
|
if (!n(e.presets)) return "\"presets\" must be an object";
|
|
33
|
-
let
|
|
34
|
-
for (let [e, t] of
|
|
35
|
-
let n =
|
|
44
|
+
let i = Object.entries(e.presets);
|
|
45
|
+
for (let [e, t] of i) {
|
|
46
|
+
let n = a(t);
|
|
36
47
|
if (n !== null) return `preset "${e}" ${n}`;
|
|
37
48
|
}
|
|
38
49
|
return null;
|
|
39
50
|
}
|
|
40
|
-
function
|
|
51
|
+
function s(e) {
|
|
52
|
+
if (e === void 0) return null;
|
|
53
|
+
if (!n(e)) return "\"skipRules\" must be an object";
|
|
54
|
+
for (let [t, i] of Object.entries(e)) {
|
|
55
|
+
if (!n(i)) return `skip rule "${t}" must be an object`;
|
|
56
|
+
let { category: e } = i;
|
|
57
|
+
if (typeof e != "string" || !Object.hasOwn(r, e)) return `skip rule "${t}" has an invalid category: use "equivalent", "noise", "timeout", "owned", "subsumed", "duplicate" or "invalid"`;
|
|
58
|
+
if (typeof i.heuristic != "boolean") return `skip rule "${t}" has heuristic that is not true or false`;
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
function c(e) {
|
|
41
63
|
if (!n(e)) return "must be an object";
|
|
42
64
|
if (typeof e.create != "function") return "has no create function";
|
|
43
65
|
let { meta: t } = e;
|
|
44
66
|
return !n(t) || typeof t.description != "string" ? "has no meta.description" : t.defaultOptions !== void 0 && !n(t.defaultOptions) ? "has meta.defaultOptions that is not an object" : t.countsForSolitary !== void 0 && typeof t.countsForSolitary != "boolean" ? "has meta.countsForSolitary that is not true or false" : null;
|
|
45
67
|
}
|
|
46
|
-
export {
|
|
68
|
+
export { i as validatePlugin };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Preset } from '../../types/config/preset.js';
|
|
2
2
|
/**
|
|
3
3
|
* Default preset: every built-in mutator with its default options, without
|
|
4
|
-
* mutants that
|
|
5
|
-
*
|
|
4
|
+
* mutants that may cause timeouts, and the usual loggers, whose message texts
|
|
5
|
+
* are not mutated.
|
|
6
6
|
*/
|
|
7
7
|
export declare let recommended: Preset;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Preset } from '../../types/config/preset.js';
|
|
2
2
|
/**
|
|
3
3
|
* Recommended preset with the noisier options of the built-in mutators, the
|
|
4
|
-
* mutants that
|
|
5
|
-
*
|
|
4
|
+
* mutants that may cause timeouts and the coarse mutants that the solitary rule
|
|
5
|
+
* would drop. It leaves string-literal's `jsxAttributes` off: the braces that
|
|
6
|
+
* host a quoted JSX attribute value can change what Solid or a macro does with
|
|
7
|
+
* no mutant on.
|
|
6
8
|
*/
|
|
7
9
|
export declare let strict: Preset;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RegexPatternOptions } from '../../types/mutator/regex-pattern-options.js';
|
|
2
2
|
import { RegexSource } from '../../types/regex/regex-source.js';
|
|
3
3
|
import { RegexChange } from '../../types/regex/regex-change.js';
|
|
4
|
-
import {
|
|
4
|
+
import { CoreNote } from '../../types/mutant/core-note.js';
|
|
5
5
|
/**
|
|
6
6
|
* Lists the changes regex-pattern considers for a pattern, ordered by start
|
|
7
7
|
* and, for one start, outer first: removing `^` and `$`, `\b` and `\B`,
|
|
@@ -21,4 +21,4 @@ import { SkipNote } from '../../types/mutant/skip-note.js';
|
|
|
21
21
|
* pattern, when code only asks whether the pattern matches; null otherwise.
|
|
22
22
|
* @returns Changes with offsets relative to the pattern.
|
|
23
23
|
*/
|
|
24
|
-
export declare function collectPatternChanges(source: Pick<RegexSource, 'flags' | 'tree'>, options: Readonly<RegexPatternOptions>, testedSkip:
|
|
24
|
+
export declare function collectPatternChanges(source: Pick<RegexSource, 'flags' | 'tree'>, options: Readonly<RegexPatternOptions>, testedSkip: CoreNote | null): RegexChange[];
|
|
@@ -2,7 +2,7 @@ import { PresetSettings } from '../../types/config/preset-settings.js';
|
|
|
2
2
|
import { Replacement } from '../../types/mutator/replacement.js';
|
|
3
3
|
import { RegexSource } from '../../types/regex/regex-source.js';
|
|
4
4
|
import { TextEdit } from '../../types/source/text-edit.js';
|
|
5
|
-
import {
|
|
5
|
+
import { CoreNote } from '../../types/mutant/core-note.js';
|
|
6
6
|
/**
|
|
7
7
|
* Change of a regex mutant, with the skip the mutator decided.
|
|
8
8
|
*/
|
|
@@ -15,7 +15,7 @@ interface RegexEdit {
|
|
|
15
15
|
/**
|
|
16
16
|
* Skip the mutator decided, or null.
|
|
17
17
|
*/
|
|
18
|
-
skip:
|
|
18
|
+
skip: CoreNote | null;
|
|
19
19
|
/**
|
|
20
20
|
* New flags.
|
|
21
21
|
*/
|
|
@@ -3,33 +3,34 @@ import { PlannedTry, RunState } from '../../types/run/run-state.js';
|
|
|
3
3
|
import { BatchResult } from '../../types/adapter/batch-result.js';
|
|
4
4
|
/**
|
|
5
5
|
* Records what a batch run reported, in fast mode. Each mutant try is
|
|
6
|
-
* classified. Only kills are accepted, and a kill
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
6
|
+
* classified. Only kills are accepted, and a kill only when the control tries
|
|
7
|
+
* right before and right after it both passed, else it is doubtful. An accepted
|
|
8
|
+
* kill is heuristic and final: passing controls do not prove that the mutant
|
|
9
|
+
* alone fails the test, since state an earlier try left can fail it, such as a
|
|
10
|
+
* value a control try set that the mutant no longer resets; the default mode
|
|
11
|
+
* decides every mutant isolated instead. A try that ran out of time has no
|
|
12
|
+
* control after it, since the worker gives up the unit: it counts only after a
|
|
13
|
+
* passing control, and then waits for a confirmation in a fresh run with twice
|
|
14
|
+
* the time of its whole test file, or is final when the run was one. A
|
|
15
|
+
* hit-limit timeout sends the mutant to the isolated path, even in such a run,
|
|
16
|
+
* since a mutant that only makes code hotter goes over the hit limit too and
|
|
17
|
+
* only that path confirms it with a raised limit. Doubtful tries and late
|
|
18
|
+
* errors send the mutant to the isolated path; a reached pass is only noted,
|
|
19
|
+
* since state left by a control try may hide the mutant, and the core rechecks
|
|
20
|
+
* it on the isolated path. A unit whose suite hook failed sends every mutant it
|
|
21
|
+
* planned that is still undecided to the isolated path. A test whose leading
|
|
22
|
+
* control skipped itself ends its repeats there, so its mutants count as tried
|
|
23
|
+
* without evidence rather than missing. A hung unit gets a `worker-hang`
|
|
24
|
+
* warning and its timed-out try the cause `hang`. Accepted kills and passes,
|
|
25
|
+
* whether they reached the mutant or not, go to the cache of the run, so a
|
|
26
|
+
* later run reuses a kill only after the same passes, unless the kill came from
|
|
27
|
+
* the first test of the mutant (`applyCachedBatch`).
|
|
26
28
|
*
|
|
27
29
|
* @param state - State of the run, updated in place.
|
|
28
30
|
* @param run - The run to record.
|
|
29
31
|
* @param run.plan - Plan the run executed.
|
|
30
32
|
* @param run.result - What the adapter reported.
|
|
31
|
-
* @param run.confirming - Whether the run
|
|
32
|
-
* bounds.
|
|
33
|
+
* @param run.confirming - Whether the run confirms timeouts.
|
|
33
34
|
* @returns Planned tries without facts whose mutant is still undecided on the
|
|
34
35
|
* batch path.
|
|
35
36
|
*/
|
|
@@ -41,13 +41,13 @@ function i(e, n, r) {
|
|
|
41
41
|
t(e, n.mutant.id, "doubtful");
|
|
42
42
|
break;
|
|
43
43
|
case "timeout": {
|
|
44
|
-
let
|
|
45
|
-
|
|
46
|
-
cause:
|
|
44
|
+
let r = o === "time-limit" && c ? "hang" : o;
|
|
45
|
+
r === "hit-limit" ? t(e, n.mutant.id, "doubtful") : i ? n.verdict = {
|
|
46
|
+
cause: r,
|
|
47
47
|
status: "Timeout",
|
|
48
48
|
...l
|
|
49
49
|
} : n.confirm.push({
|
|
50
|
-
cause:
|
|
50
|
+
cause: r,
|
|
51
51
|
test: s.id
|
|
52
52
|
});
|
|
53
53
|
break;
|
|
@@ -99,7 +99,7 @@ function s(e, n) {
|
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
function c(e, t, r) {
|
|
102
|
-
let { outcome: i, cause: a } = n(e, t, "batch"), o = i === "killed"
|
|
102
|
+
let { outcome: i, cause: a } = n(e, t, "batch"), o = i === "killed";
|
|
103
103
|
return (o || i === "timeout") && (!u(r.before) || o && !u(r.after)) && (i = "doubtful"), {
|
|
104
104
|
outcome: i,
|
|
105
105
|
cause: a
|
|
@@ -2,23 +2,32 @@ import { IsolatedPlan } from '../../types/adapter/isolated-plan.js';
|
|
|
2
2
|
import { IsolatedRequest, RunState } from '../../types/run/run-state.js';
|
|
3
3
|
import { IsolatedResult } from '../../types/adapter/isolated-result.js';
|
|
4
4
|
/**
|
|
5
|
-
* Records what an isolated run reported, unit by unit. A unit
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* Records what an isolated run reported, unit by unit. A unit that exceeded its
|
|
6
|
+
* hit limit, a hang, or a test or suite hook that ran out of time after the
|
|
7
|
+
* mutant was reached is a timeout that waits for a confirmation with doubled
|
|
8
|
+
* time, and past the hit limit with a raised one, or is final when the unit was
|
|
9
|
+
* one (`getUnitEvidence`); a crash runs the unit once more with the limits it
|
|
10
|
+
* had and kills only when an earlier unit of the mutant in the test file
|
|
11
|
+
* crashed too, as something else can end its process; a load error, a failed
|
|
9
12
|
* suite hook or file teardown in a unit that reached the mutant, or a test that
|
|
10
13
|
* failed or threw a stray error after the mutant was reached kills; a unit that
|
|
11
14
|
* reached the mutant and passed is survived evidence. The dry run had no failed
|
|
12
15
|
* suite hook, since one fails the dry run. Stray errors of tests and test files
|
|
13
16
|
* that had them in the dry run prove nothing. A unit without facts is planned
|
|
14
|
-
* once more, then gives an `Error` verdict unless another file has evidence.
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
17
|
+
* once more, then gives an `Error` verdict unless another file has evidence. So
|
|
18
|
+
* does an inconclusive unit, which something else stopped before the tests that
|
|
19
|
+
* reach the mutant got to it (`readIsolatedUnit`): it runs once more with the
|
|
20
|
+
* limits it had, and a second inconclusive unit of the mutant in the test file
|
|
21
|
+
* gives its `Error` and a `tests-stopped-early` warning. The verdict of a
|
|
22
|
+
* mutant follows `decideEvidence`: the kill or timeout of its first test file
|
|
23
|
+
* in the order of `routeIsolated` that has one, once every file before it is
|
|
24
|
+
* done; a timeout waiting for its confirmation, a crash waiting for one more
|
|
25
|
+
* run or a unit waiting for its retry holds back the evidence of later files,
|
|
26
|
+
* so the verdict does not depend on which files ran together. Kills, reached
|
|
27
|
+
* passes and final timeouts go to the cache of the run, which keeps only what
|
|
28
|
+
* it may reuse; a timeout or a crash that waits for another run does not, and
|
|
29
|
+
* the cache never keeps an `Error`. The cost of a unit counts the start of its
|
|
30
|
+
* process too.
|
|
22
31
|
*
|
|
23
32
|
* @param state - State of the run, updated in place.
|
|
24
33
|
* @param planned - The plan the run executed and the requests it was built
|
|
@@ -3,32 +3,41 @@ import { getUnitEvidence as t } from "./get-unit-evidence.js";
|
|
|
3
3
|
import { getDisplayPath as n } from "./get-display-path.js";
|
|
4
4
|
import { decideEvidence as r } from "./decide-evidence.js";
|
|
5
5
|
function i(n, r, i) {
|
|
6
|
-
let { requests:
|
|
7
|
-
for (let [r, i] of
|
|
8
|
-
let
|
|
9
|
-
if (
|
|
10
|
-
|
|
6
|
+
let { requests: c, plan: l } = r, u = new Map(i.units.map((e) => [e.unit, e])), d = [], f = [], p = /* @__PURE__ */ new Set();
|
|
7
|
+
for (let [r, i] of l.units.entries()) {
|
|
8
|
+
let s = c[r], l = n.mutants.get(i.mutant), m = u.get(r);
|
|
9
|
+
if (m === void 0) {
|
|
10
|
+
f.push(s);
|
|
11
11
|
continue;
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
let
|
|
15
|
-
facts:
|
|
16
|
-
request:
|
|
13
|
+
l.units += 1, l.tries += 1, l.duration += m.duration, l.unitDuration += m.duration + (m.startup ?? 0), m.incomplete === "hang" && o(n, i), p.add(l);
|
|
14
|
+
let h = e(n, l, {
|
|
15
|
+
facts: m,
|
|
16
|
+
request: s,
|
|
17
17
|
unit: i
|
|
18
|
+
}), g = t(h, s);
|
|
19
|
+
if (h !== null && g !== "confirming" && n.cache?.recordUnit(l, s.file, {
|
|
20
|
+
inputs: m.inputs,
|
|
21
|
+
verdict: h
|
|
22
|
+
}), l.survived ||= h === "survived", l.evidence.set(s.file, g), typeof h == "object" && h?.status === "Error") typeof g == "object" ? a(n, i, g.message) : d.push({
|
|
23
|
+
...s,
|
|
24
|
+
inconclusive: !0
|
|
18
25
|
});
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
else if (g === "confirming") {
|
|
27
|
+
let e = typeof h == "object" && h?.cause;
|
|
28
|
+
d.push(e === "crash" ? {
|
|
29
|
+
...s,
|
|
30
|
+
crashed: !0
|
|
31
|
+
} : {
|
|
32
|
+
...s,
|
|
33
|
+
raised: e === "hit-limit",
|
|
34
|
+
confirming: !0,
|
|
35
|
+
retried: !1
|
|
36
|
+
});
|
|
37
|
+
}
|
|
29
38
|
}
|
|
30
|
-
for (let e of
|
|
31
|
-
for (let e of
|
|
39
|
+
for (let e of p) s(e);
|
|
40
|
+
for (let e of f) {
|
|
32
41
|
let t = n.mutants.get(e.mutant);
|
|
33
42
|
t.verdict === null && (e.retried ? (t.evidence.set(e.file, {
|
|
34
43
|
message: "The test runner did not report this mutant.",
|
|
@@ -36,14 +45,25 @@ function i(n, r, i) {
|
|
|
36
45
|
cause: null,
|
|
37
46
|
file: null,
|
|
38
47
|
test: null
|
|
39
|
-
}),
|
|
48
|
+
}), s(t)) : (!e.confirming && !e.crashed && t.evidence.set(e.file, "retrying"), d.push({
|
|
40
49
|
...e,
|
|
41
50
|
retried: !0
|
|
42
51
|
})));
|
|
43
52
|
}
|
|
44
|
-
return
|
|
53
|
+
return d;
|
|
54
|
+
}
|
|
55
|
+
function a(e, t, r) {
|
|
56
|
+
let i = n(t.file, e.root);
|
|
57
|
+
e.diagnostics.push({
|
|
58
|
+
message: `The test file ${i} gave mutant ${t.mutant} no verdict in two runs. ${r}`,
|
|
59
|
+
code: "tests-stopped-early",
|
|
60
|
+
severity: "warning",
|
|
61
|
+
file: i,
|
|
62
|
+
column: null,
|
|
63
|
+
line: null
|
|
64
|
+
});
|
|
45
65
|
}
|
|
46
|
-
function
|
|
66
|
+
function o(e, t) {
|
|
47
67
|
let r = n(t.file, e.root);
|
|
48
68
|
e.diagnostics.push({
|
|
49
69
|
message: `The test file ${r} ran past its time budget with mutant ${t.mutant} and was stopped.`,
|
|
@@ -54,7 +74,7 @@ function a(e, t) {
|
|
|
54
74
|
line: null
|
|
55
75
|
});
|
|
56
76
|
}
|
|
57
|
-
function
|
|
77
|
+
function s(e) {
|
|
58
78
|
let t = r(e);
|
|
59
79
|
t !== null && (e.verdict = t.verdict);
|
|
60
80
|
}
|
|
@@ -3,14 +3,15 @@ import { TryVerdict } from '../../types/run/try-verdict.js';
|
|
|
3
3
|
import { TryFacts } from '../../types/adapter/try-facts.js';
|
|
4
4
|
/**
|
|
5
5
|
* Classifies the raw facts of one try. In order: more site evaluations than the
|
|
6
|
-
* hit limit is a timeout,
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* when
|
|
12
|
-
*
|
|
13
|
-
* reaching it is
|
|
6
|
+
* hit limit is a timeout, whether a mutant made a loop through sites endless or
|
|
7
|
+
* only made code far hotter, which its confirmation tells apart; a try that ran
|
|
8
|
+
* out of time is a timeout when it reached the mutant; stray errors make a
|
|
9
|
+
* batch try doubtful, since orphaned work of an earlier try may throw them, and
|
|
10
|
+
* kill on the isolated path when the try reached the mutant; a failure kills
|
|
11
|
+
* when the try reached the mutant; a pass, or a skip, survives when it reached
|
|
12
|
+
* the mutant. A try that failed, ran out of time or had stray errors without
|
|
13
|
+
* reaching the mutant is doubtful; one that passed without reaching it is
|
|
14
|
+
* unreached.
|
|
14
15
|
*
|
|
15
16
|
* @param facts - Facts the adapter reported for the try.
|
|
16
17
|
* @param limits - Limits the try ran with.
|
|
@@ -18,7 +18,8 @@ import { RunKind } from '../../types/run/run-kind.js';
|
|
|
18
18
|
* @param work.confirming - Of the mutants of an isolated round, those that
|
|
19
19
|
* confirm a timeout; 0 when omitted.
|
|
20
20
|
* @param work.retrying - Of the mutants of an isolated round, those that run
|
|
21
|
-
* again after a lost result; 0 when
|
|
21
|
+
* again after a lost result, an inconclusive unit or a crash; 0 when
|
|
22
|
+
* omitted.
|
|
22
23
|
*/
|
|
23
24
|
export declare function countRun(state: RunState, kind: Exclude<RunKind, 'dry'>, work: {
|
|
24
25
|
confirming?: number;
|
|
@@ -25,6 +25,11 @@ interface RunStateInput {
|
|
|
25
25
|
* or not.
|
|
26
26
|
*/
|
|
27
27
|
hosted: readonly Mutant[];
|
|
28
|
+
/**
|
|
29
|
+
* Whether isolated units of one test file may run at the same time; false
|
|
30
|
+
* when omitted.
|
|
31
|
+
*/
|
|
32
|
+
parallelUnits?: boolean;
|
|
28
33
|
/**
|
|
29
34
|
* Coverage and stability of the dry run.
|
|
30
35
|
*/
|
|
@@ -13,7 +13,10 @@ interface WorkDirectory {
|
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* Creates a fresh directory for the files of one run (plans, results,
|
|
16
|
-
* heartbeats) in the system temporary directory.
|
|
16
|
+
* heartbeats) in the system temporary directory. Until it is removed, it is
|
|
17
|
+
* among the live work directories (`LIVE_WORK_DIRECTORIES`), which an
|
|
18
|
+
* interrupted run whose cleanup takes too long removes before the process ends
|
|
19
|
+
* (`removeLiveWorkDirectories`).
|
|
17
20
|
*
|
|
18
21
|
* @returns Path of the directory and a function that deletes it.
|
|
19
22
|
*/
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { LIVE_WORK_DIRECTORIES as e } from "./live-work-directories.js";
|
|
2
|
+
import t from "node:path";
|
|
3
|
+
import { tmpdir as n } from "node:os";
|
|
4
|
+
import { mkdtemp as r, rm as i } from "node:fs/promises";
|
|
5
|
+
async function a() {
|
|
6
|
+
let a = await r(t.join(n(), "mootant-"));
|
|
7
|
+
return e.add(a), {
|
|
8
|
+
remove: async () => {
|
|
9
|
+
await i(a, {
|
|
10
|
+
recursive: !0,
|
|
11
|
+
force: !0
|
|
12
|
+
}), e.delete(a);
|
|
13
|
+
},
|
|
14
|
+
path: a
|
|
12
15
|
};
|
|
13
16
|
}
|
|
14
|
-
export {
|
|
17
|
+
export { a as createWorkDirectory };
|
|
@@ -6,9 +6,10 @@ import { MutantVerdict, MutantState } from '../../types/run/mutant-state.js';
|
|
|
6
6
|
* every file before it is done without one. A file is not done while it waits
|
|
7
7
|
* to run (it has no evidence), for a timeout confirmation or for a retry, so
|
|
8
8
|
* the verdict depends neither on which files ran together nor on which came
|
|
9
|
-
* from the cache. A file the test runner did not report
|
|
10
|
-
* when no file has a kill or a timeout. Without
|
|
11
|
-
* all its files are done, with no verdict: a
|
|
9
|
+
* from the cache. A file the test runner did not report, or one inconclusive
|
|
10
|
+
* twice, gives its `Error` only when no file has a kill or a timeout. Without
|
|
11
|
+
* any, the mutant is decided once all its files are done, with no verdict: a
|
|
12
|
+
* reached pass makes it `Survived`.
|
|
12
13
|
*
|
|
13
14
|
* @param mutant - Test files of the mutant in order and their evidence.
|
|
14
15
|
* @returns The verdict, or null while it is undecided.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TryLimits } from '../../types/adapter/try-limits.js';
|
|
2
|
+
import { RunState } from '../../types/run/run-state.js';
|
|
3
|
+
/**
|
|
4
|
+
* Computes the limits of running a whole test file with a mutant, as an
|
|
5
|
+
* isolated unit does: those of loading the file and its suite hooks and of one
|
|
6
|
+
* try of every test of the file, added up.
|
|
7
|
+
*
|
|
8
|
+
* @param state - State of the run.
|
|
9
|
+
* @param file - Key of the test file (`getTestFileKey`).
|
|
10
|
+
* @param scale - 1, or 2 to confirm a timeout.
|
|
11
|
+
* @returns Hit limit and timeout of the whole file.
|
|
12
|
+
*/
|
|
13
|
+
export declare function getTestFileLimits(state: RunState, file: string, scale: number): TryLimits;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { getTryLimits as e } from "./get-try-limits.js";
|
|
2
|
+
function t(t, n, r) {
|
|
3
|
+
let { analysis: i, limits: a } = t, o = e(i.loads.get(n) ?? {
|
|
4
|
+
duration: 0,
|
|
5
|
+
hits: 0
|
|
6
|
+
}, a, r), s = i.fileTests.get(n);
|
|
7
|
+
if (s !== void 0) for (let t of s) {
|
|
8
|
+
let n = e(i.baselines.get(t), a, r);
|
|
9
|
+
o.hitLimit += n.hitLimit, o.timeout += n.timeout;
|
|
10
|
+
}
|
|
11
|
+
return o;
|
|
12
|
+
}
|
|
13
|
+
export { t as getTestFileLimits };
|
|
@@ -2,9 +2,18 @@ import { IsolatedEvidence } from '../../types/run/isolated-evidence.js';
|
|
|
2
2
|
import { MutantVerdict } from '../../types/run/mutant-state.js';
|
|
3
3
|
import { IsolatedRequest } from '../../types/run/run-state.js';
|
|
4
4
|
/**
|
|
5
|
-
* Turns the outcome of an isolated unit into the evidence of its test file:
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* Turns the outcome of an isolated unit into the evidence of its test file: an
|
|
6
|
+
* inconclusive unit waits for one more run, as a lost one does, and keeps a
|
|
7
|
+
* timeout or a crash it reran waiting, unless an earlier unit of the mutant in
|
|
8
|
+
* the test file was inconclusive too, which gives its `Error`; a crash waits
|
|
9
|
+
* for one more run of the unit, as something else, such as the OOM killer or a
|
|
10
|
+
* `kill -9`, can end its process too, unless an earlier unit of the mutant in
|
|
11
|
+
* the test file crashed, while a lost result confirms nothing; a timeout waits
|
|
12
|
+
* for its confirmation, unless the unit confirmed one with what stopped it: a
|
|
13
|
+
* timer or a hang in any confirming unit, the hit limit only in one with the
|
|
14
|
+
* raised limit, since a mutant that only makes code hotter goes over the hit
|
|
15
|
+
* limit too, also when the doubled time of a timer's confirmation lets it reach
|
|
16
|
+
* its hot code; a reached pass and a unit that decided nothing are done without
|
|
8
17
|
* a verdict, and any other verdict stands.
|
|
9
18
|
*
|
|
10
19
|
* @param verdict - Outcome of the unit (`readIsolatedUnit`).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
function e(e, t) {
|
|
2
|
-
return e === "survived" || e === null ? "none" : e.status === "
|
|
2
|
+
return e === "survived" || e === null ? "none" : e.status === "Error" && t.inconclusive !== !0 ? t.confirming || t.crashed ? "confirming" : "retrying" : e.cause === "crash" ? t.crashed ? e : "confirming" : !(e.cause === "hit-limit" ? t.raised : t.confirming) && e.status === "Timeout" ? "confirming" : e;
|
|
3
3
|
}
|
|
4
4
|
export { e as getUnitEvidence };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AdapterSession } from '../../types/adapter/adapter-session.js';
|
|
2
|
+
/**
|
|
3
|
+
* Wraps the session of a run so that an interrupted run asks nothing more of
|
|
4
|
+
* the test runner: once the signal aborted, a call throws the signal's reason
|
|
5
|
+
* without starting, and a call that was running throws it when it ends,
|
|
6
|
+
* dropping what it gave, so verdicts of units the interrupt stopped never
|
|
7
|
+
* count. A running call is awaited, not cut short: the adapter ends it
|
|
8
|
+
* (`AdapterContext.signal`), so `close` never runs alongside it and no
|
|
9
|
+
* rejection is left unhandled. `close` passes through. The facts of the session
|
|
10
|
+
* (`diagnostics`, `version`, `workers`) and whether it has `cacheInputs` are
|
|
11
|
+
* read from the session itself each time, so a session that keeps them in
|
|
12
|
+
* getters of its class or changes them later reads the same through the guard.
|
|
13
|
+
*
|
|
14
|
+
* @param session - Session the adapter started.
|
|
15
|
+
* @param signal - Signal that interrupts the run.
|
|
16
|
+
* @returns The guarded session.
|
|
17
|
+
*/
|
|
18
|
+
export declare function guardSession(session: AdapterSession, signal: AbortSignal): AdapterSession;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
function e(e, t) {
|
|
2
|
+
async function n(e) {
|
|
3
|
+
t.throwIfAborted();
|
|
4
|
+
try {
|
|
5
|
+
return await e();
|
|
6
|
+
} finally {
|
|
7
|
+
t.throwIfAborted();
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
return {
|
|
11
|
+
get cacheInputs() {
|
|
12
|
+
return e.cacheInputs === void 0 ? void 0 : () => n(() => e.cacheInputs());
|
|
13
|
+
},
|
|
14
|
+
get diagnostics() {
|
|
15
|
+
return e.diagnostics;
|
|
16
|
+
},
|
|
17
|
+
get version() {
|
|
18
|
+
return e.version;
|
|
19
|
+
},
|
|
20
|
+
get workers() {
|
|
21
|
+
return e.workers;
|
|
22
|
+
},
|
|
23
|
+
runIsolated: (t) => n(() => e.runIsolated(t)),
|
|
24
|
+
listTestFiles: () => n(() => e.listTestFiles()),
|
|
25
|
+
dryRun: (t) => n(() => e.dryRun(t)),
|
|
26
|
+
runBatch: (t) => n(() => e.runBatch(t)),
|
|
27
|
+
close: () => e.close()
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export { e as guardSession };
|