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
|
@@ -5,12 +5,15 @@ import { PlannedTry, RunState } from '../../types/run/run-state.js';
|
|
|
5
5
|
* with limits from the dry run, one unit per test file. The adapter never runs
|
|
6
6
|
* two units of one test file at once, as a plain run of the test runner never
|
|
7
7
|
* runs a test file twice at once, so splitting a file would only load it more
|
|
8
|
-
* often. A run that confirms timeouts
|
|
9
|
-
*
|
|
8
|
+
* often. A run that confirms timeouts gives each test twice the time limit of
|
|
9
|
+
* its whole test file (`getTestFileLimits`), as an isolated unit that confirms
|
|
10
|
+
* a timeout has: a test slowed past its own limit may still fit in the time of
|
|
11
|
+
* its file and pass there. It also gets half the workers, so the tries compete
|
|
12
|
+
* less for the processor.
|
|
10
13
|
*
|
|
11
14
|
* @param state - State of the run.
|
|
12
15
|
* @param tries - Mutants to try in tests.
|
|
13
|
-
* @param scale - 1, or 2 to confirm timeouts
|
|
16
|
+
* @param scale - 1, or 2 to confirm timeouts.
|
|
14
17
|
* @returns Units sorted by test file, and the workers the run may use.
|
|
15
18
|
*/
|
|
16
19
|
export declare function planBatch(state: RunState, tries: readonly PlannedTry[], scale: number): BatchPlan;
|
|
@@ -1,48 +1,53 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { getTestFileLimits as e } from "./get-test-file-limits.js";
|
|
2
|
+
import { compareCodeUnits as t } from "../compare-code-units.js";
|
|
3
|
+
import { getTestFileKey as n } from "./get-test-file-key.js";
|
|
4
|
+
import { getTryLimits as r } from "./get-try-limits.js";
|
|
5
|
+
function i(e, r, i) {
|
|
6
|
+
let { analysis: o } = e, s = /* @__PURE__ */ new Map();
|
|
7
|
+
for (let { mutant: e, test: t } of r) {
|
|
8
|
+
let r = n(o.tests.get(t)), i = s.get(r) ?? /* @__PURE__ */ new Map();
|
|
8
9
|
s.set(r, i);
|
|
9
|
-
let a = i.get(
|
|
10
|
-
i.set(
|
|
10
|
+
let a = i.get(t) ?? [];
|
|
11
|
+
i.set(t, a), a.includes(e) || a.push(e);
|
|
11
12
|
}
|
|
12
|
-
let c = [...s].toSorted(([
|
|
13
|
-
tests: [...
|
|
13
|
+
let c = [...s].toSorted(([e], [n]) => t(e, n)).map(([t, n]) => a(e, {
|
|
14
|
+
tests: [...n].map(([e, t]) => ({
|
|
14
15
|
mutants: t,
|
|
15
16
|
id: e
|
|
16
17
|
})).toSorted((e, t) => o.order.get(e.id) - o.order.get(t.id)),
|
|
17
|
-
key:
|
|
18
|
-
},
|
|
18
|
+
key: t
|
|
19
|
+
}, i));
|
|
19
20
|
return {
|
|
20
|
-
concurrency:
|
|
21
|
+
concurrency: i > 1 ? Math.max(1, Math.floor(e.workers / 2)) : e.workers,
|
|
21
22
|
units: c
|
|
22
23
|
};
|
|
23
24
|
}
|
|
24
|
-
function
|
|
25
|
-
let { analysis:
|
|
25
|
+
function a(t, n, i) {
|
|
26
|
+
let { analysis: a, limits: o } = t, { tests: s, key: c } = n, l = r(a.loads.get(c) ?? {
|
|
26
27
|
duration: 0,
|
|
27
28
|
hits: 0
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
}, o, i), u = i > 1 ? e(t, c, i) : null, d = s.map((e) => {
|
|
30
|
+
let t = r(a.baselines.get(e.id), o, i);
|
|
31
|
+
return {
|
|
32
|
+
timeout: u?.timeout ?? t.timeout,
|
|
33
|
+
hitLimit: t.hitLimit,
|
|
34
|
+
mutants: e.mutants,
|
|
35
|
+
id: e.id
|
|
36
|
+
};
|
|
37
|
+
}), f = a.fileTests.get(c), p = f.indexOf(s.at(-1).id), m = l.timeout, h = f.slice(0, p + 1);
|
|
38
|
+
for (let e of h) {
|
|
39
|
+
let t = d.find((t) => t.id === e);
|
|
40
|
+
m += t === void 0 ? r(a.baselines.get(e), o, i).timeout : t.timeout * (2 * t.mutants.length + 1);
|
|
36
41
|
}
|
|
37
|
-
let { project:
|
|
42
|
+
let { project: g, file: _ } = a.testFiles.get(c);
|
|
38
43
|
return {
|
|
39
44
|
limits: {
|
|
40
|
-
total:
|
|
41
|
-
load:
|
|
45
|
+
total: m,
|
|
46
|
+
load: l
|
|
42
47
|
},
|
|
43
|
-
project:
|
|
44
|
-
tests:
|
|
45
|
-
file:
|
|
48
|
+
project: g,
|
|
49
|
+
tests: d,
|
|
50
|
+
file: _
|
|
46
51
|
};
|
|
47
52
|
}
|
|
48
|
-
export {
|
|
53
|
+
export { i as planBatch };
|
|
@@ -4,7 +4,9 @@ import { IsolatedPlan } from '../../types/adapter/isolated-plan.js';
|
|
|
4
4
|
* Plans one isolated run: a unit per request on its whole test file, with
|
|
5
5
|
* limits that add up the work outside tries (loading the file and its suite
|
|
6
6
|
* hooks) and one try of every test of the file. Units that confirm a timeout
|
|
7
|
-
* get doubled
|
|
7
|
+
* get doubled time, and one that confirms a hit-limit timeout `factor × floor`
|
|
8
|
+
* more site evaluations, the same room for any test, as the time a test took,
|
|
9
|
+
* its hooks and waits included, does not tell how fast it evaluates sites.
|
|
8
10
|
*
|
|
9
11
|
* @param state - State of the run.
|
|
10
12
|
* @param requests - Mutants and test files to run, in order.
|
|
@@ -1,21 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getTestFileLimits as e } from "./get-test-file-limits.js";
|
|
2
2
|
function t(t, n) {
|
|
3
3
|
let { analysis: r, limits: i } = t;
|
|
4
|
-
return { units: n.map((
|
|
5
|
-
let
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}, i, n), o = r.fileTests.get(t.file);
|
|
9
|
-
if (o !== void 0) for (let t of o) {
|
|
10
|
-
let o = e(r.baselines.get(t), i, n);
|
|
11
|
-
a.hitLimit += o.hitLimit, a.timeout += o.timeout;
|
|
12
|
-
}
|
|
13
|
-
let { project: s, file: c } = r.testFiles.get(t.file);
|
|
4
|
+
return { units: n.map((n) => {
|
|
5
|
+
let a = e(t, n.file, n.confirming ? 2 : 1);
|
|
6
|
+
n.raised && (a.hitLimit += i.hitLimit.factor * i.hitLimit.floor);
|
|
7
|
+
let { project: o, file: s } = r.testFiles.get(n.file);
|
|
14
8
|
return {
|
|
15
|
-
mutant:
|
|
9
|
+
mutant: n.mutant,
|
|
16
10
|
limits: a,
|
|
17
|
-
project:
|
|
18
|
-
file:
|
|
11
|
+
project: o,
|
|
12
|
+
file: s
|
|
19
13
|
};
|
|
20
14
|
}) };
|
|
21
15
|
}
|
|
@@ -8,10 +8,12 @@ import { IsolatedUnit } from '../../types/adapter/isolated-plan.js';
|
|
|
8
8
|
* mutant, once the unit reached it anywhere. A unit past its hit limit is a
|
|
9
9
|
* timeout of the failed test with the most hits, the first of them on a tie:
|
|
10
10
|
* that one ran into the limit, while a test that failed before it says nothing
|
|
11
|
-
* of the
|
|
12
|
-
* unit stays over the limit. With no failed test, the limit stopped the
|
|
13
|
-
* a hook, whose error is the message. A hang names no test, as no
|
|
14
|
-
* reports the try that hung.
|
|
11
|
+
* of the overrun, and one after it throws at its first site, as the count of
|
|
12
|
+
* the unit stays over the limit. With no failed test, the limit stopped the
|
|
13
|
+
* load or a hook, whose error is the message. A hang names no test, as no
|
|
14
|
+
* adapter reports the try that hung. A unit without a kill or a timeout is
|
|
15
|
+
* inconclusive when something else stopped the tests that reach the mutant
|
|
16
|
+
* before they got to it (`readUndecidedUnit`).
|
|
15
17
|
*
|
|
16
18
|
* @param state - State of the run.
|
|
17
19
|
* @param mutant - State of the unit's mutant.
|
|
@@ -19,8 +21,9 @@ import { IsolatedUnit } from '../../types/adapter/isolated-plan.js';
|
|
|
19
21
|
* @param ran.request - Mutant and test file key of the unit.
|
|
20
22
|
* @param ran.unit - Unit of the plan.
|
|
21
23
|
* @param ran.facts - Facts the adapter reported for it.
|
|
22
|
-
* @returns Kill or timeout evidence, `
|
|
23
|
-
* when the unit decided
|
|
24
|
+
* @returns Kill or timeout evidence, an `Error` verdict for an inconclusive
|
|
25
|
+
* unit, `survived` for a reached pass, or null when the unit decided
|
|
26
|
+
* nothing.
|
|
24
27
|
*/
|
|
25
28
|
export declare function readIsolatedUnit(state: RunState, mutant: MutantState, ran: {
|
|
26
29
|
request: IsolatedRequest;
|
|
@@ -1,70 +1,109 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { getTestFileKey as e } from "./get-test-file-key.js";
|
|
2
|
+
import { getDisplayPath as t } from "./get-display-path.js";
|
|
3
|
+
import { pluralize as n } from "../text/pluralize.js";
|
|
4
|
+
import { classifyTry as r } from "./classify-try.js";
|
|
5
|
+
function i(e, t, n) {
|
|
6
|
+
let { request: i, facts: o, unit: s } = n, { analysis: c } = e, l = o.tests.filter((e) => e.failed || e.timedOut), [u] = l;
|
|
7
|
+
if (o.hits > s.limits.hitLimit) {
|
|
8
|
+
let [e] = l.toSorted((e, t) => t.hits - e.hits);
|
|
6
9
|
return {
|
|
7
|
-
message: e?.message ??
|
|
10
|
+
message: e?.message ?? o.loadError ?? o.hookError,
|
|
8
11
|
test: e?.test ?? null,
|
|
9
12
|
cause: "hit-limit",
|
|
10
13
|
status: "Timeout",
|
|
11
|
-
file:
|
|
14
|
+
file: s.file
|
|
12
15
|
};
|
|
13
16
|
}
|
|
14
|
-
if (
|
|
17
|
+
if (o.incomplete === "hang") return {
|
|
15
18
|
status: "Timeout",
|
|
16
|
-
file:
|
|
19
|
+
file: s.file,
|
|
17
20
|
message: null,
|
|
18
21
|
cause: "hang",
|
|
19
22
|
test: null
|
|
20
23
|
};
|
|
21
|
-
if (
|
|
22
|
-
test:
|
|
24
|
+
if (o.incomplete === "crash") return {
|
|
25
|
+
test: u?.test ?? null,
|
|
23
26
|
status: "Killed",
|
|
24
|
-
file:
|
|
27
|
+
file: s.file,
|
|
25
28
|
cause: "crash",
|
|
26
29
|
message: null
|
|
27
30
|
};
|
|
28
|
-
let
|
|
29
|
-
for (let
|
|
30
|
-
|
|
31
|
-
let
|
|
32
|
-
...
|
|
33
|
-
reached:
|
|
34
|
-
strays:
|
|
35
|
-
},
|
|
36
|
-
if (
|
|
37
|
-
message: i === "stray-error" ?
|
|
38
|
-
status:
|
|
39
|
-
file:
|
|
40
|
-
test:
|
|
31
|
+
let d = t.static && o.reached;
|
|
32
|
+
for (let e of o.tests) {
|
|
33
|
+
d ||= e.reached;
|
|
34
|
+
let t = c.strayTests.has(e.test) ? [] : e.strays, { outcome: n, cause: i } = r({
|
|
35
|
+
...e,
|
|
36
|
+
reached: d,
|
|
37
|
+
strays: t
|
|
38
|
+
}, s.limits, "isolated");
|
|
39
|
+
if (n === "killed" || n === "timeout") return {
|
|
40
|
+
message: i === "stray-error" ? t[0] : e.message,
|
|
41
|
+
status: n === "killed" ? "Killed" : "Timeout",
|
|
42
|
+
file: s.file,
|
|
43
|
+
test: e.test,
|
|
41
44
|
cause: i
|
|
42
45
|
};
|
|
43
46
|
}
|
|
44
|
-
return
|
|
45
|
-
message:
|
|
47
|
+
return o.timedOut ? o.reached ? {
|
|
48
|
+
message: o.hookError,
|
|
46
49
|
cause: "time-limit",
|
|
47
50
|
status: "Timeout",
|
|
48
|
-
file:
|
|
51
|
+
file: s.file,
|
|
49
52
|
test: null
|
|
50
|
-
} :
|
|
51
|
-
message:
|
|
53
|
+
} : a(e, t, n) : o.loadError === null ? o.reached && o.hookError !== null ? {
|
|
54
|
+
message: o.hookError,
|
|
52
55
|
cause: "hook-error",
|
|
53
56
|
status: "Killed",
|
|
54
|
-
file:
|
|
57
|
+
file: s.file,
|
|
55
58
|
test: null
|
|
56
|
-
} :
|
|
57
|
-
message:
|
|
59
|
+
} : o.reached && o.strays.length > 0 && !c.strayFiles.has(i.file) ? {
|
|
60
|
+
message: o.strays[0],
|
|
58
61
|
cause: "stray-error",
|
|
59
62
|
status: "Killed",
|
|
60
|
-
file:
|
|
63
|
+
file: s.file,
|
|
61
64
|
test: null
|
|
62
|
-
} : a
|
|
63
|
-
message:
|
|
65
|
+
} : a(e, t, n) : {
|
|
66
|
+
message: o.loadError,
|
|
64
67
|
cause: "load-error",
|
|
65
68
|
status: "Killed",
|
|
66
|
-
file:
|
|
69
|
+
file: s.file,
|
|
67
70
|
test: null
|
|
68
71
|
};
|
|
69
72
|
}
|
|
70
|
-
|
|
73
|
+
function a(t, n, r) {
|
|
74
|
+
let { request: i, facts: a, unit: s } = r, { analysis: c } = t, l = a.tests.filter((e) => e.failed || e.timedOut), u = a.hookError ?? (a.strays.length > 0 && !c.strayFiles.has(i.file) ? a.strays[0] : null);
|
|
75
|
+
if (u !== null || l.length > 0) {
|
|
76
|
+
let r = a.tests.filter((e) => !e.failed && !e.timedOut), d = new Set(r.map((e) => e.test)), f = new Set(a.tests.map((e) => e.test)), p = r.some((e) => !c.tests.has(e.test)), m = n.coveredBy.filter((t) => !d.has(t) && (!p || f.has(t)) && e(c.tests.get(t)) === i.file);
|
|
77
|
+
if (m.length > 0) return {
|
|
78
|
+
message: o(t, s.file, {
|
|
79
|
+
stopped: l,
|
|
80
|
+
outside: u,
|
|
81
|
+
missed: m
|
|
82
|
+
}),
|
|
83
|
+
status: "Error",
|
|
84
|
+
cause: null,
|
|
85
|
+
file: null,
|
|
86
|
+
test: null
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
return a.reached ? "survived" : null;
|
|
90
|
+
}
|
|
91
|
+
function o(e, r, i) {
|
|
92
|
+
let a = t(r, e.root), o = i.stopped.find((e) => i.missed.includes(e.test));
|
|
93
|
+
if (o !== void 0) {
|
|
94
|
+
let [t, n] = s(o);
|
|
95
|
+
return `"${c(e, o.test)}" in ${a} ${t} before it reached this mutant${n}`;
|
|
96
|
+
}
|
|
97
|
+
let l = i.missed.length, u = `${n(l, "test")} in ${a} that ${l === 1 ? "reaches" : "reach"} this mutant did not run`;
|
|
98
|
+
if (i.outside !== null) return `${u}: ${i.outside}`;
|
|
99
|
+
let d = i.stopped[0], [f, p] = s(d);
|
|
100
|
+
return `${u} after "${c(e, d.test)}" ${f}${p}`;
|
|
101
|
+
}
|
|
102
|
+
function s(e) {
|
|
103
|
+
let t = e.message === null ? "." : `: ${e.message}`;
|
|
104
|
+
return e.timedOut ? [e.message === null ? "ran past the time limit of its test file" : "ran out of time", t] : ["failed", t];
|
|
105
|
+
}
|
|
106
|
+
function c(e, t) {
|
|
107
|
+
return e.analysis.tests.get(t)?.name ?? t;
|
|
108
|
+
}
|
|
109
|
+
export { i as readIsolatedUnit };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Removes the work directories of runs of this process that are not removed
|
|
3
|
+
* yet, at once and with everything in them, and forgets them, as the last
|
|
4
|
+
* cleanup before the process ends: a directory that cannot be removed is left
|
|
5
|
+
* as it is, so the process still ends.
|
|
6
|
+
*/
|
|
7
|
+
export declare function removeLiveWorkDirectories(): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LIVE_WORK_DIRECTORIES as e } from "./live-work-directories.js";
|
|
2
|
+
import { rmSync as t } from "node:fs";
|
|
3
|
+
function n() {
|
|
4
|
+
for (let n of e) try {
|
|
5
|
+
t(n, {
|
|
6
|
+
recursive: !0,
|
|
7
|
+
force: !0
|
|
8
|
+
});
|
|
9
|
+
} catch {}
|
|
10
|
+
e.clear();
|
|
11
|
+
}
|
|
12
|
+
export { n as removeLiveWorkDirectories };
|
|
@@ -6,9 +6,10 @@ import { RunState } from '../../types/run/run-state.js';
|
|
|
6
6
|
* all their other covering tests. Tries that go missing are planned again in at
|
|
7
7
|
* most two recovery runs per phase, then the mutant runs isolated. A mutant
|
|
8
8
|
* that only ran out of time skips phase 2; the confirmation run tries those
|
|
9
|
-
* again with
|
|
10
|
-
* timeouts only: every mutant left
|
|
11
|
-
* `batch-survivor` when a batch try reached it
|
|
9
|
+
* again with twice the time of their whole test file and half the workers.
|
|
10
|
+
* Batch decides kills and timer or hang timeouts only: every mutant left
|
|
11
|
+
* undecided runs isolated, as a `batch-survivor` when a batch try reached it
|
|
12
|
+
* and passed, else as `doubtful`.
|
|
12
13
|
*
|
|
13
14
|
* @param session - Live test runner.
|
|
14
15
|
* @param state - State of the run, updated in place.
|
|
@@ -12,8 +12,8 @@ interface DryPhaseInput {
|
|
|
12
12
|
*/
|
|
13
13
|
mutantFiles: Map<string, string>;
|
|
14
14
|
/**
|
|
15
|
-
* Receives `dry-start` as the dry phase starts
|
|
16
|
-
* run
|
|
15
|
+
* Receives `dry-start` as the dry phase starts, a `dry-again` before each
|
|
16
|
+
* later dry run, and `dry-failed` before failing tests stop the run.
|
|
17
17
|
*/
|
|
18
18
|
report(event: RunEvent): void;
|
|
19
19
|
/**
|
|
@@ -25,6 +25,13 @@ interface DryPhaseInput {
|
|
|
25
25
|
* place before the dry run is repeated.
|
|
26
26
|
*/
|
|
27
27
|
switched: SwitchedFile[];
|
|
28
|
+
/**
|
|
29
|
+
* Absolute paths of the files the dry runs relate tests to: the switched
|
|
30
|
+
* files and, in a run of some mutants, the other files a run of every mutant
|
|
31
|
+
* would switch, which are served as they are. Files that break tests are left
|
|
32
|
+
* out of the repeated dry run.
|
|
33
|
+
*/
|
|
34
|
+
related: string[];
|
|
28
35
|
/**
|
|
29
36
|
* Whether every test is tried twice in a row, as fast mode needs to tell
|
|
30
37
|
* stable mutants and repeatable tests; otherwise each test runs once.
|
|
@@ -50,7 +57,9 @@ interface DryPhase {
|
|
|
50
57
|
*/
|
|
51
58
|
errors: Map<string, string>;
|
|
52
59
|
/**
|
|
53
|
-
* `instrumentation-break`, `instrument-error` and `never-served` diagnostics
|
|
60
|
+
* `instrumentation-break`, `instrument-error` and `never-served` diagnostics,
|
|
61
|
+
* and outside fast mode an `unrepeatable-test` warning for each failure of a
|
|
62
|
+
* test file that passed when it ran again.
|
|
54
63
|
*/
|
|
55
64
|
diagnostics: Diagnostic[];
|
|
56
65
|
/**
|
|
@@ -63,24 +72,31 @@ interface DryPhase {
|
|
|
63
72
|
runs: number;
|
|
64
73
|
}
|
|
65
74
|
/**
|
|
66
|
-
* Runs the tests related to the
|
|
67
|
-
* in fast mode (`repeat`) twice in a row.
|
|
68
|
-
*
|
|
69
|
-
* plain run of the test runner does
|
|
70
|
-
* or collected results, that fails the next
|
|
71
|
-
*
|
|
72
|
-
* run and are unrepeatable
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
* `
|
|
79
|
-
*
|
|
80
|
-
*
|
|
75
|
+
* Runs the tests related to the given files (`related`) without a mutant, each
|
|
76
|
+
* once, or in fast mode (`repeat`) twice in a row. When tests fail or files
|
|
77
|
+
* fail to load, their test files run again with the same switched files and
|
|
78
|
+
* each test once, as a plain run of the test runner does. In fast mode a try
|
|
79
|
+
* can leave state, such as a counter or collected results, that fails the next
|
|
80
|
+
* test or a suite hook only because the tests were repeated: test files that
|
|
81
|
+
* pass then keep the results of that run and are unrepeatable, so every mutant
|
|
82
|
+
* their tests reach runs isolated. Outside fast mode a test file that passes
|
|
83
|
+
* then may be flaky, such as one that waits for a port or a resource: it keeps
|
|
84
|
+
* the results of that run, and each of its failures gets an `unrepeatable-test`
|
|
85
|
+
* warning. Failures that remain run again without the switched files: failures
|
|
86
|
+
* that remain are real and stop the run; the others come from the
|
|
87
|
+
* instrumentation (`findBrokenFiles`). The switched files they break are
|
|
88
|
+
* dropped with an `instrumentation-break` error that names a failure, and while
|
|
89
|
+
* switched files are left the dry run is repeated once, with its own second run
|
|
90
|
+
* of failed test files. So the phase takes one dry run when nothing fails, and
|
|
91
|
+
* at most five. Files whose loaded text differed get an `instrument-error`,
|
|
92
|
+
* files never served a `never-served` warning. Without related tests the dry
|
|
93
|
+
* run is empty, so every mutant ends without coverage. A dry run whose worker
|
|
94
|
+
* hung past its budget (`DRY_TIMEOUTS`) stops the run with the test it hung
|
|
95
|
+
* in.
|
|
81
96
|
*
|
|
82
97
|
* @param session - Live test runner.
|
|
83
|
-
* @param input - Switched files, mutant files, display paths and
|
|
98
|
+
* @param input - Switched and related files, mutant files, display paths and
|
|
99
|
+
* progress.
|
|
84
100
|
* @returns Final dry run, failed files, unrepeatable test files, diagnostics
|
|
85
101
|
* and the number of runs.
|
|
86
102
|
* @throws Error - When tests fail without the switched files, when tests still
|