@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,353 @@
|
|
|
1
|
+
import childProcess from 'child_process';
|
|
2
|
+
import os from 'os';
|
|
3
|
+
import { fileURLToPath, URL } from 'url';
|
|
4
|
+
|
|
5
|
+
import { FileDescriptions, StrykerOptions } from '@stryker-mutator/api/core';
|
|
6
|
+
import {
|
|
7
|
+
isErrnoException,
|
|
8
|
+
Task,
|
|
9
|
+
ExpirableTask,
|
|
10
|
+
StrykerError,
|
|
11
|
+
} from '@stryker-mutator/util';
|
|
12
|
+
import { Disposable, InjectableClass, InjectionToken } from 'typed-inject';
|
|
13
|
+
|
|
14
|
+
import { LoggingServerAddress } from '../logging/index.js';
|
|
15
|
+
import { objectUtils } from '../utils/object-utils.js';
|
|
16
|
+
import { StringBuilder } from '../utils/string-builder.js';
|
|
17
|
+
import { deserialize, padLeft, serialize } from '../utils/string-utils.js';
|
|
18
|
+
|
|
19
|
+
import { ChildProcessCrashedError } from './child-process-crashed-error.js';
|
|
20
|
+
import {
|
|
21
|
+
InitMessage,
|
|
22
|
+
ParentMessage,
|
|
23
|
+
ParentMessageKind,
|
|
24
|
+
WorkerMessage,
|
|
25
|
+
WorkerMessageKind,
|
|
26
|
+
} from './message-protocol.js';
|
|
27
|
+
import { OutOfMemoryError } from './out-of-memory-error.js';
|
|
28
|
+
import { ChildProcessContext } from './child-process-proxy-worker.js';
|
|
29
|
+
import { IdGenerator } from './id-generator.js';
|
|
30
|
+
import { Logger, LoggerFactoryMethod } from '@stryker-mutator/api/logging';
|
|
31
|
+
|
|
32
|
+
type Func<TS extends any[], R> = (...args: TS) => R;
|
|
33
|
+
|
|
34
|
+
type PromisifiedFunc<TS extends any[], R> = (...args: TS) => Promise<R>;
|
|
35
|
+
|
|
36
|
+
export type Promisified<T> = {
|
|
37
|
+
[K in keyof T]: T[K] extends PromisifiedFunc<any, any>
|
|
38
|
+
? T[K]
|
|
39
|
+
: T[K] extends Func<infer TS, infer R>
|
|
40
|
+
? PromisifiedFunc<TS, R>
|
|
41
|
+
: () => Promise<T[K]>;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const BROKEN_PIPE_ERROR_CODE = 'EPIPE';
|
|
45
|
+
const IPC_CHANNEL_CLOSED_ERROR_CODE = 'ERR_IPC_CHANNEL_CLOSED';
|
|
46
|
+
const TIMEOUT_FOR_DISPOSE = 2000;
|
|
47
|
+
|
|
48
|
+
export class ChildProcessProxy<T> implements Disposable {
|
|
49
|
+
public readonly proxy: Promisified<T>;
|
|
50
|
+
|
|
51
|
+
private readonly worker: childProcess.ChildProcess;
|
|
52
|
+
private readonly initTask: Task;
|
|
53
|
+
private disposeTask: ExpirableTask | undefined;
|
|
54
|
+
private fatalError: StrykerError | undefined;
|
|
55
|
+
private readonly workerTasks = new Map<number, Task>();
|
|
56
|
+
private workerTaskCounter = 0;
|
|
57
|
+
private readonly log;
|
|
58
|
+
private readonly stdoutBuilder = new StringBuilder();
|
|
59
|
+
private readonly stderrBuilder = new StringBuilder();
|
|
60
|
+
private isDisposed = false;
|
|
61
|
+
private readonly initMessage: InitMessage;
|
|
62
|
+
|
|
63
|
+
private constructor(
|
|
64
|
+
modulePath: string,
|
|
65
|
+
namedExport: string,
|
|
66
|
+
loggingServerAddress: LoggingServerAddress,
|
|
67
|
+
options: StrykerOptions,
|
|
68
|
+
fileDescriptions: FileDescriptions,
|
|
69
|
+
pluginModulePaths: readonly string[],
|
|
70
|
+
workingDirectory: string,
|
|
71
|
+
logger: Logger,
|
|
72
|
+
execArgv: string[],
|
|
73
|
+
idGenerator: IdGenerator,
|
|
74
|
+
) {
|
|
75
|
+
const workerId = idGenerator.next().toString();
|
|
76
|
+
this.worker = childProcess.fork(
|
|
77
|
+
fileURLToPath(
|
|
78
|
+
new URL('./child-process-proxy-worker.js', import.meta.url),
|
|
79
|
+
),
|
|
80
|
+
{
|
|
81
|
+
silent: true,
|
|
82
|
+
execArgv,
|
|
83
|
+
env: { STRYKER_MUTATOR_WORKER: workerId, ...process.env },
|
|
84
|
+
},
|
|
85
|
+
);
|
|
86
|
+
this.initTask = new Task();
|
|
87
|
+
this.log = logger;
|
|
88
|
+
this.log.debug(
|
|
89
|
+
'Started %s in worker process %s with pid %s %s',
|
|
90
|
+
namedExport,
|
|
91
|
+
workerId,
|
|
92
|
+
this.worker.pid,
|
|
93
|
+
execArgv.length ? ` (using args ${execArgv.join(' ')})` : '',
|
|
94
|
+
);
|
|
95
|
+
// Listen to `close`, not `exit`, see https://github.com/stryker-mutator/stryker-js/issues/1634
|
|
96
|
+
this.worker.on('close', this.handleUnexpectedExit);
|
|
97
|
+
this.worker.on('error', this.handleError);
|
|
98
|
+
|
|
99
|
+
this.initMessage = {
|
|
100
|
+
kind: WorkerMessageKind.Init,
|
|
101
|
+
loggingServerAddress,
|
|
102
|
+
options,
|
|
103
|
+
fileDescriptions,
|
|
104
|
+
pluginModulePaths,
|
|
105
|
+
namedExport: namedExport,
|
|
106
|
+
modulePath: modulePath,
|
|
107
|
+
workingDirectory,
|
|
108
|
+
};
|
|
109
|
+
this.listenForMessages();
|
|
110
|
+
this.listenToStdoutAndStderr();
|
|
111
|
+
|
|
112
|
+
this.proxy = this.initProxy();
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* @description Creates a proxy where each function of the object created using the constructorFunction arg is ran inside of a child process
|
|
117
|
+
*/
|
|
118
|
+
public static create<
|
|
119
|
+
R,
|
|
120
|
+
Tokens extends Array<InjectionToken<ChildProcessContext>>,
|
|
121
|
+
>(
|
|
122
|
+
modulePath: string,
|
|
123
|
+
loggingServerAddress: LoggingServerAddress,
|
|
124
|
+
options: StrykerOptions,
|
|
125
|
+
fileDescriptions: FileDescriptions,
|
|
126
|
+
pluginModulePaths: readonly string[],
|
|
127
|
+
workingDirectory: string,
|
|
128
|
+
injectableClass: InjectableClass<ChildProcessContext, R, Tokens>,
|
|
129
|
+
execArgv: string[],
|
|
130
|
+
getLogger: LoggerFactoryMethod,
|
|
131
|
+
idGenerator: IdGenerator,
|
|
132
|
+
): ChildProcessProxy<R> {
|
|
133
|
+
return new ChildProcessProxy(
|
|
134
|
+
modulePath,
|
|
135
|
+
injectableClass.name,
|
|
136
|
+
loggingServerAddress,
|
|
137
|
+
options,
|
|
138
|
+
fileDescriptions,
|
|
139
|
+
pluginModulePaths,
|
|
140
|
+
workingDirectory,
|
|
141
|
+
getLogger(ChildProcessProxy.name),
|
|
142
|
+
execArgv,
|
|
143
|
+
idGenerator,
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
private send(message: WorkerMessage) {
|
|
148
|
+
this.worker.send(serialize(message));
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
private initProxy(): Promisified<T> {
|
|
152
|
+
// This proxy is a genuine javascript `Proxy` class
|
|
153
|
+
// More info: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy
|
|
154
|
+
return new Proxy({} as Promisified<T>, {
|
|
155
|
+
get: (_, propertyKey) => {
|
|
156
|
+
if (typeof propertyKey === 'string') {
|
|
157
|
+
return this.forward(propertyKey);
|
|
158
|
+
} else {
|
|
159
|
+
return undefined;
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
private forward(methodName: string) {
|
|
166
|
+
return async (...args: any[]) => {
|
|
167
|
+
if (this.fatalError) {
|
|
168
|
+
return Promise.reject(this.fatalError);
|
|
169
|
+
} else {
|
|
170
|
+
const workerTask = new Task<void>();
|
|
171
|
+
const correlationId = this.workerTaskCounter++;
|
|
172
|
+
this.workerTasks.set(correlationId, workerTask);
|
|
173
|
+
this.initTask.promise
|
|
174
|
+
.then(() => {
|
|
175
|
+
this.send({
|
|
176
|
+
args,
|
|
177
|
+
correlationId,
|
|
178
|
+
kind: WorkerMessageKind.Call,
|
|
179
|
+
methodName,
|
|
180
|
+
});
|
|
181
|
+
})
|
|
182
|
+
.catch((error: unknown) => {
|
|
183
|
+
workerTask.reject(error);
|
|
184
|
+
});
|
|
185
|
+
return workerTask.promise;
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
private listenForMessages() {
|
|
191
|
+
this.worker.on('message', (serializedMessage: string) => {
|
|
192
|
+
const message = deserialize<ParentMessage>(serializedMessage);
|
|
193
|
+
switch (message.kind) {
|
|
194
|
+
case ParentMessageKind.Ready:
|
|
195
|
+
// Workaround, because of a race condition more prominent in native ESM node modules
|
|
196
|
+
// Fix has landed in v17.4.0 🎉, but we need this workaround for now.
|
|
197
|
+
// See https://github.com/nodejs/node/issues/41134
|
|
198
|
+
this.send(this.initMessage);
|
|
199
|
+
break;
|
|
200
|
+
case ParentMessageKind.Initialized:
|
|
201
|
+
this.initTask.resolve(undefined);
|
|
202
|
+
break;
|
|
203
|
+
case ParentMessageKind.CallResult:
|
|
204
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
205
|
+
this.workerTasks.get(message.correlationId)!.resolve(message.result);
|
|
206
|
+
this.workerTasks.delete(message.correlationId);
|
|
207
|
+
break;
|
|
208
|
+
case ParentMessageKind.CallRejection:
|
|
209
|
+
this.workerTasks
|
|
210
|
+
.get(message.correlationId)!
|
|
211
|
+
.reject(new StrykerError(message.error));
|
|
212
|
+
this.workerTasks.delete(message.correlationId);
|
|
213
|
+
break;
|
|
214
|
+
case ParentMessageKind.DisposeCompleted:
|
|
215
|
+
if (this.disposeTask) {
|
|
216
|
+
this.disposeTask.resolve(undefined);
|
|
217
|
+
}
|
|
218
|
+
break;
|
|
219
|
+
case ParentMessageKind.InitError:
|
|
220
|
+
this.fatalError = new StrykerError(message.error);
|
|
221
|
+
this.reportError(this.fatalError);
|
|
222
|
+
void this.dispose();
|
|
223
|
+
break;
|
|
224
|
+
default:
|
|
225
|
+
this.logUnidentifiedMessage(message);
|
|
226
|
+
break;
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
private listenToStdoutAndStderr() {
|
|
232
|
+
const handleData = (builder: StringBuilder) => (data: Buffer | string) => {
|
|
233
|
+
const output = data.toString();
|
|
234
|
+
builder.append(output);
|
|
235
|
+
this.log.trace(output);
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
if (this.worker.stdout) {
|
|
239
|
+
this.worker.stdout.on('data', handleData(this.stdoutBuilder));
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
if (this.worker.stderr) {
|
|
243
|
+
this.worker.stderr.on('data', handleData(this.stderrBuilder));
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
public get stdout(): string {
|
|
248
|
+
return this.stdoutBuilder.toString();
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
public get stderr(): string {
|
|
252
|
+
return this.stderrBuilder.toString();
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
private reportError(error: Error) {
|
|
256
|
+
const onGoingWorkerTasks = [...this.workerTasks.values()].filter(
|
|
257
|
+
(task) => !task.isCompleted,
|
|
258
|
+
);
|
|
259
|
+
if (!this.initTask.isCompleted) {
|
|
260
|
+
onGoingWorkerTasks.push(this.initTask);
|
|
261
|
+
}
|
|
262
|
+
if (onGoingWorkerTasks.length) {
|
|
263
|
+
onGoingWorkerTasks.forEach((task) => task.reject(error));
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
private readonly handleUnexpectedExit = (code: number, signal: string) => {
|
|
268
|
+
this.isDisposed = true;
|
|
269
|
+
const output = StringBuilder.concat(this.stderrBuilder, this.stdoutBuilder);
|
|
270
|
+
if (processOutOfMemory()) {
|
|
271
|
+
const oom = new OutOfMemoryError(this.worker.pid, code);
|
|
272
|
+
this.fatalError = oom;
|
|
273
|
+
this.log.warn(
|
|
274
|
+
`Child process [pid ${oom.pid}] ran out of memory. Stdout and stderr are logged on debug level.`,
|
|
275
|
+
);
|
|
276
|
+
this.log.debug(stdoutAndStderr());
|
|
277
|
+
} else {
|
|
278
|
+
this.fatalError = new ChildProcessCrashedError(
|
|
279
|
+
this.worker.pid,
|
|
280
|
+
`Child process [pid ${this.worker.pid}] exited unexpectedly with exit code ${code} (${signal || 'without signal'}). ${stdoutAndStderr()}`,
|
|
281
|
+
code,
|
|
282
|
+
signal,
|
|
283
|
+
);
|
|
284
|
+
this.log.warn(this.fatalError.message, this.fatalError);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
this.reportError(this.fatalError);
|
|
288
|
+
|
|
289
|
+
function processOutOfMemory() {
|
|
290
|
+
return (
|
|
291
|
+
output.includes('JavaScript heap out of memory') ||
|
|
292
|
+
output.includes('FatalProcessOutOfMemory')
|
|
293
|
+
);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
function stdoutAndStderr() {
|
|
297
|
+
if (output.length) {
|
|
298
|
+
return `Last part of stdout and stderr was:${os.EOL}${padLeft(output)}`;
|
|
299
|
+
} else {
|
|
300
|
+
return 'Stdout and stderr were empty.';
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
private readonly handleError = (error: Error) => {
|
|
306
|
+
if (this.innerProcessIsCrashed(error)) {
|
|
307
|
+
this.log.warn(
|
|
308
|
+
`Child process [pid ${this.worker.pid}] has crashed. See other warning messages for more info.`,
|
|
309
|
+
error,
|
|
310
|
+
);
|
|
311
|
+
this.reportError(
|
|
312
|
+
new ChildProcessCrashedError(
|
|
313
|
+
this.worker.pid,
|
|
314
|
+
`Child process [pid ${this.worker.pid}] has crashed`,
|
|
315
|
+
undefined,
|
|
316
|
+
undefined,
|
|
317
|
+
error,
|
|
318
|
+
),
|
|
319
|
+
);
|
|
320
|
+
} else {
|
|
321
|
+
this.reportError(error);
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
private innerProcessIsCrashed(error: Error) {
|
|
326
|
+
return (
|
|
327
|
+
isErrnoException(error) &&
|
|
328
|
+
(error.code === BROKEN_PIPE_ERROR_CODE ||
|
|
329
|
+
error.code === IPC_CHANNEL_CLOSED_ERROR_CODE)
|
|
330
|
+
);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
public async dispose(): Promise<void> {
|
|
334
|
+
if (!this.isDisposed) {
|
|
335
|
+
this.worker.removeListener('close', this.handleUnexpectedExit);
|
|
336
|
+
this.isDisposed = true;
|
|
337
|
+
this.log.debug('Disposing of worker process %s', this.worker.pid);
|
|
338
|
+
this.disposeTask = new ExpirableTask(TIMEOUT_FOR_DISPOSE);
|
|
339
|
+
this.send({ kind: WorkerMessageKind.Dispose });
|
|
340
|
+
try {
|
|
341
|
+
await this.disposeTask.promise;
|
|
342
|
+
} finally {
|
|
343
|
+
this.log.debug('Kill %s', this.worker.pid);
|
|
344
|
+
await objectUtils.kill(this.worker.pid);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
private logUnidentifiedMessage(message: never) {
|
|
350
|
+
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
351
|
+
this.log.error(`Received unidentified message ${message}`);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { FileDescriptions, StrykerOptions } from '@stryker-mutator/api/core';
|
|
2
|
+
|
|
3
|
+
import type { LoggingServerAddress } from '../logging/index.js';
|
|
4
|
+
|
|
5
|
+
export enum WorkerMessageKind {
|
|
6
|
+
Init,
|
|
7
|
+
Call,
|
|
8
|
+
Dispose,
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export enum ParentMessageKind {
|
|
12
|
+
/**
|
|
13
|
+
* Indicates that the child process is spawned and ready to receive messages
|
|
14
|
+
*/
|
|
15
|
+
Ready,
|
|
16
|
+
/**
|
|
17
|
+
* Indicates that initialization is done
|
|
18
|
+
*/
|
|
19
|
+
Initialized,
|
|
20
|
+
/**
|
|
21
|
+
* Indicates an error happened during initialization
|
|
22
|
+
*/
|
|
23
|
+
InitError,
|
|
24
|
+
/**
|
|
25
|
+
* Indicates that a 'Call' was successful
|
|
26
|
+
*/
|
|
27
|
+
CallResult,
|
|
28
|
+
/**
|
|
29
|
+
* Indicates that a 'Call' was rejected
|
|
30
|
+
*/
|
|
31
|
+
CallRejection,
|
|
32
|
+
/**
|
|
33
|
+
* Indicates that a 'Dispose' was completed
|
|
34
|
+
*/
|
|
35
|
+
DisposeCompleted,
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export type WorkerMessage = CallMessage | DisposeMessage | InitMessage;
|
|
39
|
+
export type ParentMessage =
|
|
40
|
+
| InitRejectionResult
|
|
41
|
+
| RejectionResult
|
|
42
|
+
| WorkResult
|
|
43
|
+
| {
|
|
44
|
+
kind:
|
|
45
|
+
| ParentMessageKind.DisposeCompleted
|
|
46
|
+
| ParentMessageKind.Initialized
|
|
47
|
+
| ParentMessageKind.Ready;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export interface InitMessage {
|
|
51
|
+
kind: WorkerMessageKind.Init;
|
|
52
|
+
loggingServerAddress: LoggingServerAddress;
|
|
53
|
+
options: StrykerOptions;
|
|
54
|
+
fileDescriptions: FileDescriptions;
|
|
55
|
+
pluginModulePaths: readonly string[];
|
|
56
|
+
workingDirectory: string;
|
|
57
|
+
namedExport: string;
|
|
58
|
+
modulePath: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface DisposeMessage {
|
|
62
|
+
kind: WorkerMessageKind.Dispose;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface WorkResult {
|
|
66
|
+
kind: ParentMessageKind.CallResult;
|
|
67
|
+
correlationId: number;
|
|
68
|
+
result: any;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface RejectionResult {
|
|
72
|
+
kind: ParentMessageKind.CallRejection;
|
|
73
|
+
correlationId: number;
|
|
74
|
+
error: string;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface InitRejectionResult {
|
|
78
|
+
kind: ParentMessageKind.InitError;
|
|
79
|
+
error: string;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface CallMessage {
|
|
83
|
+
correlationId: number;
|
|
84
|
+
kind: WorkerMessageKind.Call;
|
|
85
|
+
args: any[];
|
|
86
|
+
methodName: string;
|
|
87
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ChildProcessCrashedError } from './child-process-crashed-error.js';
|
|
2
|
+
|
|
3
|
+
export class OutOfMemoryError extends ChildProcessCrashedError {
|
|
4
|
+
constructor(pid: number | undefined, exitCode: number) {
|
|
5
|
+
super(pid, `Process ${pid} ran out of memory`, exitCode);
|
|
6
|
+
this.message = 'Process ';
|
|
7
|
+
Error.captureStackTrace(this, OutOfMemoryError);
|
|
8
|
+
// TS recommendation: https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
|
|
9
|
+
Object.setPrototypeOf(this, OutOfMemoryError.prototype);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import os from 'os';
|
|
2
|
+
|
|
3
|
+
import { StrykerOptions } from '@stryker-mutator/api/core';
|
|
4
|
+
import { ReplaySubject, Observable, range } from 'rxjs';
|
|
5
|
+
import { Disposable, tokens } from 'typed-inject';
|
|
6
|
+
import { commonTokens } from '@stryker-mutator/api/plugin';
|
|
7
|
+
import { Logger } from '@stryker-mutator/api/logging';
|
|
8
|
+
|
|
9
|
+
export class ConcurrencyTokenProvider implements Disposable {
|
|
10
|
+
private readonly concurrencyCheckers: number;
|
|
11
|
+
private readonly concurrencyTestRunners: number;
|
|
12
|
+
private readonly testRunnerTokenSubject = new ReplaySubject<number>();
|
|
13
|
+
|
|
14
|
+
public get testRunnerToken$(): Observable<number> {
|
|
15
|
+
return this.testRunnerTokenSubject;
|
|
16
|
+
}
|
|
17
|
+
public readonly checkerToken$: Observable<number>;
|
|
18
|
+
public static readonly inject = tokens(
|
|
19
|
+
commonTokens.options,
|
|
20
|
+
commonTokens.logger,
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
constructor(
|
|
24
|
+
options: Pick<StrykerOptions, 'checkers' | 'concurrency'>,
|
|
25
|
+
private readonly log: Logger,
|
|
26
|
+
) {
|
|
27
|
+
const availableParallelism = os.availableParallelism();
|
|
28
|
+
const concurrency = this.computeConcurrency(
|
|
29
|
+
options.concurrency,
|
|
30
|
+
availableParallelism,
|
|
31
|
+
);
|
|
32
|
+
if (options.checkers.length > 0) {
|
|
33
|
+
this.concurrencyCheckers = Math.max(Math.ceil(concurrency / 2), 1);
|
|
34
|
+
this.checkerToken$ = range(this.concurrencyCheckers);
|
|
35
|
+
this.concurrencyTestRunners = Math.max(Math.floor(concurrency / 2), 1);
|
|
36
|
+
log.info(
|
|
37
|
+
'Creating %s checker process(es) and %s test runner process(es).',
|
|
38
|
+
this.concurrencyCheckers,
|
|
39
|
+
this.concurrencyTestRunners,
|
|
40
|
+
);
|
|
41
|
+
} else {
|
|
42
|
+
this.concurrencyCheckers = 0;
|
|
43
|
+
this.checkerToken$ = range(1); // at least one checker, the `CheckerFacade` will not create worker process.
|
|
44
|
+
this.concurrencyTestRunners = concurrency;
|
|
45
|
+
log.info(
|
|
46
|
+
'Creating %s test runner process(es).',
|
|
47
|
+
this.concurrencyTestRunners,
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
Array.from({ length: this.concurrencyTestRunners }).forEach(() =>
|
|
51
|
+
this.testRunnerTokenSubject.next(this.tick()),
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
private computeConcurrency(
|
|
56
|
+
concurrencyOption: number | string | undefined,
|
|
57
|
+
availableParallelism: number,
|
|
58
|
+
): number {
|
|
59
|
+
if (typeof concurrencyOption === 'string') {
|
|
60
|
+
const percentageMatch = concurrencyOption.match(/^(100|[1-9]?[0-9])%$/);
|
|
61
|
+
if (percentageMatch) {
|
|
62
|
+
const percentage = parseInt(percentageMatch[1], 10);
|
|
63
|
+
const computed = Math.max(
|
|
64
|
+
1,
|
|
65
|
+
Math.round((availableParallelism * percentage) / 100),
|
|
66
|
+
);
|
|
67
|
+
this.log.debug(
|
|
68
|
+
'Computed concurrency %s from "%s" based on %s available parallelism.',
|
|
69
|
+
computed,
|
|
70
|
+
concurrencyOption,
|
|
71
|
+
availableParallelism,
|
|
72
|
+
);
|
|
73
|
+
return computed;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (typeof concurrencyOption === 'number') {
|
|
77
|
+
return concurrencyOption;
|
|
78
|
+
}
|
|
79
|
+
// Default: n-1 for n > 4, else n
|
|
80
|
+
return availableParallelism > 4
|
|
81
|
+
? availableParallelism - 1
|
|
82
|
+
: availableParallelism;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
public freeCheckers(): void {
|
|
86
|
+
if (this.concurrencyCheckers > 0) {
|
|
87
|
+
this.log.debug(
|
|
88
|
+
'Checking done, creating %s additional test runner process(es)',
|
|
89
|
+
this.concurrencyCheckers,
|
|
90
|
+
);
|
|
91
|
+
for (let i = 0; i < this.concurrencyCheckers; i++) {
|
|
92
|
+
this.testRunnerTokenSubject.next(this.tick());
|
|
93
|
+
}
|
|
94
|
+
this.testRunnerTokenSubject.complete();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
private count = 0;
|
|
99
|
+
private tick() {
|
|
100
|
+
return this.count++;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
public dispose(): void {
|
|
104
|
+
this.testRunnerTokenSubject.complete();
|
|
105
|
+
}
|
|
106
|
+
}
|