@d-es-ign/stryker-js-core 9.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +96 -0
- package/bin/stryker +2 -0
- package/bin/stryker.js +6 -0
- package/dist/src/checker/checker-child-process-proxy.d.ts +16 -0
- package/dist/src/checker/checker-child-process-proxy.d.ts.map +1 -0
- package/dist/src/checker/checker-child-process-proxy.js +22 -0
- package/dist/src/checker/checker-child-process-proxy.js.map +1 -0
- package/dist/src/checker/checker-facade.d.ts +9 -0
- package/dist/src/checker/checker-facade.d.ts.map +1 -0
- package/dist/src/checker/checker-facade.js +52 -0
- package/dist/src/checker/checker-facade.js.map +1 -0
- package/dist/src/checker/checker-factory.d.ts +10 -0
- package/dist/src/checker/checker-factory.d.ts.map +1 -0
- package/dist/src/checker/checker-factory.js +10 -0
- package/dist/src/checker/checker-factory.js.map +1 -0
- package/dist/src/checker/checker-resource.d.ts +8 -0
- package/dist/src/checker/checker-resource.d.ts.map +1 -0
- package/dist/src/checker/checker-resource.js +2 -0
- package/dist/src/checker/checker-resource.js.map +1 -0
- package/dist/src/checker/checker-retry-decorator.d.ts +12 -0
- package/dist/src/checker/checker-retry-decorator.d.ts.map +1 -0
- package/dist/src/checker/checker-retry-decorator.js +37 -0
- package/dist/src/checker/checker-retry-decorator.js.map +1 -0
- package/dist/src/checker/checker-worker.d.ts +14 -0
- package/dist/src/checker/checker-worker.d.ts.map +1 -0
- package/dist/src/checker/checker-worker.js +41 -0
- package/dist/src/checker/checker-worker.js.map +1 -0
- package/dist/src/checker/index.d.ts +4 -0
- package/dist/src/checker/index.d.ts.map +1 -0
- package/dist/src/checker/index.js +4 -0
- package/dist/src/checker/index.js.map +1 -0
- package/dist/src/child-proxy/child-process-crashed-error.d.ts +8 -0
- package/dist/src/child-proxy/child-process-crashed-error.d.ts.map +1 -0
- package/dist/src/child-proxy/child-process-crashed-error.js +16 -0
- package/dist/src/child-proxy/child-process-crashed-error.js.map +1 -0
- package/dist/src/child-proxy/child-process-proxy-worker.d.ts +32 -0
- package/dist/src/child-proxy/child-process-proxy-worker.d.ts.map +1 -0
- package/dist/src/child-proxy/child-process-proxy-worker.js +148 -0
- package/dist/src/child-proxy/child-process-proxy-worker.js.map +1 -0
- package/dist/src/child-proxy/child-process-proxy.d.ts +45 -0
- package/dist/src/child-proxy/child-process-proxy.d.ts.map +1 -0
- package/dist/src/child-proxy/child-process-proxy.js +232 -0
- package/dist/src/child-proxy/child-process-proxy.js.map +1 -0
- package/dist/src/child-proxy/id-generator.d.ts +5 -0
- package/dist/src/child-proxy/id-generator.d.ts.map +1 -0
- package/dist/src/child-proxy/id-generator.js +7 -0
- package/dist/src/child-proxy/id-generator.js.map +1 -0
- package/dist/src/child-proxy/message-protocol.d.ts +71 -0
- package/dist/src/child-proxy/message-protocol.d.ts.map +1 -0
- package/dist/src/child-proxy/message-protocol.js +34 -0
- package/dist/src/child-proxy/message-protocol.js.map +1 -0
- package/dist/src/child-proxy/out-of-memory-error.d.ts +5 -0
- package/dist/src/child-proxy/out-of-memory-error.d.ts.map +1 -0
- package/dist/src/child-proxy/out-of-memory-error.js +11 -0
- package/dist/src/child-proxy/out-of-memory-error.js.map +1 -0
- package/dist/src/concurrent/concurrency-token-provider.d.ts +20 -0
- package/dist/src/concurrent/concurrency-token-provider.d.ts.map +1 -0
- package/dist/src/concurrent/concurrency-token-provider.js +68 -0
- package/dist/src/concurrent/concurrency-token-provider.js.map +1 -0
- package/dist/src/concurrent/index.d.ts +4 -0
- package/dist/src/concurrent/index.d.ts.map +1 -0
- package/dist/src/concurrent/index.js +4 -0
- package/dist/src/concurrent/index.js.map +1 -0
- package/dist/src/concurrent/pool.d.ts +49 -0
- package/dist/src/concurrent/pool.d.ts.map +1 -0
- package/dist/src/concurrent/pool.js +137 -0
- package/dist/src/concurrent/pool.js.map +1 -0
- package/dist/src/concurrent/resource-decorator.d.ts +14 -0
- package/dist/src/concurrent/resource-decorator.d.ts.map +1 -0
- package/dist/src/concurrent/resource-decorator.js +24 -0
- package/dist/src/concurrent/resource-decorator.js.map +1 -0
- package/dist/src/config/config-file-formats.d.ts +6 -0
- package/dist/src/config/config-file-formats.d.ts.map +1 -0
- package/dist/src/config/config-file-formats.js +23 -0
- package/dist/src/config/config-file-formats.js.map +1 -0
- package/dist/src/config/config-reader.d.ts +23 -0
- package/dist/src/config/config-reader.d.ts.map +1 -0
- package/dist/src/config/config-reader.js +141 -0
- package/dist/src/config/config-reader.js.map +1 -0
- package/dist/src/config/file-matcher.d.ts +10 -0
- package/dist/src/config/file-matcher.d.ts.map +1 -0
- package/dist/src/config/file-matcher.js +31 -0
- package/dist/src/config/file-matcher.js.map +1 -0
- package/dist/src/config/index.d.ts +6 -0
- package/dist/src/config/index.d.ts.map +1 -0
- package/dist/src/config/index.js +6 -0
- package/dist/src/config/index.js.map +1 -0
- package/dist/src/config/meta-schema-builder.d.ts +10 -0
- package/dist/src/config/meta-schema-builder.d.ts.map +1 -0
- package/dist/src/config/meta-schema-builder.js +30 -0
- package/dist/src/config/meta-schema-builder.js.map +1 -0
- package/dist/src/config/options-validator.d.ts +28 -0
- package/dist/src/config/options-validator.d.ts.map +1 -0
- package/dist/src/config/options-validator.js +213 -0
- package/dist/src/config/options-validator.js.map +1 -0
- package/dist/src/config/validation-errors.d.ts +7 -0
- package/dist/src/config/validation-errors.d.ts.map +1 -0
- package/dist/src/config/validation-errors.js +154 -0
- package/dist/src/config/validation-errors.js.map +1 -0
- package/dist/src/di/core-tokens.d.ts +40 -0
- package/dist/src/di/core-tokens.d.ts.map +1 -0
- package/dist/src/di/core-tokens.js +40 -0
- package/dist/src/di/core-tokens.js.map +1 -0
- package/dist/src/di/index.d.ts +4 -0
- package/dist/src/di/index.d.ts.map +1 -0
- package/dist/src/di/index.js +4 -0
- package/dist/src/di/index.js.map +1 -0
- package/dist/src/di/plugin-creator.d.ts +10 -0
- package/dist/src/di/plugin-creator.d.ts.map +1 -0
- package/dist/src/di/plugin-creator.js +51 -0
- package/dist/src/di/plugin-creator.js.map +1 -0
- package/dist/src/di/plugin-loader.d.ts +41 -0
- package/dist/src/di/plugin-loader.d.ts.map +1 -0
- package/dist/src/di/plugin-loader.js +153 -0
- package/dist/src/di/plugin-loader.js.map +1 -0
- package/dist/src/errors.d.ts +5 -0
- package/dist/src/errors.d.ts.map +1 -0
- package/dist/src/errors.js +13 -0
- package/dist/src/errors.js.map +1 -0
- package/dist/src/fs/file-system.d.ts +19 -0
- package/dist/src/fs/file-system.d.ts.map +1 -0
- package/dist/src/fs/file-system.js +52 -0
- package/dist/src/fs/file-system.js.map +1 -0
- package/dist/src/fs/index.d.ts +5 -0
- package/dist/src/fs/index.d.ts.map +1 -0
- package/dist/src/fs/index.js +5 -0
- package/dist/src/fs/index.js.map +1 -0
- package/dist/src/fs/project-file.d.ts +26 -0
- package/dist/src/fs/project-file.d.ts.map +1 -0
- package/dist/src/fs/project-file.js +87 -0
- package/dist/src/fs/project-file.js.map +1 -0
- package/dist/src/fs/project-reader.d.ts +51 -0
- package/dist/src/fs/project-reader.d.ts.map +1 -0
- package/dist/src/fs/project-reader.js +335 -0
- package/dist/src/fs/project-reader.js.map +1 -0
- package/dist/src/fs/project.d.ts +22 -0
- package/dist/src/fs/project.d.ts.map +1 -0
- package/dist/src/fs/project.js +65 -0
- package/dist/src/fs/project.js.map +1 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +6 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/initializer/custom-initializers/angular-initializer.d.ts +17 -0
- package/dist/src/initializer/custom-initializers/angular-initializer.d.ts.map +1 -0
- package/dist/src/initializer/custom-initializers/angular-initializer.js +74 -0
- package/dist/src/initializer/custom-initializers/angular-initializer.js.map +1 -0
- package/dist/src/initializer/custom-initializers/custom-initializer.d.ts +13 -0
- package/dist/src/initializer/custom-initializers/custom-initializer.d.ts.map +1 -0
- package/dist/src/initializer/custom-initializers/custom-initializer.js +2 -0
- package/dist/src/initializer/custom-initializers/custom-initializer.js.map +1 -0
- package/dist/src/initializer/custom-initializers/index.d.ts +14 -0
- package/dist/src/initializer/custom-initializers/index.d.ts.map +1 -0
- package/dist/src/initializer/custom-initializers/index.js +16 -0
- package/dist/src/initializer/custom-initializers/index.js.map +1 -0
- package/dist/src/initializer/custom-initializers/react-initializer.d.ts +12 -0
- package/dist/src/initializer/custom-initializers/react-initializer.d.ts.map +1 -0
- package/dist/src/initializer/custom-initializers/react-initializer.js +25 -0
- package/dist/src/initializer/custom-initializers/react-initializer.js.map +1 -0
- package/dist/src/initializer/custom-initializers/svelte-initializer.d.ts +6 -0
- package/dist/src/initializer/custom-initializers/svelte-initializer.d.ts.map +1 -0
- package/dist/src/initializer/custom-initializers/svelte-initializer.js +33 -0
- package/dist/src/initializer/custom-initializers/svelte-initializer.js.map +1 -0
- package/dist/src/initializer/custom-initializers/vue-js-initializer.d.ts +11 -0
- package/dist/src/initializer/custom-initializers/vue-js-initializer.d.ts.map +1 -0
- package/dist/src/initializer/custom-initializers/vue-js-initializer.js +20 -0
- package/dist/src/initializer/custom-initializers/vue-js-initializer.js.map +1 -0
- package/dist/src/initializer/gitignore-writer.d.ts +7 -0
- package/dist/src/initializer/gitignore-writer.d.ts.map +1 -0
- package/dist/src/initializer/gitignore-writer.js +28 -0
- package/dist/src/initializer/gitignore-writer.js.map +1 -0
- package/dist/src/initializer/index.d.ts +6 -0
- package/dist/src/initializer/index.d.ts.map +1 -0
- package/dist/src/initializer/index.js +29 -0
- package/dist/src/initializer/index.js.map +1 -0
- package/dist/src/initializer/initializer-tokens.d.ts +9 -0
- package/dist/src/initializer/initializer-tokens.d.ts.map +1 -0
- package/dist/src/initializer/initializer-tokens.js +9 -0
- package/dist/src/initializer/initializer-tokens.js.map +1 -0
- package/dist/src/initializer/inquire.d.ts +12 -0
- package/dist/src/initializer/inquire.d.ts.map +1 -0
- package/dist/src/initializer/inquire.js +12 -0
- package/dist/src/initializer/inquire.js.map +1 -0
- package/dist/src/initializer/npm-client.d.ts +22 -0
- package/dist/src/initializer/npm-client.d.ts.map +1 -0
- package/dist/src/initializer/npm-client.js +65 -0
- package/dist/src/initializer/npm-client.js.map +1 -0
- package/dist/src/initializer/npm-registry.d.ts +13 -0
- package/dist/src/initializer/npm-registry.d.ts.map +1 -0
- package/dist/src/initializer/npm-registry.js +36 -0
- package/dist/src/initializer/npm-registry.js.map +1 -0
- package/dist/src/initializer/package-info.d.ts +10 -0
- package/dist/src/initializer/package-info.d.ts.map +1 -0
- package/dist/src/initializer/package-info.js +2 -0
- package/dist/src/initializer/package-info.js.map +1 -0
- package/dist/src/initializer/prompt-option.d.ts +6 -0
- package/dist/src/initializer/prompt-option.d.ts.map +1 -0
- package/dist/src/initializer/prompt-option.js +2 -0
- package/dist/src/initializer/prompt-option.js.map +1 -0
- package/dist/src/initializer/stryker-config-writer.d.ts +27 -0
- package/dist/src/initializer/stryker-config-writer.d.ts.map +1 -0
- package/dist/src/initializer/stryker-config-writer.js +106 -0
- package/dist/src/initializer/stryker-config-writer.js.map +1 -0
- package/dist/src/initializer/stryker-initializer.d.ts +45 -0
- package/dist/src/initializer/stryker-initializer.d.ts.map +1 -0
- package/dist/src/initializer/stryker-initializer.js +184 -0
- package/dist/src/initializer/stryker-initializer.js.map +1 -0
- package/dist/src/initializer/stryker-inquirer.d.ts +15 -0
- package/dist/src/initializer/stryker-inquirer.d.ts.map +1 -0
- package/dist/src/initializer/stryker-inquirer.js +72 -0
- package/dist/src/initializer/stryker-inquirer.js.map +1 -0
- package/dist/src/logging/index.d.ts +6 -0
- package/dist/src/logging/index.d.ts.map +1 -0
- package/dist/src/logging/index.js +5 -0
- package/dist/src/logging/index.js.map +1 -0
- package/dist/src/logging/logger-impl.d.ts +19 -0
- package/dist/src/logging/logger-impl.d.ts.map +1 -0
- package/dist/src/logging/logger-impl.js +64 -0
- package/dist/src/logging/logger-impl.js.map +1 -0
- package/dist/src/logging/logging-backend.d.ts +22 -0
- package/dist/src/logging/logging-backend.d.ts.map +1 -0
- package/dist/src/logging/logging-backend.js +65 -0
- package/dist/src/logging/logging-backend.js.map +1 -0
- package/dist/src/logging/logging-client.d.ts +16 -0
- package/dist/src/logging/logging-client.d.ts.map +1 -0
- package/dist/src/logging/logging-client.js +44 -0
- package/dist/src/logging/logging-client.js.map +1 -0
- package/dist/src/logging/logging-event.d.ts +23 -0
- package/dist/src/logging/logging-event.d.ts.map +1 -0
- package/dist/src/logging/logging-event.js +63 -0
- package/dist/src/logging/logging-event.js.map +1 -0
- package/dist/src/logging/logging-server.d.ts +15 -0
- package/dist/src/logging/logging-server.d.ts.map +1 -0
- package/dist/src/logging/logging-server.js +43 -0
- package/dist/src/logging/logging-server.js.map +1 -0
- package/dist/src/logging/logging-sink.d.ts +7 -0
- package/dist/src/logging/logging-sink.d.ts.map +1 -0
- package/dist/src/logging/logging-sink.js +2 -0
- package/dist/src/logging/logging-sink.js.map +1 -0
- package/dist/src/logging/priority.d.ts +12 -0
- package/dist/src/logging/priority.d.ts.map +1 -0
- package/dist/src/logging/priority.js +13 -0
- package/dist/src/logging/priority.js.map +1 -0
- package/dist/src/logging/provide-logging.d.ts +30 -0
- package/dist/src/logging/provide-logging.d.ts.map +1 -0
- package/dist/src/logging/provide-logging.js +45 -0
- package/dist/src/logging/provide-logging.js.map +1 -0
- package/dist/src/mutants/diff-statistics-collector.d.ts +14 -0
- package/dist/src/mutants/diff-statistics-collector.d.ts.map +1 -0
- package/dist/src/mutants/diff-statistics-collector.js +40 -0
- package/dist/src/mutants/diff-statistics-collector.js.map +1 -0
- package/dist/src/mutants/incremental-differ.d.ts +39 -0
- package/dist/src/mutants/incremental-differ.d.ts.map +1 -0
- package/dist/src/mutants/incremental-differ.js +547 -0
- package/dist/src/mutants/incremental-differ.js.map +1 -0
- package/dist/src/mutants/index.d.ts +4 -0
- package/dist/src/mutants/index.d.ts.map +1 -0
- package/dist/src/mutants/index.js +4 -0
- package/dist/src/mutants/index.js.map +1 -0
- package/dist/src/mutants/mutant-test-planner.d.ts +36 -0
- package/dist/src/mutants/mutant-test-planner.d.ts.map +1 -0
- package/dist/src/mutants/mutant-test-planner.js +237 -0
- package/dist/src/mutants/mutant-test-planner.js.map +1 -0
- package/dist/src/mutants/test-coverage.d.ts +22 -0
- package/dist/src/mutants/test-coverage.d.ts.map +1 -0
- package/dist/src/mutants/test-coverage.js +87 -0
- package/dist/src/mutants/test-coverage.js.map +1 -0
- package/dist/src/process/1-prepare-executor.d.ts +22 -0
- package/dist/src/process/1-prepare-executor.d.ts.map +1 -0
- package/dist/src/process/1-prepare-executor.js +86 -0
- package/dist/src/process/1-prepare-executor.js.map +1 -0
- package/dist/src/process/2-mutant-instrumenter-executor.d.ts +39 -0
- package/dist/src/process/2-mutant-instrumenter-executor.d.ts.map +1 -0
- package/dist/src/process/2-mutant-instrumenter-executor.js +58 -0
- package/dist/src/process/2-mutant-instrumenter-executor.js.map +1 -0
- package/dist/src/process/3-dry-run-executor.d.ts +50 -0
- package/dist/src/process/3-dry-run-executor.d.ts.map +1 -0
- package/dist/src/process/3-dry-run-executor.js +164 -0
- package/dist/src/process/3-dry-run-executor.js.map +1 -0
- package/dist/src/process/4-mutation-test-executor.d.ts +56 -0
- package/dist/src/process/4-mutation-test-executor.d.ts.map +1 -0
- package/dist/src/process/4-mutation-test-executor.js +152 -0
- package/dist/src/process/4-mutation-test-executor.js.map +1 -0
- package/dist/src/process/index.d.ts +5 -0
- package/dist/src/process/index.d.ts.map +1 -0
- package/dist/src/process/index.js +5 -0
- package/dist/src/process/index.js.map +1 -0
- package/dist/src/reporters/broadcast-reporter.d.ts +25 -0
- package/dist/src/reporters/broadcast-reporter.d.ts.map +1 -0
- package/dist/src/reporters/broadcast-reporter.js +74 -0
- package/dist/src/reporters/broadcast-reporter.js.map +1 -0
- package/dist/src/reporters/ci/circle-provider.d.ts +11 -0
- package/dist/src/reporters/ci/circle-provider.d.ts.map +1 -0
- package/dist/src/reporters/ci/circle-provider.js +33 -0
- package/dist/src/reporters/ci/circle-provider.js.map +1 -0
- package/dist/src/reporters/ci/github-actions-provider.d.ts +9 -0
- package/dist/src/reporters/ci/github-actions-provider.d.ts.map +1 -0
- package/dist/src/reporters/ci/github-actions-provider.js +21 -0
- package/dist/src/reporters/ci/github-actions-provider.js.map +1 -0
- package/dist/src/reporters/ci/provider.d.ts +22 -0
- package/dist/src/reporters/ci/provider.d.ts.map +1 -0
- package/dist/src/reporters/ci/provider.js +24 -0
- package/dist/src/reporters/ci/provider.js.map +1 -0
- package/dist/src/reporters/ci/travis-provider.d.ts +9 -0
- package/dist/src/reporters/ci/travis-provider.d.ts.map +1 -0
- package/dist/src/reporters/ci/travis-provider.js +19 -0
- package/dist/src/reporters/ci/travis-provider.js.map +1 -0
- package/dist/src/reporters/clear-text-reporter.d.ts +23 -0
- package/dist/src/reporters/clear-text-reporter.d.ts.map +1 -0
- package/dist/src/reporters/clear-text-reporter.js +174 -0
- package/dist/src/reporters/clear-text-reporter.js.map +1 -0
- package/dist/src/reporters/clear-text-score-table.d.ts +22 -0
- package/dist/src/reporters/clear-text-score-table.d.ts.map +1 -0
- package/dist/src/reporters/clear-text-score-table.js +191 -0
- package/dist/src/reporters/clear-text-score-table.js.map +1 -0
- package/dist/src/reporters/dashboard-reporter/dashboard-reporter-client.d.ts +19 -0
- package/dist/src/reporters/dashboard-reporter/dashboard-reporter-client.d.ts.map +1 -0
- package/dist/src/reporters/dashboard-reporter/dashboard-reporter-client.js +54 -0
- package/dist/src/reporters/dashboard-reporter/dashboard-reporter-client.js.map +1 -0
- package/dist/src/reporters/dashboard-reporter/dashboard-reporter.d.ts +21 -0
- package/dist/src/reporters/dashboard-reporter/dashboard-reporter.d.ts.map +1 -0
- package/dist/src/reporters/dashboard-reporter/dashboard-reporter.js +62 -0
- package/dist/src/reporters/dashboard-reporter/dashboard-reporter.js.map +1 -0
- package/dist/src/reporters/dashboard-reporter/index.d.ts +7 -0
- package/dist/src/reporters/dashboard-reporter/index.d.ts.map +1 -0
- package/dist/src/reporters/dashboard-reporter/index.js +15 -0
- package/dist/src/reporters/dashboard-reporter/index.js.map +1 -0
- package/dist/src/reporters/dashboard-reporter/report.d.ts +6 -0
- package/dist/src/reporters/dashboard-reporter/report.d.ts.map +1 -0
- package/dist/src/reporters/dashboard-reporter/report.js +2 -0
- package/dist/src/reporters/dashboard-reporter/report.js.map +1 -0
- package/dist/src/reporters/dashboard-reporter/tokens.d.ts +6 -0
- package/dist/src/reporters/dashboard-reporter/tokens.d.ts.map +1 -0
- package/dist/src/reporters/dashboard-reporter/tokens.js +6 -0
- package/dist/src/reporters/dashboard-reporter/tokens.js.map +1 -0
- package/dist/src/reporters/dots-reporter.d.ts +7 -0
- package/dist/src/reporters/dots-reporter.d.ts.map +1 -0
- package/dist/src/reporters/dots-reporter.js +29 -0
- package/dist/src/reporters/dots-reporter.js.map +1 -0
- package/dist/src/reporters/event-recorder-reporter.d.ts +22 -0
- package/dist/src/reporters/event-recorder-reporter.d.ts.map +1 -0
- package/dist/src/reporters/event-recorder-reporter.js +53 -0
- package/dist/src/reporters/event-recorder-reporter.js.map +1 -0
- package/dist/src/reporters/html-reporter.d.ts +14 -0
- package/dist/src/reporters/html-reporter.d.ts.map +1 -0
- package/dist/src/reporters/html-reporter.js +65 -0
- package/dist/src/reporters/html-reporter.js.map +1 -0
- package/dist/src/reporters/index.d.ts +6 -0
- package/dist/src/reporters/index.d.ts.map +1 -0
- package/dist/src/reporters/index.js +24 -0
- package/dist/src/reporters/index.js.map +1 -0
- package/dist/src/reporters/json-reporter.d.ts +15 -0
- package/dist/src/reporters/json-reporter.d.ts.map +1 -0
- package/dist/src/reporters/json-reporter.js +29 -0
- package/dist/src/reporters/json-reporter.js.map +1 -0
- package/dist/src/reporters/mutation-test-report-helper.d.ts +40 -0
- package/dist/src/reporters/mutation-test-report-helper.d.ts.map +1 -0
- package/dist/src/reporters/mutation-test-report-helper.js +298 -0
- package/dist/src/reporters/mutation-test-report-helper.js.map +1 -0
- package/dist/src/reporters/mutation-timings-reporter.d.ts +14 -0
- package/dist/src/reporters/mutation-timings-reporter.d.ts.map +1 -0
- package/dist/src/reporters/mutation-timings-reporter.js +49 -0
- package/dist/src/reporters/mutation-timings-reporter.js.map +1 -0
- package/dist/src/reporters/progress-append-only-reporter.d.ts +10 -0
- package/dist/src/reporters/progress-append-only-reporter.d.ts.map +1 -0
- package/dist/src/reporters/progress-append-only-reporter.js +25 -0
- package/dist/src/reporters/progress-append-only-reporter.js.map +1 -0
- package/dist/src/reporters/progress-bar.d.ts +8 -0
- package/dist/src/reporters/progress-bar.d.ts.map +1 -0
- package/dist/src/reporters/progress-bar.js +6 -0
- package/dist/src/reporters/progress-bar.js.map +1 -0
- package/dist/src/reporters/progress-keeper.d.ts +27 -0
- package/dist/src/reporters/progress-keeper.d.ts.map +1 -0
- package/dist/src/reporters/progress-keeper.js +77 -0
- package/dist/src/reporters/progress-keeper.js.map +1 -0
- package/dist/src/reporters/progress-reporter.d.ts +11 -0
- package/dist/src/reporters/progress-reporter.d.ts.map +1 -0
- package/dist/src/reporters/progress-reporter.js +40 -0
- package/dist/src/reporters/progress-reporter.js.map +1 -0
- package/dist/src/reporters/reporter-util.d.ts +5 -0
- package/dist/src/reporters/reporter-util.d.ts.map +1 -0
- package/dist/src/reporters/reporter-util.js +19 -0
- package/dist/src/reporters/reporter-util.js.map +1 -0
- package/dist/src/reporters/strict-reporter.d.ts +3 -0
- package/dist/src/reporters/strict-reporter.d.ts.map +1 -0
- package/dist/src/reporters/strict-reporter.js +2 -0
- package/dist/src/reporters/strict-reporter.js.map +1 -0
- package/dist/src/sandbox/create-preprocessor.d.ts +7 -0
- package/dist/src/sandbox/create-preprocessor.d.ts.map +1 -0
- package/dist/src/sandbox/create-preprocessor.js +16 -0
- package/dist/src/sandbox/create-preprocessor.js.map +1 -0
- package/dist/src/sandbox/disable-type-checks-preprocessor.d.ts +18 -0
- package/dist/src/sandbox/disable-type-checks-preprocessor.d.ts.map +1 -0
- package/dist/src/sandbox/disable-type-checks-preprocessor.js +43 -0
- package/dist/src/sandbox/disable-type-checks-preprocessor.js.map +1 -0
- package/dist/src/sandbox/file-preprocessor.d.ts +10 -0
- package/dist/src/sandbox/file-preprocessor.d.ts.map +1 -0
- package/dist/src/sandbox/file-preprocessor.js +2 -0
- package/dist/src/sandbox/file-preprocessor.js.map +1 -0
- package/dist/src/sandbox/index.d.ts +4 -0
- package/dist/src/sandbox/index.d.ts.map +1 -0
- package/dist/src/sandbox/index.js +3 -0
- package/dist/src/sandbox/index.js.map +1 -0
- package/dist/src/sandbox/multi-preprocessor.d.ts +8 -0
- package/dist/src/sandbox/multi-preprocessor.d.ts.map +1 -0
- package/dist/src/sandbox/multi-preprocessor.js +12 -0
- package/dist/src/sandbox/multi-preprocessor.js.map +1 -0
- package/dist/src/sandbox/sandbox.d.ts +43 -0
- package/dist/src/sandbox/sandbox.d.ts.map +1 -0
- package/dist/src/sandbox/sandbox.js +134 -0
- package/dist/src/sandbox/sandbox.js.map +1 -0
- package/dist/src/sandbox/ts-config-preprocessor.d.ts +46 -0
- package/dist/src/sandbox/ts-config-preprocessor.d.ts.map +1 -0
- package/dist/src/sandbox/ts-config-preprocessor.js +112 -0
- package/dist/src/sandbox/ts-config-preprocessor.js.map +1 -0
- package/dist/src/stryker-cli.d.ts +15 -0
- package/dist/src/stryker-cli.d.ts.map +1 -0
- package/dist/src/stryker-cli.js +168 -0
- package/dist/src/stryker-cli.js.map +1 -0
- package/dist/src/stryker-package.d.ts +5 -0
- package/dist/src/stryker-package.d.ts.map +1 -0
- package/dist/src/stryker-package.js +7 -0
- package/dist/src/stryker-package.js.map +1 -0
- package/dist/src/stryker-server.d.ts +40 -0
- package/dist/src/stryker-server.d.ts.map +1 -0
- package/dist/src/stryker-server.js +234 -0
- package/dist/src/stryker-server.js.map +1 -0
- package/dist/src/stryker.d.ts +31 -0
- package/dist/src/stryker.d.ts.map +1 -0
- package/dist/src/stryker.js +86 -0
- package/dist/src/stryker.js.map +1 -0
- package/dist/src/test-runner/child-process-test-runner-proxy.d.ts +19 -0
- package/dist/src/test-runner/child-process-test-runner-proxy.d.ts.map +1 -0
- package/dist/src/test-runner/child-process-test-runner-proxy.js +45 -0
- package/dist/src/test-runner/child-process-test-runner-proxy.js.map +1 -0
- package/dist/src/test-runner/child-process-test-runner-worker.d.ts +14 -0
- package/dist/src/test-runner/child-process-test-runner-worker.d.ts.map +1 -0
- package/dist/src/test-runner/child-process-test-runner-worker.js +45 -0
- package/dist/src/test-runner/child-process-test-runner-worker.js.map +1 -0
- package/dist/src/test-runner/command-test-runner.d.ts +31 -0
- package/dist/src/test-runner/command-test-runner.d.ts.map +1 -0
- package/dist/src/test-runner/command-test-runner.js +144 -0
- package/dist/src/test-runner/command-test-runner.js.map +1 -0
- package/dist/src/test-runner/index.d.ts +11 -0
- package/dist/src/test-runner/index.d.ts.map +1 -0
- package/dist/src/test-runner/index.js +18 -0
- package/dist/src/test-runner/index.js.map +1 -0
- package/dist/src/test-runner/max-test-runner-reuse-decorator.d.ts +14 -0
- package/dist/src/test-runner/max-test-runner-reuse-decorator.d.ts.map +1 -0
- package/dist/src/test-runner/max-test-runner-reuse-decorator.js +25 -0
- package/dist/src/test-runner/max-test-runner-reuse-decorator.js.map +1 -0
- package/dist/src/test-runner/reload-environment-decorator.d.ts +11 -0
- package/dist/src/test-runner/reload-environment-decorator.d.ts.map +1 -0
- package/dist/src/test-runner/reload-environment-decorator.js +56 -0
- package/dist/src/test-runner/reload-environment-decorator.js.map +1 -0
- package/dist/src/test-runner/retry-rejected-decorator.d.ts +15 -0
- package/dist/src/test-runner/retry-rejected-decorator.d.ts.map +1 -0
- package/dist/src/test-runner/retry-rejected-decorator.js +59 -0
- package/dist/src/test-runner/retry-rejected-decorator.js.map +1 -0
- package/dist/src/test-runner/test-runner-decorator.d.ts +8 -0
- package/dist/src/test-runner/test-runner-decorator.d.ts.map +1 -0
- package/dist/src/test-runner/test-runner-decorator.js +13 -0
- package/dist/src/test-runner/test-runner-decorator.js.map +1 -0
- package/dist/src/test-runner/timeout-decorator.d.ts +15 -0
- package/dist/src/test-runner/timeout-decorator.d.ts.map +1 -0
- package/dist/src/test-runner/timeout-decorator.js +51 -0
- package/dist/src/test-runner/timeout-decorator.js.map +1 -0
- package/dist/src/unexpected-exit-handler.d.ts +13 -0
- package/dist/src/unexpected-exit-handler.d.ts.map +1 -0
- package/dist/src/unexpected-exit-handler.js +28 -0
- package/dist/src/unexpected-exit-handler.js.map +1 -0
- package/dist/src/utils/file-utils.d.ts +30 -0
- package/dist/src/utils/file-utils.d.ts.map +1 -0
- package/dist/src/utils/file-utils.js +101 -0
- package/dist/src/utils/file-utils.js.map +1 -0
- package/dist/src/utils/index.d.ts +7 -0
- package/dist/src/utils/index.d.ts.map +1 -0
- package/dist/src/utils/index.js +7 -0
- package/dist/src/utils/index.js.map +1 -0
- package/dist/src/utils/json-rpc-event-deserializer.d.ts +5 -0
- package/dist/src/utils/json-rpc-event-deserializer.d.ts.map +1 -0
- package/dist/src/utils/json-rpc-event-deserializer.js +42 -0
- package/dist/src/utils/json-rpc-event-deserializer.js.map +1 -0
- package/dist/src/utils/object-utils.d.ts +37 -0
- package/dist/src/utils/object-utils.d.ts.map +1 -0
- package/dist/src/utils/object-utils.js +91 -0
- package/dist/src/utils/object-utils.js.map +1 -0
- package/dist/src/utils/string-builder.d.ts +9 -0
- package/dist/src/utils/string-builder.d.ts.map +1 -0
- package/dist/src/utils/string-builder.js +26 -0
- package/dist/src/utils/string-builder.js.map +1 -0
- package/dist/src/utils/string-utils.d.ts +12 -0
- package/dist/src/utils/string-utils.d.ts.map +1 -0
- package/dist/src/utils/string-utils.js +54 -0
- package/dist/src/utils/string-utils.js.map +1 -0
- package/dist/src/utils/temporary-directory.d.ts +18 -0
- package/dist/src/utils/temporary-directory.d.ts.map +1 -0
- package/dist/src/utils/temporary-directory.js +63 -0
- package/dist/src/utils/temporary-directory.js.map +1 -0
- package/dist/src/utils/timer.d.ts +14 -0
- package/dist/src/utils/timer.d.ts.map +1 -0
- package/dist/src/utils/timer.js +53 -0
- package/dist/src/utils/timer.js.map +1 -0
- package/package.json +106 -0
- package/schema/stryker-schema.json +855 -0
- package/src/checker/checker-child-process-proxy.ts +67 -0
- package/src/checker/checker-facade.ts +90 -0
- package/src/checker/checker-factory.ts +46 -0
- package/src/checker/checker-resource.ts +12 -0
- package/src/checker/checker-retry-decorator.ts +57 -0
- package/src/checker/checker-worker.ts +62 -0
- package/src/checker/index.ts +3 -0
- package/src/child-proxy/child-process-crashed-error.ts +16 -0
- package/src/child-proxy/child-process-proxy-worker.ts +203 -0
- package/src/child-proxy/child-process-proxy.ts +353 -0
- package/src/child-proxy/id-generator.ts +6 -0
- package/src/child-proxy/message-protocol.ts +87 -0
- package/src/child-proxy/out-of-memory-error.ts +11 -0
- package/src/concurrent/concurrency-token-provider.ts +106 -0
- package/src/concurrent/index.ts +3 -0
- package/src/concurrent/pool.ts +209 -0
- package/src/concurrent/resource-decorator.ts +28 -0
- package/src/config/config-file-formats.ts +31 -0
- package/src/config/config-reader.ts +193 -0
- package/src/config/file-matcher.ts +36 -0
- package/src/config/index.ts +5 -0
- package/src/config/meta-schema-builder.ts +50 -0
- package/src/config/options-validator.ts +317 -0
- package/src/config/validation-errors.ts +192 -0
- package/src/di/core-tokens.ts +39 -0
- package/src/di/index.ts +4 -0
- package/src/di/plugin-creator.ts +102 -0
- package/src/di/plugin-loader.ts +245 -0
- package/src/errors.ts +12 -0
- package/src/fs/file-system.ts +63 -0
- package/src/fs/index.ts +4 -0
- package/src/fs/project-file.ts +100 -0
- package/src/fs/project-reader.ts +493 -0
- package/src/fs/project.ts +98 -0
- package/src/index.ts +7 -0
- package/src/initializer/custom-initializers/angular-initializer.ts +95 -0
- package/src/initializer/custom-initializers/custom-initializer.ts +14 -0
- package/src/initializer/custom-initializers/index.ts +31 -0
- package/src/initializer/custom-initializers/react-initializer.ts +35 -0
- package/src/initializer/custom-initializers/svelte-initializer.ts +40 -0
- package/src/initializer/custom-initializers/vue-js-initializer.ts +30 -0
- package/src/initializer/gitignore-writer.ts +33 -0
- package/src/initializer/index.ts +35 -0
- package/src/initializer/initializer-tokens.ts +8 -0
- package/src/initializer/inquire.ts +17 -0
- package/src/initializer/npm-client.ts +103 -0
- package/src/initializer/npm-registry.ts +48 -0
- package/src/initializer/package-info.ts +10 -0
- package/src/initializer/prompt-option.ts +6 -0
- package/src/initializer/stryker-config-writer.ts +158 -0
- package/src/initializer/stryker-initializer.ts +278 -0
- package/src/initializer/stryker-inquirer.ts +101 -0
- package/src/logging/index.ts +5 -0
- package/src/logging/logger-impl.ts +81 -0
- package/src/logging/logging-backend.ts +90 -0
- package/src/logging/logging-client.ts +56 -0
- package/src/logging/logging-event.ts +94 -0
- package/src/logging/logging-server.ts +56 -0
- package/src/logging/logging-sink.ts +7 -0
- package/src/logging/priority.ts +15 -0
- package/src/logging/provide-logging.ts +70 -0
- package/src/mutants/diff-statistics-collector.ts +47 -0
- package/src/mutants/incremental-differ.ts +771 -0
- package/src/mutants/index.ts +3 -0
- package/src/mutants/mutant-test-planner.ts +357 -0
- package/src/mutants/test-coverage.ts +125 -0
- package/src/process/1-prepare-executor.ts +133 -0
- package/src/process/2-mutant-instrumenter-executor.ts +122 -0
- package/src/process/3-dry-run-executor.ts +262 -0
- package/src/process/4-mutation-test-executor.ts +272 -0
- package/src/process/index.ts +4 -0
- package/src/reporters/broadcast-reporter.ts +129 -0
- package/src/reporters/ci/circle-provider.ts +50 -0
- package/src/reporters/ci/github-actions-provider.ts +22 -0
- package/src/reporters/ci/provider.ts +42 -0
- package/src/reporters/ci/travis-provider.ts +24 -0
- package/src/reporters/clear-text-reporter.ts +245 -0
- package/src/reporters/clear-text-score-table.ts +305 -0
- package/src/reporters/dashboard-reporter/dashboard-reporter-client.ts +89 -0
- package/src/reporters/dashboard-reporter/dashboard-reporter.ts +97 -0
- package/src/reporters/dashboard-reporter/index.ts +30 -0
- package/src/reporters/dashboard-reporter/report.ts +6 -0
- package/src/reporters/dashboard-reporter/tokens.ts +5 -0
- package/src/reporters/dots-reporter.ts +33 -0
- package/src/reporters/event-recorder-reporter.ts +88 -0
- package/src/reporters/html-reporter.ts +87 -0
- package/src/reporters/index.ts +48 -0
- package/src/reporters/json-reporter.ts +45 -0
- package/src/reporters/mutation-test-report-helper.ts +425 -0
- package/src/reporters/mutation-timings-reporter.ts +78 -0
- package/src/reporters/progress-append-only-reporter.ts +36 -0
- package/src/reporters/progress-bar.ts +6 -0
- package/src/reporters/progress-keeper.ts +113 -0
- package/src/reporters/progress-reporter.ts +62 -0
- package/src/reporters/reporter-util.ts +20 -0
- package/src/reporters/strict-reporter.ts +3 -0
- package/src/sandbox/create-preprocessor.ts +27 -0
- package/src/sandbox/disable-type-checks-preprocessor.ts +70 -0
- package/src/sandbox/file-preprocessor.ts +10 -0
- package/src/sandbox/index.ts +3 -0
- package/src/sandbox/multi-preprocessor.ts +13 -0
- package/src/sandbox/sandbox.ts +198 -0
- package/src/sandbox/ts-config-preprocessor.ts +168 -0
- package/src/stryker-cli.ts +363 -0
- package/src/stryker-package.ts +19 -0
- package/src/stryker-server.ts +334 -0
- package/src/stryker.ts +126 -0
- package/src/test-runner/child-process-test-runner-proxy.ts +94 -0
- package/src/test-runner/child-process-test-runner-worker.ts +66 -0
- package/src/test-runner/command-test-runner.ts +190 -0
- package/src/test-runner/index.ts +74 -0
- package/src/test-runner/max-test-runner-reuse-decorator.ts +41 -0
- package/src/test-runner/reload-environment-decorator.ts +72 -0
- package/src/test-runner/retry-rejected-decorator.ts +79 -0
- package/src/test-runner/test-runner-decorator.ts +22 -0
- package/src/test-runner/timeout-decorator.ts +71 -0
- package/src/unexpected-exit-handler.ts +36 -0
- package/src/utils/file-utils.ts +113 -0
- package/src/utils/index.ts +6 -0
- package/src/utils/json-rpc-event-deserializer.ts +48 -0
- package/src/utils/object-utils.ts +106 -0
- package/src/utils/string-builder.ts +30 -0
- package/src/utils/string-utils.ts +61 -0
- package/src/utils/temporary-directory.ts +83 -0
- package/src/utils/timer.ts +58 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { URL } from 'url';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
FileDescriptions,
|
|
5
|
+
Mutant,
|
|
6
|
+
StrykerOptions,
|
|
7
|
+
} from '@stryker-mutator/api/core';
|
|
8
|
+
import { Disposable } from 'typed-inject';
|
|
9
|
+
|
|
10
|
+
import { ChildProcessProxy } from '../child-proxy/child-process-proxy.js';
|
|
11
|
+
import { Resource } from '../concurrent/pool.js';
|
|
12
|
+
import { IdGenerator } from '../child-proxy/id-generator.js';
|
|
13
|
+
|
|
14
|
+
import { CheckerWorker } from './checker-worker.js';
|
|
15
|
+
import { CheckerResource } from './checker-resource.js';
|
|
16
|
+
import { LoggingServerAddress } from '../logging/index.js';
|
|
17
|
+
import { LoggerFactoryMethod } from '@stryker-mutator/api/logging';
|
|
18
|
+
|
|
19
|
+
export class CheckerChildProcessProxy
|
|
20
|
+
implements CheckerResource, Disposable, Resource
|
|
21
|
+
{
|
|
22
|
+
private readonly childProcess: ChildProcessProxy<CheckerWorker>;
|
|
23
|
+
|
|
24
|
+
constructor(
|
|
25
|
+
options: StrykerOptions,
|
|
26
|
+
fileDescriptions: FileDescriptions,
|
|
27
|
+
pluginModulePaths: readonly string[],
|
|
28
|
+
loggingServerAddress: LoggingServerAddress,
|
|
29
|
+
getLogger: LoggerFactoryMethod,
|
|
30
|
+
idGenerator: IdGenerator,
|
|
31
|
+
) {
|
|
32
|
+
this.childProcess = ChildProcessProxy.create(
|
|
33
|
+
new URL('./checker-worker.js', import.meta.url).toString(),
|
|
34
|
+
loggingServerAddress,
|
|
35
|
+
options,
|
|
36
|
+
fileDescriptions,
|
|
37
|
+
pluginModulePaths,
|
|
38
|
+
process.cwd(),
|
|
39
|
+
CheckerWorker,
|
|
40
|
+
options.checkerNodeArgs,
|
|
41
|
+
getLogger,
|
|
42
|
+
idGenerator,
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public async dispose(): Promise<void> {
|
|
47
|
+
await this.childProcess.dispose();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public async init(): Promise<void> {
|
|
51
|
+
await this.childProcess.proxy.init();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
public async check(
|
|
55
|
+
checkerName: string,
|
|
56
|
+
mutants: Mutant[],
|
|
57
|
+
): ReturnType<CheckerResource['check']> {
|
|
58
|
+
return this.childProcess.proxy.check(checkerName, mutants);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
public async group(
|
|
62
|
+
checkerName: string,
|
|
63
|
+
mutants: Mutant[],
|
|
64
|
+
): ReturnType<CheckerResource['group']> {
|
|
65
|
+
return this.childProcess.proxy.group(checkerName, mutants);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { CheckResult } from '@stryker-mutator/api/check';
|
|
2
|
+
import { MutantRunPlan } from '@stryker-mutator/api/core';
|
|
3
|
+
|
|
4
|
+
import { ResourceDecorator } from '../concurrent/index.js';
|
|
5
|
+
|
|
6
|
+
import { CheckerResource } from './checker-resource.js';
|
|
7
|
+
|
|
8
|
+
function toMap(mutantRunPlans: MutantRunPlan[]) {
|
|
9
|
+
return new Map<string, MutantRunPlan>(
|
|
10
|
+
mutantRunPlans.map((mutant) => [mutant.mutant.id, mutant]),
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export class CheckerFacade extends ResourceDecorator<CheckerResource> {
|
|
15
|
+
public async check(
|
|
16
|
+
checkerName: string,
|
|
17
|
+
mutantRunPlans: MutantRunPlan[],
|
|
18
|
+
): Promise<Array<[MutantRunPlan, CheckResult]>> {
|
|
19
|
+
const innerCheckerResult = Object.entries(
|
|
20
|
+
await this.innerResource.check(
|
|
21
|
+
checkerName,
|
|
22
|
+
mutantRunPlans.map((mr) => mr.mutant),
|
|
23
|
+
),
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
// Check if the checker returned all the mutants that was given
|
|
27
|
+
// When a mutant is missing this will be found in the map underneath
|
|
28
|
+
const mutantRunPlanMap = toMap(mutantRunPlans);
|
|
29
|
+
|
|
30
|
+
const results = innerCheckerResult.map(([id, res]) => {
|
|
31
|
+
const mutantRunPlan = mutantRunPlanMap.get(id);
|
|
32
|
+
if (!mutantRunPlan)
|
|
33
|
+
throw new Error(
|
|
34
|
+
`Checker "${checkerName}" returned a check result for mutant id "${id}", but a check wasn't requested for it. Stryker asked to check mutant ids: ${mutantRunPlans
|
|
35
|
+
.map(({ mutant }) => mutant.id)
|
|
36
|
+
.join(',')}`,
|
|
37
|
+
);
|
|
38
|
+
return [mutantRunPlan, res] as [MutantRunPlan, CheckResult];
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
if (mutantRunPlans.length > results.length) {
|
|
42
|
+
const resultIds = new Set(results.map(([{ mutant }]) => mutant.id));
|
|
43
|
+
const missingIds = mutantRunPlans
|
|
44
|
+
.map(({ mutant }) => mutant.id)
|
|
45
|
+
.filter((id) => !resultIds.has(id));
|
|
46
|
+
throw new Error(
|
|
47
|
+
`Checker "${checkerName}" was missing check results for mutant ids "${missingIds.join(',')}", while Stryker asked to check them`,
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return results;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
public async group(
|
|
55
|
+
checkerName: string,
|
|
56
|
+
mutantRunPlans: MutantRunPlan[],
|
|
57
|
+
): Promise<MutantRunPlan[][]> {
|
|
58
|
+
const mutantIdGroups = await this.innerResource.group(
|
|
59
|
+
checkerName,
|
|
60
|
+
mutantRunPlans.map((mr) => mr.mutant),
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
// Check if the checker returned all the mutants that was given
|
|
64
|
+
// When a mutant is missing this will be found in the map underneath
|
|
65
|
+
const mutantRunPlanMap = toMap(mutantRunPlans);
|
|
66
|
+
const groupedMutantIds = new Set<string>();
|
|
67
|
+
const groups = mutantIdGroups.map((group) =>
|
|
68
|
+
group.map((id) => {
|
|
69
|
+
const mutantRunPlan = mutantRunPlanMap.get(id);
|
|
70
|
+
groupedMutantIds.add(id);
|
|
71
|
+
if (!mutantRunPlan)
|
|
72
|
+
throw new Error(
|
|
73
|
+
`Checker "${checkerName}" returned a group result for mutant id "${id}", but a group wasn't requested for it. Stryker asked to group mutant ids: ${mutantRunPlans
|
|
74
|
+
.map(({ mutant }) => mutant.id)
|
|
75
|
+
.join(',')}!`,
|
|
76
|
+
);
|
|
77
|
+
return mutantRunPlan;
|
|
78
|
+
}),
|
|
79
|
+
);
|
|
80
|
+
if (mutantRunPlans.length > groupedMutantIds.size) {
|
|
81
|
+
const missingIds = mutantRunPlans
|
|
82
|
+
.map(({ mutant }) => mutant.id)
|
|
83
|
+
.filter((id) => !groupedMutantIds.has(id));
|
|
84
|
+
throw new Error(
|
|
85
|
+
`Checker "${checkerName}" was missing group results for mutant ids "${missingIds.join(',')}", while Stryker asked to group them!`,
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
return groups;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { FileDescriptions, StrykerOptions } from '@stryker-mutator/api/core';
|
|
2
|
+
import { LoggerFactoryMethod } from '@stryker-mutator/api/logging';
|
|
3
|
+
import { commonTokens, tokens } from '@stryker-mutator/api/plugin';
|
|
4
|
+
|
|
5
|
+
import { IdGenerator } from '../child-proxy/id-generator.js';
|
|
6
|
+
|
|
7
|
+
import { coreTokens } from '../di/index.js';
|
|
8
|
+
|
|
9
|
+
import { CheckerChildProcessProxy } from './checker-child-process-proxy.js';
|
|
10
|
+
import { CheckerFacade } from './checker-facade.js';
|
|
11
|
+
import { CheckerRetryDecorator } from './checker-retry-decorator.js';
|
|
12
|
+
import { LoggingServerAddress } from '../logging/index.js';
|
|
13
|
+
|
|
14
|
+
createCheckerFactory.inject = tokens(
|
|
15
|
+
commonTokens.options,
|
|
16
|
+
commonTokens.fileDescriptions,
|
|
17
|
+
coreTokens.loggingServerAddress,
|
|
18
|
+
coreTokens.pluginModulePaths,
|
|
19
|
+
commonTokens.getLogger,
|
|
20
|
+
coreTokens.workerIdGenerator,
|
|
21
|
+
);
|
|
22
|
+
export function createCheckerFactory(
|
|
23
|
+
options: StrykerOptions,
|
|
24
|
+
fileDescriptions: FileDescriptions,
|
|
25
|
+
loggingServerAddress: LoggingServerAddress,
|
|
26
|
+
pluginModulePaths: readonly string[],
|
|
27
|
+
getLogger: LoggerFactoryMethod,
|
|
28
|
+
idGenerator: IdGenerator,
|
|
29
|
+
): () => CheckerFacade {
|
|
30
|
+
return () =>
|
|
31
|
+
new CheckerFacade(
|
|
32
|
+
() =>
|
|
33
|
+
new CheckerRetryDecorator(
|
|
34
|
+
() =>
|
|
35
|
+
new CheckerChildProcessProxy(
|
|
36
|
+
options,
|
|
37
|
+
fileDescriptions,
|
|
38
|
+
pluginModulePaths,
|
|
39
|
+
loggingServerAddress,
|
|
40
|
+
getLogger,
|
|
41
|
+
idGenerator,
|
|
42
|
+
),
|
|
43
|
+
getLogger(CheckerRetryDecorator.name),
|
|
44
|
+
),
|
|
45
|
+
);
|
|
46
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CheckResult } from '@stryker-mutator/api/check';
|
|
2
|
+
import { Mutant } from '@stryker-mutator/api/core';
|
|
3
|
+
|
|
4
|
+
import { Resource } from '../concurrent/index.js';
|
|
5
|
+
|
|
6
|
+
export interface CheckerResource extends Resource {
|
|
7
|
+
check(
|
|
8
|
+
checkerName: string,
|
|
9
|
+
mutant: Mutant[],
|
|
10
|
+
): Promise<Record<string, CheckResult>>;
|
|
11
|
+
group(checkerName: string, mutants: Mutant[]): Promise<string[][]>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Mutant } from '@stryker-mutator/api/core';
|
|
2
|
+
import { Logger } from '@stryker-mutator/api/logging';
|
|
3
|
+
|
|
4
|
+
import { ChildProcessCrashedError } from '../child-proxy/child-process-crashed-error.js';
|
|
5
|
+
import { OutOfMemoryError } from '../child-proxy/out-of-memory-error.js';
|
|
6
|
+
import { ResourceDecorator } from '../concurrent/index.js';
|
|
7
|
+
|
|
8
|
+
import { CheckerResource } from './checker-resource.js';
|
|
9
|
+
|
|
10
|
+
export class CheckerRetryDecorator
|
|
11
|
+
extends ResourceDecorator<CheckerResource>
|
|
12
|
+
implements CheckerResource
|
|
13
|
+
{
|
|
14
|
+
constructor(
|
|
15
|
+
producer: () => CheckerResource,
|
|
16
|
+
private readonly log: Logger,
|
|
17
|
+
) {
|
|
18
|
+
super(producer);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
public async check(
|
|
22
|
+
checkerName: string,
|
|
23
|
+
mutants: Mutant[],
|
|
24
|
+
): ReturnType<CheckerResource['check']> {
|
|
25
|
+
return this.tryAction(() => this.innerResource.check(checkerName, mutants));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public async group(
|
|
29
|
+
checkerName: string,
|
|
30
|
+
mutants: Mutant[],
|
|
31
|
+
): ReturnType<CheckerResource['group']> {
|
|
32
|
+
return this.tryAction(() => this.innerResource.group(checkerName, mutants));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
private async tryAction<T>(act: () => Promise<T>): Promise<T> {
|
|
36
|
+
try {
|
|
37
|
+
return await act();
|
|
38
|
+
} catch (error) {
|
|
39
|
+
if (error instanceof ChildProcessCrashedError) {
|
|
40
|
+
if (error instanceof OutOfMemoryError) {
|
|
41
|
+
this.log.warn(
|
|
42
|
+
`Checker process [${error.pid}] ran out of memory. Retrying in a new process.`,
|
|
43
|
+
);
|
|
44
|
+
} else {
|
|
45
|
+
this.log.warn(
|
|
46
|
+
`Checker process [${error.pid}] crashed with exit code ${error.exitCode}. Retrying in a new process.`,
|
|
47
|
+
error,
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
await this.recover();
|
|
51
|
+
return act();
|
|
52
|
+
} else {
|
|
53
|
+
throw error; //oops
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Checker, CheckResult } from '@stryker-mutator/api/check';
|
|
2
|
+
import { StrykerOptions, Mutant } from '@stryker-mutator/api/core';
|
|
3
|
+
import { PluginKind, tokens, commonTokens } from '@stryker-mutator/api/plugin';
|
|
4
|
+
import { StrykerError } from '@stryker-mutator/util';
|
|
5
|
+
|
|
6
|
+
import { coreTokens, PluginCreator } from '../di/index.js';
|
|
7
|
+
|
|
8
|
+
import { CheckerResource } from './checker-resource.js';
|
|
9
|
+
|
|
10
|
+
export class CheckerWorker implements CheckerResource {
|
|
11
|
+
private readonly innerCheckers: Map<string, Checker>;
|
|
12
|
+
|
|
13
|
+
public static inject = tokens(commonTokens.options, coreTokens.pluginCreator);
|
|
14
|
+
constructor(options: StrykerOptions, pluginCreator: PluginCreator) {
|
|
15
|
+
this.innerCheckers = new Map(
|
|
16
|
+
options.checkers.map((name) => [
|
|
17
|
+
name,
|
|
18
|
+
pluginCreator.create(PluginKind.Checker, name),
|
|
19
|
+
]),
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
public async init(): Promise<void> {
|
|
23
|
+
for (const [name, checker] of this.innerCheckers.entries()) {
|
|
24
|
+
try {
|
|
25
|
+
await checker.init();
|
|
26
|
+
} catch (error: unknown) {
|
|
27
|
+
throw new StrykerError(
|
|
28
|
+
`An error occurred during initialization of the "${name}" checker`,
|
|
29
|
+
error,
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
public async check(
|
|
35
|
+
checkerName: string,
|
|
36
|
+
mutants: Mutant[],
|
|
37
|
+
): Promise<Record<string, CheckResult>> {
|
|
38
|
+
return this.perform(checkerName, (checker) => checker.check(mutants));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public async group(
|
|
42
|
+
checkerName: string,
|
|
43
|
+
mutants: Mutant[],
|
|
44
|
+
): Promise<string[][]> {
|
|
45
|
+
return this.perform(
|
|
46
|
+
checkerName,
|
|
47
|
+
(checker) =>
|
|
48
|
+
checker.group?.(mutants) ??
|
|
49
|
+
// Group one by one by default
|
|
50
|
+
mutants.map(({ id }) => [id]),
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
private perform<T>(checkerName: string, act: (checker: Checker) => T) {
|
|
55
|
+
const checker = this.innerCheckers.get(checkerName);
|
|
56
|
+
if (checker) {
|
|
57
|
+
return act(checker);
|
|
58
|
+
} else {
|
|
59
|
+
throw new Error(`Checker ${checkerName} does not exist!`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { StrykerError } from '@stryker-mutator/util';
|
|
2
|
+
|
|
3
|
+
export class ChildProcessCrashedError extends StrykerError {
|
|
4
|
+
constructor(
|
|
5
|
+
public readonly pid: number | undefined,
|
|
6
|
+
message: string,
|
|
7
|
+
public readonly exitCode?: number,
|
|
8
|
+
public readonly signal?: string,
|
|
9
|
+
innerError?: Error,
|
|
10
|
+
) {
|
|
11
|
+
super(message, innerError);
|
|
12
|
+
Error.captureStackTrace(this, ChildProcessCrashedError);
|
|
13
|
+
// TS recommendation: https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
|
|
14
|
+
Object.setPrototypeOf(this, ChildProcessCrashedError.prototype);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import { fileURLToPath } from 'url';
|
|
3
|
+
|
|
4
|
+
import { errorToString } from '@stryker-mutator/util';
|
|
5
|
+
import { createInjector } from 'typed-inject';
|
|
6
|
+
import {
|
|
7
|
+
commonTokens,
|
|
8
|
+
PluginContext,
|
|
9
|
+
Injector,
|
|
10
|
+
} from '@stryker-mutator/api/plugin';
|
|
11
|
+
|
|
12
|
+
import { deserialize, serialize } from '../utils/string-utils.js';
|
|
13
|
+
import { coreTokens, PluginCreator } from '../di/index.js';
|
|
14
|
+
import { PluginLoader } from '../di/plugin-loader.js';
|
|
15
|
+
|
|
16
|
+
import {
|
|
17
|
+
CallMessage,
|
|
18
|
+
ParentMessage,
|
|
19
|
+
ParentMessageKind,
|
|
20
|
+
WorkerMessage,
|
|
21
|
+
WorkerMessageKind,
|
|
22
|
+
InitMessage,
|
|
23
|
+
} from './message-protocol.js';
|
|
24
|
+
import {
|
|
25
|
+
provideLogging,
|
|
26
|
+
provideLoggingClient,
|
|
27
|
+
} from '../logging/provide-logging.js';
|
|
28
|
+
import { Logger } from '@stryker-mutator/api/logging';
|
|
29
|
+
import { minPriority } from '../logging/priority.js';
|
|
30
|
+
|
|
31
|
+
export interface ChildProcessContext extends PluginContext {
|
|
32
|
+
[coreTokens.pluginCreator]: PluginCreator;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export class ChildProcessProxyWorker {
|
|
36
|
+
private log?: Logger;
|
|
37
|
+
private injector;
|
|
38
|
+
|
|
39
|
+
public realSubject: any;
|
|
40
|
+
|
|
41
|
+
constructor(private readonly injectorFactory: typeof createInjector) {
|
|
42
|
+
// Make sure to bind the methods in order to ensure the `this` pointer
|
|
43
|
+
this.handleMessage = this.handleMessage.bind(this);
|
|
44
|
+
|
|
45
|
+
// Start listening before sending the spawned message
|
|
46
|
+
process.on('message', this.handleMessage);
|
|
47
|
+
this.send({ kind: ParentMessageKind.Ready });
|
|
48
|
+
this.injector = this.injectorFactory();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
private send(value: ParentMessage) {
|
|
52
|
+
if (process.send) {
|
|
53
|
+
const str = serialize(value);
|
|
54
|
+
process.send(str);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
private handleMessage(serializedMessage: unknown) {
|
|
58
|
+
const message = deserialize<WorkerMessage>(String(serializedMessage));
|
|
59
|
+
switch (message.kind) {
|
|
60
|
+
case WorkerMessageKind.Init:
|
|
61
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises -- No handle needed, handleInit has try catch
|
|
62
|
+
this.handleInit(message);
|
|
63
|
+
this.removeAnyAdditionalMessageListeners(this.handleMessage);
|
|
64
|
+
break;
|
|
65
|
+
case WorkerMessageKind.Call:
|
|
66
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises -- No handle needed, handleCall has try catch
|
|
67
|
+
this.handleCall(message);
|
|
68
|
+
this.removeAnyAdditionalMessageListeners(this.handleMessage);
|
|
69
|
+
break;
|
|
70
|
+
case WorkerMessageKind.Dispose: {
|
|
71
|
+
const sendCompleted = () => {
|
|
72
|
+
this.send({ kind: ParentMessageKind.DisposeCompleted });
|
|
73
|
+
};
|
|
74
|
+
this.injector.dispose().then(sendCompleted).catch(sendCompleted);
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
private async handleInit(message: InitMessage) {
|
|
81
|
+
try {
|
|
82
|
+
this.handlePromiseRejections();
|
|
83
|
+
|
|
84
|
+
// Load plugins in the child process
|
|
85
|
+
const pluginInjector = provideLogging(
|
|
86
|
+
await provideLoggingClient(
|
|
87
|
+
this.injector,
|
|
88
|
+
message.loggingServerAddress,
|
|
89
|
+
minPriority(message.options.logLevel, message.options.fileLogLevel),
|
|
90
|
+
),
|
|
91
|
+
)
|
|
92
|
+
.provideValue(commonTokens.options, message.options)
|
|
93
|
+
.provideValue(commonTokens.fileDescriptions, message.fileDescriptions);
|
|
94
|
+
this.log = pluginInjector.resolve(commonTokens.getLogger)(
|
|
95
|
+
ChildProcessProxyWorker.name,
|
|
96
|
+
);
|
|
97
|
+
const pluginLoader = pluginInjector.injectClass(PluginLoader);
|
|
98
|
+
const { pluginsByKind } = await pluginLoader.load(
|
|
99
|
+
message.pluginModulePaths,
|
|
100
|
+
);
|
|
101
|
+
const injector: Injector<ChildProcessContext> = pluginInjector
|
|
102
|
+
.provideValue(coreTokens.pluginsByKind, pluginsByKind)
|
|
103
|
+
.provideClass(coreTokens.pluginCreator, PluginCreator);
|
|
104
|
+
|
|
105
|
+
const childModule = await import(message.modulePath);
|
|
106
|
+
const RealSubjectClass = childModule[message.namedExport];
|
|
107
|
+
const workingDir = path.resolve(message.workingDirectory);
|
|
108
|
+
if (process.cwd() !== workingDir) {
|
|
109
|
+
this.log.debug(
|
|
110
|
+
`Changing current working directory for this process to ${workingDir}`,
|
|
111
|
+
);
|
|
112
|
+
process.chdir(workingDir);
|
|
113
|
+
}
|
|
114
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
115
|
+
this.realSubject = injector.injectClass(RealSubjectClass);
|
|
116
|
+
this.send({ kind: ParentMessageKind.Initialized });
|
|
117
|
+
} catch (err) {
|
|
118
|
+
this.send({
|
|
119
|
+
error: errorToString(err),
|
|
120
|
+
kind: ParentMessageKind.InitError,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
private async handleCall(message: CallMessage) {
|
|
126
|
+
try {
|
|
127
|
+
const result = await this.doCall(message);
|
|
128
|
+
this.send({
|
|
129
|
+
correlationId: message.correlationId,
|
|
130
|
+
kind: ParentMessageKind.CallResult,
|
|
131
|
+
result,
|
|
132
|
+
});
|
|
133
|
+
} catch (err) {
|
|
134
|
+
this.send({
|
|
135
|
+
correlationId: message.correlationId,
|
|
136
|
+
error: errorToString(err),
|
|
137
|
+
kind: ParentMessageKind.CallRejection,
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
private doCall(
|
|
143
|
+
message: CallMessage,
|
|
144
|
+
):
|
|
145
|
+
| PromiseLike<Record<string, unknown>>
|
|
146
|
+
| Record<string, unknown>
|
|
147
|
+
| undefined {
|
|
148
|
+
if (typeof this.realSubject[message.methodName] === 'function') {
|
|
149
|
+
return this.realSubject[message.methodName](...message.args);
|
|
150
|
+
} else {
|
|
151
|
+
return this.realSubject[message.methodName];
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Remove any addition message listeners that might me eavesdropping.
|
|
157
|
+
* the @ngtools/webpack plugin listens to messages and throws an error whenever it could not handle a message
|
|
158
|
+
* @see https://github.com/angular/angular-cli/blob/f776d3cf7982b64734c57fe4407434e9f4ec09f7/packages/%40ngtools/webpack/src/type_checker.ts#L79
|
|
159
|
+
* @param exceptListener The listener that should remain
|
|
160
|
+
*/
|
|
161
|
+
private removeAnyAdditionalMessageListeners(
|
|
162
|
+
exceptListener: NodeJS.MessageListener,
|
|
163
|
+
) {
|
|
164
|
+
process.listeners('message').forEach((listener) => {
|
|
165
|
+
if (listener !== exceptListener) {
|
|
166
|
+
this.log?.debug(
|
|
167
|
+
"Removing an additional message listener, we don't want eavesdropping on our inter-process communication: %s",
|
|
168
|
+
listener.toString(),
|
|
169
|
+
);
|
|
170
|
+
process.removeListener('message', listener);
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* During mutation testing, it's to be expected that promise rejections are not handled synchronously anymore (or not at all)
|
|
177
|
+
* Let's handle those events so future versions of node don't crash
|
|
178
|
+
* See issue 350: https://github.com/stryker-mutator/stryker-js/issues/350
|
|
179
|
+
*/
|
|
180
|
+
private handlePromiseRejections() {
|
|
181
|
+
const unhandledRejections: Array<Promise<unknown>> = [];
|
|
182
|
+
process.on('unhandledRejection', (reason, promise) => {
|
|
183
|
+
const unhandledPromiseId = unhandledRejections.push(promise);
|
|
184
|
+
this.log?.debug(
|
|
185
|
+
`UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: ${unhandledPromiseId}): ${errorToString(reason)}`,
|
|
186
|
+
);
|
|
187
|
+
});
|
|
188
|
+
process.on('rejectionHandled', (promise) => {
|
|
189
|
+
const unhandledPromiseId = unhandledRejections.indexOf(promise) + 1;
|
|
190
|
+
this.log?.debug(
|
|
191
|
+
`PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: ${unhandledPromiseId})`,
|
|
192
|
+
);
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// Prevent side effects for merely importing the file
|
|
198
|
+
// Only actually start the child worker when it is requested
|
|
199
|
+
// Stryker disable all
|
|
200
|
+
if (fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
201
|
+
new ChildProcessProxyWorker(createInjector);
|
|
202
|
+
}
|
|
203
|
+
// Stryker restore all
|