@systemfsoftware/stryker-js 17.0.0 → 17.0.1
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/CHANGELOG.md +6 -0
- package/dist/index.mjs +1 -1
- package/dist/main.mjs +273 -191
- package/dist/promises.mjs +1 -1
- package/dist/{run-stages-B5YfftjV.mjs → run-stages-CpYiJ2Mz.mjs} +198 -184
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @systemfsoftware/stryker-js
|
|
2
2
|
|
|
3
|
+
## 17.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- stryker plan is now faster: it no longer copies the project into a temporary directory or prepares the checkers, test runners, and reporters a full run needs, and it leaves no temporary directory behind. The plan itself is unchanged — the same mutants, scheduled with the same predicted costs.
|
|
8
|
+
|
|
3
9
|
## 17.0.0
|
|
4
10
|
|
|
5
11
|
### Major Changes
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
|
|
2
2
|
import { i as Mutant_exports, l as Report_exports, n as mergeConfigs } from "./merge-config-ruui2TPS.mjs";
|
|
3
|
-
import { $ as WorkerLauncher, A as classifyWorkerExit, At as OutOfMemoryError, B as SurvivorRef, C as nodePlatformLayer, Ct as MergeResult, D as git_diff_schema_exports, Dt as survivorsPriorReport, E as git_diff_service_exports, Et as forkOptionsSchema, F as readConfig, Ft as CheckerAnsweredUnrequested, G as generateRunId, H as RunEvents, I as RunEnvironment, It as CheckerSkippedRequested, J as metricsResultFromFiles, K as VerdictEnvelope, L as IdGenerator, M as loadConfigCell, Mt as OutputMode_exports, N as describeErrors, Nt as RunEvent_exports$1, O as ClassifyWorkerExitCommand, Ot as checkGroupedPlans, P as forkCoreSchema, Pt as SpanTaxonomy_exports, Q as makeWorkerClient, R as surfacedSurvivorsOf, S as IncrementalReportSchema, St as MergeCommand, T as GitDiff, Tt as extendsPropertySchema, U as RunIdentity, V as StrykerPackage, W as buildVerdictEnvelope, X as reporterWorkerFactory, Y as MetricsResultFromReport, Z as spawnReporterWorker, _ as isCommandRunner, _t as defaultOptions, a as MachineConsole, at as initialExtendsStepState, b as readProjectCell, bt as ExtendsStepStateSchema, c as prepareCell, ct as ExtendsStepRead, d as buildTestRunner, dt as ConfigError, et as make, f as makeChildProcessTestRunner, ft as ConfigFileInvalidError, g as vmTestRunnerConfig, gt as createDefaultOptions, h as vmRunnerPluginUrl, ht as ConfigFileUnsupportedError, i as makeRunEventStream, it as importModule, j as validateOptions, jt as WorkerBootTimeoutError, k as ClassifyWorkerExitDecision, kt as ChildProcessCrashedError, l as mutantDetailEventsOf, lt as ExtendsStepRefused, m as testRunnerConfigOf, mt as ConfigFileUnreadableError, n as RunEventDrain, nt as FileMatcher, o as HtmlReporter_exports, ot as StrykerError, p as isVmRunner, pt as ConfigFileNotFoundError, q as staticVerdictOf, r as RunEventDrainLive, rt as decideExtendsStep, s as mutationTestCell, st as ExtendsStepDone, t as strykerCell, tt as ReproducerSchema, u as instrumentCell, ut as ExtendsStepResolve, v as import_closure_cell_exports, vt as ConfigDocumentSchema, w as layerWorkerProtocol, wt as ReadConfigCommand, x as concurrencyCell, xt as ImportedModuleSchema, y as relativeNormalizedFileName, yt as ExtendsStepDocumentSchema, z as SurfacingFields } from "./run-stages-
|
|
3
|
+
import { $ as WorkerLauncher, A as classifyWorkerExit, At as OutOfMemoryError, B as SurvivorRef, C as nodePlatformLayer, Ct as MergeResult, D as git_diff_schema_exports, Dt as survivorsPriorReport, E as git_diff_service_exports, Et as forkOptionsSchema, F as readConfig, Ft as CheckerAnsweredUnrequested, G as generateRunId, H as RunEvents, I as RunEnvironment, It as CheckerSkippedRequested, J as metricsResultFromFiles, K as VerdictEnvelope, L as IdGenerator, M as loadConfigCell, Mt as OutputMode_exports, N as describeErrors, Nt as RunEvent_exports$1, O as ClassifyWorkerExitCommand, Ot as checkGroupedPlans, P as forkCoreSchema, Pt as SpanTaxonomy_exports, Q as makeWorkerClient, R as surfacedSurvivorsOf, S as IncrementalReportSchema, St as MergeCommand, T as GitDiff, Tt as extendsPropertySchema, U as RunIdentity, V as StrykerPackage, W as buildVerdictEnvelope, X as reporterWorkerFactory, Y as MetricsResultFromReport, Z as spawnReporterWorker, _ as isCommandRunner, _t as defaultOptions, a as MachineConsole, at as initialExtendsStepState, b as readProjectCell, bt as ExtendsStepStateSchema, c as prepareCell, ct as ExtendsStepRead, d as buildTestRunner, dt as ConfigError, et as make, f as makeChildProcessTestRunner, ft as ConfigFileInvalidError, g as vmTestRunnerConfig, gt as createDefaultOptions, h as vmRunnerPluginUrl, ht as ConfigFileUnsupportedError, i as makeRunEventStream, it as importModule, j as validateOptions, jt as WorkerBootTimeoutError, k as ClassifyWorkerExitDecision, kt as ChildProcessCrashedError, l as mutantDetailEventsOf, lt as ExtendsStepRefused, m as testRunnerConfigOf, mt as ConfigFileUnreadableError, n as RunEventDrain, nt as FileMatcher, o as HtmlReporter_exports, ot as StrykerError, p as isVmRunner, pt as ConfigFileNotFoundError, q as staticVerdictOf, r as RunEventDrainLive, rt as decideExtendsStep, s as mutationTestCell, st as ExtendsStepDone, t as strykerCell, tt as ReproducerSchema, u as instrumentCell, ut as ExtendsStepResolve, v as import_closure_cell_exports, vt as ConfigDocumentSchema, w as layerWorkerProtocol, wt as ReadConfigCommand, x as concurrencyCell, xt as ImportedModuleSchema, y as relativeNormalizedFileName, yt as ExtendsStepDocumentSchema, z as SurfacingFields } from "./run-stages-CpYiJ2Mz.mjs";
|
|
4
4
|
import { n as StageError } from "./Run.schema-DuaneDGd.mjs";
|
|
5
5
|
import { Cell, Sandwich, Workflow } from "@systemfsoftware/effect-cell-types";
|
|
6
6
|
import * as S from "effect/Schema";
|
package/dist/main.mjs
CHANGED
|
@@ -76754,7 +76754,7 @@ const makeHtmlReporter = dual(2, (options, _init) => (events) => build(nodeFsPat
|
|
|
76754
76754
|
var HtmlReporter_exports = /* @__PURE__ */ __exportAll$3({ makeHtmlReporter: () => makeHtmlReporter });
|
|
76755
76755
|
//#endregion
|
|
76756
76756
|
//#region package.json
|
|
76757
|
-
var version = "17.0.
|
|
76757
|
+
var version = "17.0.1";
|
|
76758
76758
|
//#endregion
|
|
76759
76759
|
//#region ../../node_modules/.pnpm/effect@4.0.0/node_modules/effect/dist/cli/CliOutput.js
|
|
76760
76760
|
/**
|
|
@@ -108033,7 +108033,7 @@ const explainFileSkip = Workflow_exports.make({
|
|
|
108033
108033
|
decide: (command) => value(skipKnownOrUnknownOf(explainedOf(command))).pipe(tag("SkipKnownExplained", (known) => succeed$10(known)), tag("SkipUnknownExplained", (unknown) => succeed$10(unknown)), exhaustive)
|
|
108034
108034
|
});
|
|
108035
108035
|
//#endregion
|
|
108036
|
-
//#region src/run/instrument.
|
|
108036
|
+
//#region src/run/instrument.ts
|
|
108037
108037
|
const reportSkippedFiles = fn(SpanTaxonomy_exports.Spans.instrumentReportSkips.name)(function* (input) {
|
|
108038
108038
|
const files = input.skipped.map((skip) => match$6(explainFileSkip(ExplainFileSkipCommand.make({
|
|
108039
108039
|
extension: skip.extension,
|
|
@@ -108055,13 +108055,6 @@ const offerSkipsIfAny = fn(SpanTaxonomy_exports.Spans.instrumentOfferSkips.name)
|
|
|
108055
108055
|
onFalse: () => reportSkippedFiles(input)
|
|
108056
108056
|
});
|
|
108057
108057
|
});
|
|
108058
|
-
const sandboxDirectoriesOf = (input) => getOrElse$1(map$13(filter$7(some$1(input), () => input.command.options.inPlace), (inPlace) => ({
|
|
108059
|
-
workingDirectory: inPlace.basePath,
|
|
108060
|
-
backupDirectory: inPlace.command.temporaryDirectoryPath
|
|
108061
|
-
})), () => ({
|
|
108062
|
-
workingDirectory: input.command.temporaryDirectoryPath,
|
|
108063
|
-
backupDirectory: ""
|
|
108064
|
-
}));
|
|
108065
108058
|
const mergeInstrumentedFile = (input) => {
|
|
108066
108059
|
const files = fromIterable$7(input.project.files);
|
|
108067
108060
|
set$4(files, input.file.name, input.file);
|
|
@@ -108076,20 +108069,6 @@ const mergeInstrumentedFile = (input) => {
|
|
|
108076
108069
|
filesToMutate
|
|
108077
108070
|
};
|
|
108078
108071
|
};
|
|
108079
|
-
const enteringInstrumentPhase = (raw, body) => withPhaseSpan(SpanTaxonomy_exports.Spans.instrumentPhase, { fileCount: raw.filesToMutate.length }, () => andThen$1(phaseEntered("instrument"), body));
|
|
108080
|
-
const writeInstrument = (raw) => enteringInstrumentPhase(raw, as(offerSkipsIfAny({
|
|
108081
|
-
skipped: raw.instrumentResult.skipped,
|
|
108082
|
-
claimants: raw.prev.frameworkClaimants
|
|
108083
|
-
}), {
|
|
108084
|
-
...raw.prev,
|
|
108085
|
-
project: raw.instrumentedProject,
|
|
108086
|
-
mutants: raw.instrumentResult.mutants,
|
|
108087
|
-
sandbox: raw.sandbox,
|
|
108088
|
-
concurrency: {
|
|
108089
|
-
testRunners: raw.concurrency.testRunners,
|
|
108090
|
-
checkers: raw.concurrency.checkers
|
|
108091
|
-
}
|
|
108092
|
-
}));
|
|
108093
108072
|
const withInstrumentedFiles = (project, instrumented) => reduce$2([...instrumented], project, (current, { name, content }) => getOrElse$1(map$13(get$9(current.files, name), (existing) => mergeInstrumentedFile({
|
|
108094
108073
|
project: current,
|
|
108095
108074
|
file: {
|
|
@@ -108097,9 +108076,7 @@ const withInstrumentedFiles = (project, instrumented) => reduce$2([...instrument
|
|
|
108097
108076
|
content
|
|
108098
108077
|
}
|
|
108099
108078
|
})), () => current));
|
|
108100
|
-
const
|
|
108101
|
-
yield* Scope;
|
|
108102
|
-
const env = yield* RunEnvironment;
|
|
108079
|
+
const instrumentFiles = fnUntraced(function* (command) {
|
|
108103
108080
|
const files = yield* ProjectFiles;
|
|
108104
108081
|
const filesToMutate = yield* map$7(files.readAll(values$2(command.project.filesToMutate)), (readFiles) => readFiles.map(([file, content]) => ({
|
|
108105
108082
|
content,
|
|
@@ -108121,7 +108098,39 @@ const readInstrument = fn(SpanTaxonomy_exports.Spans.instrumentGather.name)(func
|
|
|
108121
108098
|
reason: "Instrumenter failed",
|
|
108122
108099
|
cause
|
|
108123
108100
|
})));
|
|
108124
|
-
|
|
108101
|
+
return {
|
|
108102
|
+
filesToMutate,
|
|
108103
|
+
instrumentResult,
|
|
108104
|
+
instrumentedProject: withInstrumentedFiles(command.project, instrumentResult.files)
|
|
108105
|
+
};
|
|
108106
|
+
});
|
|
108107
|
+
const enteringInstrumentPhase = dual(2, (fileCount, body) => withPhaseSpan(SpanTaxonomy_exports.Spans.instrumentPhase, { fileCount }, () => andThen$1(phaseEntered("instrument"), body)));
|
|
108108
|
+
//#endregion
|
|
108109
|
+
//#region src/run/instrument.cell.ts
|
|
108110
|
+
const sandboxDirectoriesOf = (input) => getOrElse$1(map$13(filter$7(some$1(input), () => input.command.options.inPlace), (inPlace) => ({
|
|
108111
|
+
workingDirectory: inPlace.basePath,
|
|
108112
|
+
backupDirectory: inPlace.command.temporaryDirectoryPath
|
|
108113
|
+
})), () => ({
|
|
108114
|
+
workingDirectory: input.command.temporaryDirectoryPath,
|
|
108115
|
+
backupDirectory: ""
|
|
108116
|
+
}));
|
|
108117
|
+
const writeInstrument = (raw) => enteringInstrumentPhase(raw.filesToMutate.length, as(offerSkipsIfAny({
|
|
108118
|
+
skipped: raw.instrumentResult.skipped,
|
|
108119
|
+
claimants: raw.prev.frameworkClaimants
|
|
108120
|
+
}), {
|
|
108121
|
+
...raw.prev,
|
|
108122
|
+
project: raw.instrumentedProject,
|
|
108123
|
+
mutants: raw.instrumentResult.mutants,
|
|
108124
|
+
sandbox: raw.sandbox,
|
|
108125
|
+
concurrency: {
|
|
108126
|
+
testRunners: raw.concurrency.testRunners,
|
|
108127
|
+
checkers: raw.concurrency.checkers
|
|
108128
|
+
}
|
|
108129
|
+
}));
|
|
108130
|
+
const readInstrument = fn(SpanTaxonomy_exports.Spans.instrumentGather.name)(function* (command) {
|
|
108131
|
+
yield* Scope;
|
|
108132
|
+
const env = yield* RunEnvironment;
|
|
108133
|
+
const { filesToMutate, instrumentResult, instrumentedProject } = yield* instrumentFiles(command);
|
|
108125
108134
|
const directories = sandboxDirectoriesOf({
|
|
108126
108135
|
command,
|
|
108127
108136
|
basePath: env.basePath
|
|
@@ -109104,7 +109113,7 @@ const closureAnalysisOf = (input) => option$1(analyzeImportClosure({
|
|
|
109104
109113
|
rootDir: input.basePath,
|
|
109105
109114
|
projectFiles: dedupe([...keys$2(input.project.files), ...input.project.testFiles]),
|
|
109106
109115
|
testFiles: [...input.project.testFiles],
|
|
109107
|
-
globalInputs: input.globalTestInputs.map((file) =>
|
|
109116
|
+
globalInputs: input.globalTestInputs.map((file) => input.originalFileOf(file))
|
|
109108
109117
|
}).pipe(tapCause((cause) => logWarning(`Import closure analysis failed; refusing to reuse prior verdicts: ${pretty(cause)}`))));
|
|
109109
109118
|
const closureDigestsOf = (input) => map$7(closureAnalysisOf(input), (analysis) => match$8(analysis, {
|
|
109110
109119
|
onNone: () => ({
|
|
@@ -110151,7 +110160,7 @@ const proceedPipeline = fnUntraced(function* (raw) {
|
|
|
110151
110160
|
force: prev.options.force,
|
|
110152
110161
|
options: prev.options,
|
|
110153
110162
|
globalTestInputs: prev.dryRunResult.globalTestInputs ?? [],
|
|
110154
|
-
|
|
110163
|
+
originalFileOf: (file) => originalFileFor(prev.sandbox, file)
|
|
110155
110164
|
});
|
|
110156
110165
|
const rememberedResults = reuse.rememberedResults;
|
|
110157
110166
|
yield* offer(progressQueue, RunEvent_exports.ReuseReported.make({
|
|
@@ -110306,6 +110315,156 @@ const mutationTestCell$1 = Sandwich_exports.named(SpanTaxonomy_exports.Spans.mut
|
|
|
110306
110315
|
}))
|
|
110307
110316
|
});
|
|
110308
110317
|
//#endregion
|
|
110318
|
+
//#region src/reporter-wiring.service.ts
|
|
110319
|
+
const spawnPluginReporterFactory = fn(SpanTaxonomy_exports.Spans.reporterWiringSpawnPluginReporterFactory.name)(function* (name, loaded, projectBasePath, options) {
|
|
110320
|
+
const entry = yield* mapError$3(fromResult(resolveConfiguredPlugin(WorkerSpawnCommand.make({
|
|
110321
|
+
sources: loaded.pluginSources,
|
|
110322
|
+
kind: "Reporter",
|
|
110323
|
+
configured: ConfiguredPluginName.make({ name })
|
|
110324
|
+
}))), (missing) => StageError.make({
|
|
110325
|
+
stage: "prepare",
|
|
110326
|
+
reason: missing.reason,
|
|
110327
|
+
cause: PluginNotFoundError.make({ descriptor: missing.descriptor })
|
|
110328
|
+
}));
|
|
110329
|
+
const client = yield* spawnReporterWorker({
|
|
110330
|
+
entrypoint: entry.entrypoint,
|
|
110331
|
+
projectBasePath,
|
|
110332
|
+
execArgv: [],
|
|
110333
|
+
options,
|
|
110334
|
+
tempDirPrefix: "stryker-reporter-"
|
|
110335
|
+
}).pipe(mapError$3((cause) => StageError.make({
|
|
110336
|
+
stage: "prepare",
|
|
110337
|
+
reason: `Failed to start the reporter worker "${name}"`,
|
|
110338
|
+
cause
|
|
110339
|
+
})));
|
|
110340
|
+
return reporterWorkerFactory(client);
|
|
110341
|
+
});
|
|
110342
|
+
const selectReporterChoices = (names, choicesByName) => map$10(reduce$2(names, empty$15(), (chosen, name) => match$8(get$4(choicesByName, name.toLowerCase()), {
|
|
110343
|
+
onNone: () => chosen,
|
|
110344
|
+
onSome: (choice) => match$8(findFirst(chosen, ([key]) => key === name.toLowerCase()), {
|
|
110345
|
+
onNone: () => [...chosen, [name.toLowerCase(), choice]],
|
|
110346
|
+
onSome: () => chosen
|
|
110347
|
+
})
|
|
110348
|
+
})), ([, choice]) => choice);
|
|
110349
|
+
const reporterInputsOf = dual(5, (names, choicesByName, loaded, projectBasePath, options) => forEach$1(selectReporterChoices(names, choicesByName), (choice) => match$8(choice.builtinFactory, {
|
|
110350
|
+
onSome: (builtin) => succeed$5({
|
|
110351
|
+
name: choice.name,
|
|
110352
|
+
factory: builtin
|
|
110353
|
+
}),
|
|
110354
|
+
onNone: () => map$7(spawnPluginReporterFactory(choice.name, loaded, projectBasePath, options), (factory) => ({
|
|
110355
|
+
name: choice.name,
|
|
110356
|
+
factory
|
|
110357
|
+
}))
|
|
110358
|
+
}), { concurrency: 1 }));
|
|
110359
|
+
//#endregion
|
|
110360
|
+
//#region src/keep-temp-dir.workflow.ts
|
|
110361
|
+
const KeepTempDirTypeId = Symbol.for("@systemfsoftware/stryker-js/KeepTempDir");
|
|
110362
|
+
const CleanTempDirOption = Literals$3([
|
|
110363
|
+
"always",
|
|
110364
|
+
false,
|
|
110365
|
+
true
|
|
110366
|
+
]);
|
|
110367
|
+
var TempDirKept = class extends TaggedClass()("TempDirKept", {}) {
|
|
110368
|
+
[KeepTempDirTypeId] = KeepTempDirTypeId;
|
|
110369
|
+
};
|
|
110370
|
+
var TempDirRemoved = class extends TaggedClass()("TempDirRemoved", {}) {
|
|
110371
|
+
[KeepTempDirTypeId] = KeepTempDirTypeId;
|
|
110372
|
+
};
|
|
110373
|
+
var KeepTempDirCommand = class extends TaggedClass()("KeepTempDirCommand", {
|
|
110374
|
+
cleanTempDir: CleanTempDirOption,
|
|
110375
|
+
failed: Boolean$6
|
|
110376
|
+
}) {
|
|
110377
|
+
static [Workflow_exports.InstrumentationBrand] = {};
|
|
110378
|
+
};
|
|
110379
|
+
const keptIff = (kept) => value(kept).pipe(when(true, () => TempDirKept.make({})), when(false, () => TempDirRemoved.make({})), exhaustive);
|
|
110380
|
+
const decide$2 = (command) => value(command.cleanTempDir).pipe(when(false, () => TempDirKept.make({})), when(true, () => keptIff(command.failed)), when("always", () => TempDirRemoved.make({})), exhaustive, succeed$10);
|
|
110381
|
+
const keepTempDir = Workflow_exports.make({
|
|
110382
|
+
command: KeepTempDirCommand,
|
|
110383
|
+
decision: Union([TempDirKept, TempDirRemoved]),
|
|
110384
|
+
error: Never,
|
|
110385
|
+
decide: decide$2
|
|
110386
|
+
});
|
|
110387
|
+
//#endregion
|
|
110388
|
+
//#region src/Sandbox.service.ts
|
|
110389
|
+
const removesTempDir = (exit, cleanTempDir) => match$6(keepTempDir(KeepTempDirCommand.make({
|
|
110390
|
+
cleanTempDir,
|
|
110391
|
+
failed: isFailure(exit)
|
|
110392
|
+
})), {
|
|
110393
|
+
onFailure: () => false,
|
|
110394
|
+
onSuccess: (decision) => value(decision).pipe(tag("TempDirRemoved", () => true), tag("TempDirKept", () => false), exhaustive)
|
|
110395
|
+
});
|
|
110396
|
+
const removeEmptyParentDirectory = fn(SpanTaxonomy_exports.Spans.sandboxRemoveEmptyParent.name)(function* (parent, fs) {
|
|
110397
|
+
const siblings = yield* fs.readDirectory(parent);
|
|
110398
|
+
yield* match$1(siblings.length === 0, {
|
|
110399
|
+
onTrue: () => fs.remove(parent, {
|
|
110400
|
+
recursive: true,
|
|
110401
|
+
force: true
|
|
110402
|
+
}),
|
|
110403
|
+
onFalse: () => void_$1
|
|
110404
|
+
});
|
|
110405
|
+
});
|
|
110406
|
+
const removeTempDirectory = fn(SpanTaxonomy_exports.Spans.sandboxRemoveTempDir.name)(function* (tmp, parent, fs) {
|
|
110407
|
+
yield* logDebug(`Deleting stryker temp directory ${tmp}`);
|
|
110408
|
+
yield* fs.remove(tmp, {
|
|
110409
|
+
recursive: true,
|
|
110410
|
+
force: true
|
|
110411
|
+
});
|
|
110412
|
+
const parentExists = yield* fs.exists(parent);
|
|
110413
|
+
yield* match$1(parentExists, {
|
|
110414
|
+
onTrue: () => removeEmptyParentDirectory(parent, fs),
|
|
110415
|
+
onFalse: () => void_$1
|
|
110416
|
+
});
|
|
110417
|
+
});
|
|
110418
|
+
const makeTemporaryDirectory = fn(SpanTaxonomy_exports.Spans.sandboxMakeTempDir.name)(function* (options) {
|
|
110419
|
+
const fs = yield* FileSystem;
|
|
110420
|
+
const parent = (yield* Path$1).resolve(options.tempDirName);
|
|
110421
|
+
yield* fs.makeDirectory(parent, { recursive: true });
|
|
110422
|
+
const prefix = match$1(options.inPlace, {
|
|
110423
|
+
onTrue: () => "backup-",
|
|
110424
|
+
onFalse: () => "sandbox-"
|
|
110425
|
+
});
|
|
110426
|
+
const tmp = yield* fs.makeTempDirectory({
|
|
110427
|
+
directory: parent,
|
|
110428
|
+
prefix
|
|
110429
|
+
});
|
|
110430
|
+
yield* logDebug(`Using temp directory "${tmp}"`);
|
|
110431
|
+
yield* addFinalizer((exit) => match$1(removesTempDir(exit, options.cleanTempDir), {
|
|
110432
|
+
onTrue: () => removeTempDirectory(tmp, parent, fs),
|
|
110433
|
+
onFalse: () => logDebug(`Keeping stryker temp directory ${tmp}`)
|
|
110434
|
+
}).pipe(orDie));
|
|
110435
|
+
return { path: tmp };
|
|
110436
|
+
});
|
|
110437
|
+
var TemporaryDirectory = class TemporaryDirectory extends Service$1()("@systemfsoftware/stryker-js/Sandbox.service/TemporaryDirectory") {
|
|
110438
|
+
static layer(options) {
|
|
110439
|
+
return effect(TemporaryDirectory, makeTemporaryDirectory(options));
|
|
110440
|
+
}
|
|
110441
|
+
};
|
|
110442
|
+
//#endregion
|
|
110443
|
+
//#region src/run/plan-prepare.workflow.ts
|
|
110444
|
+
const PrepareDecisionTypeId = Symbol.for("@systemfsoftware/stryker-js/PrepareDecision");
|
|
110445
|
+
var PrepareDecoded = class extends Class("PrepareDecoded")({
|
|
110446
|
+
mode: Literals$3(["human", "machine"]),
|
|
110447
|
+
reporters: ArraySchema(String$7),
|
|
110448
|
+
fileCount: Finite$3
|
|
110449
|
+
}) {
|
|
110450
|
+
static [Workflow_exports.InstrumentationBrand] = {
|
|
110451
|
+
mode: "stryker.prepare.mode",
|
|
110452
|
+
fileCount: "stryker.prepare.file_count"
|
|
110453
|
+
};
|
|
110454
|
+
};
|
|
110455
|
+
var HumanReporters$1 = class extends TaggedClass()("HumanReporters", { reporters: ArraySchema(String$7) }) {
|
|
110456
|
+
[PrepareDecisionTypeId] = PrepareDecisionTypeId;
|
|
110457
|
+
};
|
|
110458
|
+
var MachineReporters$1 = class extends TaggedClass()("MachineReporters", { reporters: ArraySchema(String$7) }) {
|
|
110459
|
+
[PrepareDecisionTypeId] = PrepareDecisionTypeId;
|
|
110460
|
+
};
|
|
110461
|
+
const planPrepare = Workflow_exports.make({
|
|
110462
|
+
command: PrepareDecoded,
|
|
110463
|
+
decision: Union([HumanReporters$1, MachineReporters$1]),
|
|
110464
|
+
error: Never,
|
|
110465
|
+
decide: (decoded) => value(decoded.mode).pipe(when("human", () => succeed$10(HumanReporters$1.make({ reporters: decoded.reporters }))), when("machine", () => succeed$10(MachineReporters$1.make({ reporters: decoded.reporters }))), exhaustive)
|
|
110466
|
+
});
|
|
110467
|
+
//#endregion
|
|
110309
110468
|
//#region src/plan-mutator-catalogs.workflow.ts
|
|
110310
110469
|
const STOCK_NAMESPACE = "stryker";
|
|
110311
110470
|
const CatalogEntrySchema = Struct({
|
|
@@ -110458,7 +110617,7 @@ const optInRefusalOf = (index, command) => match$8(refusedNameIn(index.optIn, co
|
|
|
110458
110617
|
name
|
|
110459
110618
|
}))
|
|
110460
110619
|
});
|
|
110461
|
-
const decide$
|
|
110620
|
+
const decide$1 = (command) => {
|
|
110462
110621
|
const index = indexOf(command.catalogs);
|
|
110463
110622
|
return map$12(flatMap$8(excludedRefusalOf(index, command), () => optInRefusalOf(index, command)), () => MutatorSelectionDecoded.make({
|
|
110464
110623
|
excludedMutations: [...command.excludedMutations],
|
|
@@ -110469,7 +110628,7 @@ const decodeMutatorSelection = Workflow_exports.make({
|
|
|
110469
110628
|
command: DecodeMutatorSelectionCommand,
|
|
110470
110629
|
decision: MutatorSelectionDecoded,
|
|
110471
110630
|
error: MutatorSelectionRefused,
|
|
110472
|
-
decide: decide$
|
|
110631
|
+
decide: decide$1
|
|
110473
110632
|
});
|
|
110474
110633
|
//#endregion
|
|
110475
110634
|
//#region src/framework-claimant.service.ts
|
|
@@ -110942,131 +111101,6 @@ const pluginUrlsFromOptions = (options) => [
|
|
|
110942
111101
|
...options.checkers.map((checker) => checker.plugin)
|
|
110943
111102
|
];
|
|
110944
111103
|
//#endregion
|
|
110945
|
-
//#region src/reporter-wiring.service.ts
|
|
110946
|
-
const spawnPluginReporterFactory = fn(SpanTaxonomy_exports.Spans.reporterWiringSpawnPluginReporterFactory.name)(function* (name, loaded, projectBasePath, options) {
|
|
110947
|
-
const entry = yield* mapError$3(fromResult(resolveConfiguredPlugin(WorkerSpawnCommand.make({
|
|
110948
|
-
sources: loaded.pluginSources,
|
|
110949
|
-
kind: "Reporter",
|
|
110950
|
-
configured: ConfiguredPluginName.make({ name })
|
|
110951
|
-
}))), (missing) => StageError.make({
|
|
110952
|
-
stage: "prepare",
|
|
110953
|
-
reason: missing.reason,
|
|
110954
|
-
cause: PluginNotFoundError.make({ descriptor: missing.descriptor })
|
|
110955
|
-
}));
|
|
110956
|
-
const client = yield* spawnReporterWorker({
|
|
110957
|
-
entrypoint: entry.entrypoint,
|
|
110958
|
-
projectBasePath,
|
|
110959
|
-
execArgv: [],
|
|
110960
|
-
options,
|
|
110961
|
-
tempDirPrefix: "stryker-reporter-"
|
|
110962
|
-
}).pipe(mapError$3((cause) => StageError.make({
|
|
110963
|
-
stage: "prepare",
|
|
110964
|
-
reason: `Failed to start the reporter worker "${name}"`,
|
|
110965
|
-
cause
|
|
110966
|
-
})));
|
|
110967
|
-
return reporterWorkerFactory(client);
|
|
110968
|
-
});
|
|
110969
|
-
const selectReporterChoices = (names, choicesByName) => map$10(reduce$2(names, empty$15(), (chosen, name) => match$8(get$4(choicesByName, name.toLowerCase()), {
|
|
110970
|
-
onNone: () => chosen,
|
|
110971
|
-
onSome: (choice) => match$8(findFirst(chosen, ([key]) => key === name.toLowerCase()), {
|
|
110972
|
-
onNone: () => [...chosen, [name.toLowerCase(), choice]],
|
|
110973
|
-
onSome: () => chosen
|
|
110974
|
-
})
|
|
110975
|
-
})), ([, choice]) => choice);
|
|
110976
|
-
const reporterInputsOf = dual(5, (names, choicesByName, loaded, projectBasePath, options) => forEach$1(selectReporterChoices(names, choicesByName), (choice) => match$8(choice.builtinFactory, {
|
|
110977
|
-
onSome: (builtin) => succeed$5({
|
|
110978
|
-
name: choice.name,
|
|
110979
|
-
factory: builtin
|
|
110980
|
-
}),
|
|
110981
|
-
onNone: () => map$7(spawnPluginReporterFactory(choice.name, loaded, projectBasePath, options), (factory) => ({
|
|
110982
|
-
name: choice.name,
|
|
110983
|
-
factory
|
|
110984
|
-
}))
|
|
110985
|
-
}), { concurrency: 1 }));
|
|
110986
|
-
//#endregion
|
|
110987
|
-
//#region src/keep-temp-dir.workflow.ts
|
|
110988
|
-
const KeepTempDirTypeId = Symbol.for("@systemfsoftware/stryker-js/KeepTempDir");
|
|
110989
|
-
const CleanTempDirOption = Literals$3([
|
|
110990
|
-
"always",
|
|
110991
|
-
false,
|
|
110992
|
-
true
|
|
110993
|
-
]);
|
|
110994
|
-
var TempDirKept = class extends TaggedClass()("TempDirKept", {}) {
|
|
110995
|
-
[KeepTempDirTypeId] = KeepTempDirTypeId;
|
|
110996
|
-
};
|
|
110997
|
-
var TempDirRemoved = class extends TaggedClass()("TempDirRemoved", {}) {
|
|
110998
|
-
[KeepTempDirTypeId] = KeepTempDirTypeId;
|
|
110999
|
-
};
|
|
111000
|
-
var KeepTempDirCommand = class extends TaggedClass()("KeepTempDirCommand", {
|
|
111001
|
-
cleanTempDir: CleanTempDirOption,
|
|
111002
|
-
failed: Boolean$6
|
|
111003
|
-
}) {
|
|
111004
|
-
static [Workflow_exports.InstrumentationBrand] = {};
|
|
111005
|
-
};
|
|
111006
|
-
const keptIff = (kept) => value(kept).pipe(when(true, () => TempDirKept.make({})), when(false, () => TempDirRemoved.make({})), exhaustive);
|
|
111007
|
-
const decide$1 = (command) => value(command.cleanTempDir).pipe(when(false, () => TempDirKept.make({})), when(true, () => keptIff(command.failed)), when("always", () => TempDirRemoved.make({})), exhaustive, succeed$10);
|
|
111008
|
-
const keepTempDir = Workflow_exports.make({
|
|
111009
|
-
command: KeepTempDirCommand,
|
|
111010
|
-
decision: Union([TempDirKept, TempDirRemoved]),
|
|
111011
|
-
error: Never,
|
|
111012
|
-
decide: decide$1
|
|
111013
|
-
});
|
|
111014
|
-
//#endregion
|
|
111015
|
-
//#region src/Sandbox.service.ts
|
|
111016
|
-
const removesTempDir = (exit, cleanTempDir) => match$6(keepTempDir(KeepTempDirCommand.make({
|
|
111017
|
-
cleanTempDir,
|
|
111018
|
-
failed: isFailure(exit)
|
|
111019
|
-
})), {
|
|
111020
|
-
onFailure: () => false,
|
|
111021
|
-
onSuccess: (decision) => value(decision).pipe(tag("TempDirRemoved", () => true), tag("TempDirKept", () => false), exhaustive)
|
|
111022
|
-
});
|
|
111023
|
-
const removeEmptyParentDirectory = fn(SpanTaxonomy_exports.Spans.sandboxRemoveEmptyParent.name)(function* (parent, fs) {
|
|
111024
|
-
const siblings = yield* fs.readDirectory(parent);
|
|
111025
|
-
yield* match$1(siblings.length === 0, {
|
|
111026
|
-
onTrue: () => fs.remove(parent, {
|
|
111027
|
-
recursive: true,
|
|
111028
|
-
force: true
|
|
111029
|
-
}),
|
|
111030
|
-
onFalse: () => void_$1
|
|
111031
|
-
});
|
|
111032
|
-
});
|
|
111033
|
-
const removeTempDirectory = fn(SpanTaxonomy_exports.Spans.sandboxRemoveTempDir.name)(function* (tmp, parent, fs) {
|
|
111034
|
-
yield* logDebug(`Deleting stryker temp directory ${tmp}`);
|
|
111035
|
-
yield* fs.remove(tmp, {
|
|
111036
|
-
recursive: true,
|
|
111037
|
-
force: true
|
|
111038
|
-
});
|
|
111039
|
-
const parentExists = yield* fs.exists(parent);
|
|
111040
|
-
yield* match$1(parentExists, {
|
|
111041
|
-
onTrue: () => removeEmptyParentDirectory(parent, fs),
|
|
111042
|
-
onFalse: () => void_$1
|
|
111043
|
-
});
|
|
111044
|
-
});
|
|
111045
|
-
const makeTemporaryDirectory = fn(SpanTaxonomy_exports.Spans.sandboxMakeTempDir.name)(function* (options) {
|
|
111046
|
-
const fs = yield* FileSystem;
|
|
111047
|
-
const parent = (yield* Path$1).resolve(options.tempDirName);
|
|
111048
|
-
yield* fs.makeDirectory(parent, { recursive: true });
|
|
111049
|
-
const prefix = match$1(options.inPlace, {
|
|
111050
|
-
onTrue: () => "backup-",
|
|
111051
|
-
onFalse: () => "sandbox-"
|
|
111052
|
-
});
|
|
111053
|
-
const tmp = yield* fs.makeTempDirectory({
|
|
111054
|
-
directory: parent,
|
|
111055
|
-
prefix
|
|
111056
|
-
});
|
|
111057
|
-
yield* logDebug(`Using temp directory "${tmp}"`);
|
|
111058
|
-
yield* addFinalizer((exit) => match$1(removesTempDir(exit, options.cleanTempDir), {
|
|
111059
|
-
onTrue: () => removeTempDirectory(tmp, parent, fs),
|
|
111060
|
-
onFalse: () => logDebug(`Keeping stryker temp directory ${tmp}`)
|
|
111061
|
-
}).pipe(orDie));
|
|
111062
|
-
return { path: tmp };
|
|
111063
|
-
});
|
|
111064
|
-
var TemporaryDirectory = class TemporaryDirectory extends Service$1()("@systemfsoftware/stryker-js/Sandbox.service/TemporaryDirectory") {
|
|
111065
|
-
static layer(options) {
|
|
111066
|
-
return effect(TemporaryDirectory, makeTemporaryDirectory(options));
|
|
111067
|
-
}
|
|
111068
|
-
};
|
|
111069
|
-
//#endregion
|
|
111070
111104
|
//#region src/run/admit-non-empty-project.workflow.ts
|
|
111071
111105
|
const NonEmptyProjectTypeId = Symbol.for("@systemfsoftware/stryker-js/NonEmptyProjectDecision");
|
|
111072
111106
|
var NonEmptyProjectCommand = class extends TaggedClass()("NonEmptyProjectCommand", { fileCount: Int$4 }) {
|
|
@@ -111089,31 +111123,6 @@ const admitNonEmptyProject = Workflow_exports.make({
|
|
|
111089
111123
|
}))
|
|
111090
111124
|
});
|
|
111091
111125
|
//#endregion
|
|
111092
|
-
//#region src/run/plan-prepare.workflow.ts
|
|
111093
|
-
const PrepareDecisionTypeId = Symbol.for("@systemfsoftware/stryker-js/PrepareDecision");
|
|
111094
|
-
var PrepareDecoded = class extends Class("PrepareDecoded")({
|
|
111095
|
-
mode: Literals$3(["human", "machine"]),
|
|
111096
|
-
reporters: ArraySchema(String$7),
|
|
111097
|
-
fileCount: Finite$3
|
|
111098
|
-
}) {
|
|
111099
|
-
static [Workflow_exports.InstrumentationBrand] = {
|
|
111100
|
-
mode: "stryker.prepare.mode",
|
|
111101
|
-
fileCount: "stryker.prepare.file_count"
|
|
111102
|
-
};
|
|
111103
|
-
};
|
|
111104
|
-
var HumanReporters$1 = class extends TaggedClass()("HumanReporters", { reporters: ArraySchema(String$7) }) {
|
|
111105
|
-
[PrepareDecisionTypeId] = PrepareDecisionTypeId;
|
|
111106
|
-
};
|
|
111107
|
-
var MachineReporters$1 = class extends TaggedClass()("MachineReporters", { reporters: ArraySchema(String$7) }) {
|
|
111108
|
-
[PrepareDecisionTypeId] = PrepareDecisionTypeId;
|
|
111109
|
-
};
|
|
111110
|
-
const planPrepare = Workflow_exports.make({
|
|
111111
|
-
command: PrepareDecoded,
|
|
111112
|
-
decision: Union([HumanReporters$1, MachineReporters$1]),
|
|
111113
|
-
error: Never,
|
|
111114
|
-
decide: (decoded) => value(decoded.mode).pipe(when("human", () => succeed$10(HumanReporters$1.make({ reporters: decoded.reporters }))), when("machine", () => succeed$10(MachineReporters$1.make({ reporters: decoded.reporters }))), exhaustive)
|
|
111115
|
-
});
|
|
111116
|
-
//#endregion
|
|
111117
111126
|
//#region src/run/plan-reporters.workflow.ts
|
|
111118
111127
|
const ReporterPlanTypeId = Symbol.for("@systemfsoftware/stryker-js/ReporterPlanDecision");
|
|
111119
111128
|
const STREAM_REPORTER = StreamReporterSchema.literal;
|
|
@@ -111345,7 +111354,7 @@ const validateOptions = dual(2, (options, schema) => validateOptionsCell.run(Val
|
|
|
111345
111354
|
schema
|
|
111346
111355
|
})));
|
|
111347
111356
|
//#endregion
|
|
111348
|
-
//#region src/run/prepare.
|
|
111357
|
+
//#region src/run/prepare.ts
|
|
111349
111358
|
const announceSummary = fn(SpanTaxonomy_exports.Spans.prepareAnnounceSummary.name)(function* (input) {
|
|
111350
111359
|
yield* value(input.env.resolvedMode.mode).pipe(when("human", () => match$1(input.env.allowConsoleColors, {
|
|
111351
111360
|
onTrue: () => log(`${AnsiCode.fields.green.literal}${input.summary}${AnsiCode.fields.reset.literal}`),
|
|
@@ -111458,7 +111467,7 @@ const readPrepare = fn(SpanTaxonomy_exports.Spans.prepareGather.name)(function*
|
|
|
111458
111467
|
frameworkClaimants
|
|
111459
111468
|
};
|
|
111460
111469
|
});
|
|
111461
|
-
const
|
|
111470
|
+
const admitPreparedProject = (raw) => gen(function* () {
|
|
111462
111471
|
const mutateCount = pipe(raw.project.filesToMutate, size$3);
|
|
111463
111472
|
yield* announceSummary({
|
|
111464
111473
|
env: raw.env,
|
|
@@ -111479,7 +111488,12 @@ const applyPrepare = fn(SpanTaxonomy_exports.Spans.prepareApply.name)(function*
|
|
|
111479
111488
|
reason: "No input files found."
|
|
111480
111489
|
})
|
|
111481
111490
|
}))), () => succeed$10(void 0));
|
|
111482
|
-
yield* fromResult(emptyProjectGuard);
|
|
111491
|
+
return yield* fromResult(emptyProjectGuard);
|
|
111492
|
+
});
|
|
111493
|
+
//#endregion
|
|
111494
|
+
//#region src/run/prepare.cell.ts
|
|
111495
|
+
const applyPrepare = fn(SpanTaxonomy_exports.Spans.prepareApply.name)(function* (span, reporters, raw) {
|
|
111496
|
+
yield* admitPreparedProject(raw);
|
|
111483
111497
|
const temporaryDirectoryPath = yield* map$7(build(TemporaryDirectory.layer(raw.options)), (temporaryDirectory) => get$13(temporaryDirectory, TemporaryDirectory).path).pipe(mapError$3((cause) => StageError.make({
|
|
111484
111498
|
stage: "prepare",
|
|
111485
111499
|
reason: "Failed to create temporary directory",
|
|
@@ -111796,11 +111810,78 @@ const planShards = Workflow_exports.make({
|
|
|
111796
111810
|
decide: (command) => succeed$10(shardsOf$1(command))
|
|
111797
111811
|
});
|
|
111798
111812
|
//#endregion
|
|
111813
|
+
//#region src/run/plan-instrument.cell.ts
|
|
111814
|
+
const readPlanInstrument = fn(SpanTaxonomy_exports.Spans.instrumentGather.name)(function* (command) {
|
|
111815
|
+
const { filesToMutate, instrumentResult, instrumentedProject } = yield* instrumentFiles(command);
|
|
111816
|
+
return {
|
|
111817
|
+
_tag: "InstrumentCommand",
|
|
111818
|
+
fileCount: filesToMutate.length,
|
|
111819
|
+
inPlace: command.options.inPlace,
|
|
111820
|
+
pluginCount: command.loadedPlugins.pluginModulePaths.length,
|
|
111821
|
+
prev: command,
|
|
111822
|
+
instrumentedProject,
|
|
111823
|
+
instrumentResult,
|
|
111824
|
+
mutants: instrumentResult.mutants
|
|
111825
|
+
};
|
|
111826
|
+
});
|
|
111827
|
+
const writePlanInstrument = (raw) => enteringInstrumentPhase(raw.fileCount, as(offerSkipsIfAny({
|
|
111828
|
+
skipped: raw.instrumentResult.skipped,
|
|
111829
|
+
claimants: raw.prev.frameworkClaimants
|
|
111830
|
+
}), {
|
|
111831
|
+
project: raw.instrumentedProject,
|
|
111832
|
+
mutants: raw.mutants,
|
|
111833
|
+
options: raw.prev.options
|
|
111834
|
+
}));
|
|
111835
|
+
const planInstrumentCell = Sandwich_exports.named(SpanTaxonomy_exports.Spans.instrument.name)(readPlanInstrument).decide(planInstrumentation).write({
|
|
111836
|
+
InPlaceInstrument: (_decision, raw) => writePlanInstrument(raw),
|
|
111837
|
+
EphemeralInstrument: (_decision, raw) => writePlanInstrument(raw),
|
|
111838
|
+
CommandRejected: ({ issue }) => fail$4(StageError.make({
|
|
111839
|
+
stage: "instrument",
|
|
111840
|
+
reason: issue
|
|
111841
|
+
}))
|
|
111842
|
+
});
|
|
111843
|
+
//#endregion
|
|
111844
|
+
//#region src/run/plan-prepare.cell.ts
|
|
111845
|
+
const writePrepareForInstrument = (raw) => withPhaseSpan(SpanTaxonomy_exports.Spans.preparePhase, {}, () => gen(function* () {
|
|
111846
|
+
yield* admitPreparedProject(raw);
|
|
111847
|
+
yield* offer(raw.queue, RunEvent_exports.PhaseEntered.make({
|
|
111848
|
+
phase: "prepare",
|
|
111849
|
+
elapsedMs: raw.now - raw.env.runStartedAt
|
|
111850
|
+
}));
|
|
111851
|
+
return {
|
|
111852
|
+
project: raw.project,
|
|
111853
|
+
loadedPlugins: raw.loaded,
|
|
111854
|
+
ignorers: raw.ignorers,
|
|
111855
|
+
mutatorCatalogs: raw.mutatorCatalogs,
|
|
111856
|
+
mutatorSelection: raw.mutatorSelection,
|
|
111857
|
+
formatRegistry: raw.formatRegistry,
|
|
111858
|
+
options: raw.options,
|
|
111859
|
+
frameworkClaimants: raw.frameworkClaimants
|
|
111860
|
+
};
|
|
111861
|
+
}));
|
|
111862
|
+
const prepareForInstrumentCell = Sandwich_exports.named(SpanTaxonomy_exports.Spans.prepare.name)(readPrepare).decide(planPrepare).write({
|
|
111863
|
+
HumanReporters: (_decision, raw) => writePrepareForInstrument(raw),
|
|
111864
|
+
MachineReporters: (_decision, raw) => writePrepareForInstrument(raw),
|
|
111865
|
+
CommandRejected: ({ issue }) => fail$4(StageError.make({
|
|
111866
|
+
stage: "prepare",
|
|
111867
|
+
reason: issue
|
|
111868
|
+
}))
|
|
111869
|
+
});
|
|
111870
|
+
//#endregion
|
|
111799
111871
|
//#region src/plan-request.cell.ts
|
|
111800
111872
|
const DEFAULT_MUTANT_COST_MS = 1e3;
|
|
111801
|
-
const
|
|
111802
|
-
const
|
|
111803
|
-
const
|
|
111873
|
+
const planStageCell = Cell_exports.andThen(Cell_exports.andThen(Cell_exports.andThen(loadConfigCell, readProjectCell), prepareForInstrumentCell), planInstrumentCell);
|
|
111874
|
+
const namedCostsOf = (costs) => Object.fromEntries(Object.entries(costs).flatMap(([mutantId, entry]) => toArray(map$13(orElse$3(fromNullishOr(entry.actualMs), () => fromNullishOr(entry.predictedMs)), (costMs) => [mutantId, costMs]))));
|
|
111875
|
+
const reportCostsOf = (texts) => texts.reduce((accumulated, text) => match$8(decodeOption(fromJsonString(CostsFieldSchema))(text), {
|
|
111876
|
+
onNone: () => accumulated,
|
|
111877
|
+
onSome: (decoded) => match$8(fromUndefinedOr(decoded.costs), {
|
|
111878
|
+
onNone: () => accumulated,
|
|
111879
|
+
onSome: (costs) => ({
|
|
111880
|
+
...namedCostsOf(costs),
|
|
111881
|
+
...accumulated
|
|
111882
|
+
})
|
|
111883
|
+
})
|
|
111884
|
+
}), {});
|
|
111804
111885
|
const decodeCoverage = (text) => flatMap$9(decodeOption(fromJsonString(ReportedDryRunCoverageSchema))(text), (report) => fromNullishOr(report.dryRunCoverage));
|
|
111805
111886
|
const firstCoverageOf = (texts) => firstSomeOf(texts.map(decodeCoverage));
|
|
111806
111887
|
const testsTimeOf = (tests) => tests.reduce((total, test) => total + test.timeSpentMs, 0);
|
|
@@ -111809,7 +111890,7 @@ const runsWholeSuite = (testCoverage, mutantId) => match$8(fromNullishOr(testCov
|
|
|
111809
111890
|
onSome: (staticCoverage) => getOrElse$1(fromUndefinedOr(staticCoverage[mutantId]), () => 0) > 0
|
|
111810
111891
|
});
|
|
111811
111892
|
const coveringCostOf = (coverage, testCoverage, mutantId) => orElse$3(map$13(filter$7(map$13(get$9(testCoverage.testsByMutantId, mutantId), (tests) => testsTimeOf([...tests])), (millis) => millis > 0), (millis) => millis + coverage.timeOverheadMs), () => filter$7(some$1(testsTimeOf(coverage.tests) + coverage.timeOverheadMs), () => runsWholeSuite(testCoverage, mutantId)));
|
|
111812
|
-
const costOf = (mutantId,
|
|
111893
|
+
const costOf = (mutantId, reportCosts, coverage, testCoverage) => getOrElse$1(orElse$3(get$12(reportCosts, mutantId), () => flatMap$9(coverage, (present) => coveringCostOf(present, testCoverage, mutantId))), () => DEFAULT_MUTANT_COST_MS);
|
|
111813
111894
|
const emptyTestCoverage = () => ({
|
|
111814
111895
|
testsByMutantId: empty$12(),
|
|
111815
111896
|
testsById: empty$12(),
|
|
@@ -111831,7 +111912,7 @@ const planProject = (request, channel, labelBase, directory) => gen(function* ()
|
|
|
111831
111912
|
basePath: project
|
|
111832
111913
|
};
|
|
111833
111914
|
const context = yield* build(RunEnvironment.stage(env, channel.environment.host.events));
|
|
111834
|
-
const done = yield* Cell_exports.provideContext(
|
|
111915
|
+
const done = yield* Cell_exports.provideContext(planStageCell, context).run({
|
|
111835
111916
|
cliOptions: { force: request.full },
|
|
111836
111917
|
targetMutatePatterns: void 0
|
|
111837
111918
|
});
|
|
@@ -111844,6 +111925,7 @@ const planProject = (request, channel, labelBase, directory) => gen(function* ()
|
|
|
111844
111925
|
onNone: emptyTestCoverage,
|
|
111845
111926
|
onSome: reusedTestCoverage
|
|
111846
111927
|
});
|
|
111928
|
+
const reportCosts = reportCostsOf(texts);
|
|
111847
111929
|
const mutants = (yield* readIncrementalReuse({
|
|
111848
111930
|
project: done.project,
|
|
111849
111931
|
currentMutants: [...done.mutants],
|
|
@@ -111852,10 +111934,10 @@ const planProject = (request, channel, labelBase, directory) => gen(function* ()
|
|
|
111852
111934
|
force: request.full,
|
|
111853
111935
|
options: done.options,
|
|
111854
111936
|
globalTestInputs: map$13(coverage, (present) => [...present.globalTestInputs]).pipe(getOrElse$1(() => [])),
|
|
111855
|
-
|
|
111937
|
+
originalFileOf: (file) => path.resolve(file)
|
|
111856
111938
|
})).mutants.map((mutant) => ({
|
|
111857
111939
|
id: mutant.id,
|
|
111858
|
-
costMs: costOf(mutant.id,
|
|
111940
|
+
costMs: costOf(mutant.id, reportCosts, coverage, testCoverage)
|
|
111859
111941
|
}));
|
|
111860
111942
|
return {
|
|
111861
111943
|
label: labelOf$1(path, labelBase, project),
|
package/dist/promises.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as nodePlatformLayer, t as strykerCell } from "./run-stages-
|
|
1
|
+
import { C as nodePlatformLayer, t as strykerCell } from "./run-stages-CpYiJ2Mz.mjs";
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
3
|
import { dual } from "effect/Function";
|
|
4
4
|
//#region src/drivers/promise.ts
|
|
@@ -11346,7 +11346,7 @@ const strykerOutputFilesOf = (options) => [
|
|
|
11346
11346
|
];
|
|
11347
11347
|
//#endregion
|
|
11348
11348
|
//#region package.json
|
|
11349
|
-
var version = "17.0.
|
|
11349
|
+
var version = "17.0.1";
|
|
11350
11350
|
//#endregion
|
|
11351
11351
|
//#region src/stryker-package.schema.ts
|
|
11352
11352
|
var StrykerPackage = class extends S.Class("StrykerPackage")({
|
|
@@ -17409,7 +17409,7 @@ const explainFileSkip = Workflow.make({
|
|
|
17409
17409
|
decide: (command) => Match$1.value(skipKnownOrUnknownOf(explainedOf(command))).pipe(Match$1.tag("SkipKnownExplained", (known) => Result.succeed(known)), Match$1.tag("SkipUnknownExplained", (unknown) => Result.succeed(unknown)), Match$1.exhaustive)
|
|
17410
17410
|
});
|
|
17411
17411
|
//#endregion
|
|
17412
|
-
//#region src/run/instrument.
|
|
17412
|
+
//#region src/run/instrument.ts
|
|
17413
17413
|
const reportSkippedFiles = Effect$1.fn(SpanTaxonomy_exports.Spans.instrumentReportSkips.name)(function* (input) {
|
|
17414
17414
|
const files = input.skipped.map((skip) => Result.match(explainFileSkip(ExplainFileSkipCommand.make({
|
|
17415
17415
|
extension: skip.extension,
|
|
@@ -17431,13 +17431,6 @@ const offerSkipsIfAny = Effect$1.fn(SpanTaxonomy_exports.Spans.instrumentOfferSk
|
|
|
17431
17431
|
onFalse: () => reportSkippedFiles(input)
|
|
17432
17432
|
});
|
|
17433
17433
|
});
|
|
17434
|
-
const sandboxDirectoriesOf = (input) => Option$1.getOrElse(Option$1.map(Option$1.filter(Option$1.some(input), () => input.command.options.inPlace), (inPlace) => ({
|
|
17435
|
-
workingDirectory: inPlace.basePath,
|
|
17436
|
-
backupDirectory: inPlace.command.temporaryDirectoryPath
|
|
17437
|
-
})), () => ({
|
|
17438
|
-
workingDirectory: input.command.temporaryDirectoryPath,
|
|
17439
|
-
backupDirectory: ""
|
|
17440
|
-
}));
|
|
17441
17434
|
const mergeInstrumentedFile = (input) => {
|
|
17442
17435
|
const files = MutableHashMap.fromIterable(input.project.files);
|
|
17443
17436
|
MutableHashMap.set(files, input.file.name, input.file);
|
|
@@ -17452,20 +17445,6 @@ const mergeInstrumentedFile = (input) => {
|
|
|
17452
17445
|
filesToMutate
|
|
17453
17446
|
};
|
|
17454
17447
|
};
|
|
17455
|
-
const enteringInstrumentPhase = (raw, body) => withPhaseSpan(SpanTaxonomy_exports.Spans.instrumentPhase, { fileCount: raw.filesToMutate.length }, () => Effect$1.andThen(phaseEntered("instrument"), body));
|
|
17456
|
-
const writeInstrument = (raw) => enteringInstrumentPhase(raw, Effect$1.as(offerSkipsIfAny({
|
|
17457
|
-
skipped: raw.instrumentResult.skipped,
|
|
17458
|
-
claimants: raw.prev.frameworkClaimants
|
|
17459
|
-
}), {
|
|
17460
|
-
...raw.prev,
|
|
17461
|
-
project: raw.instrumentedProject,
|
|
17462
|
-
mutants: raw.instrumentResult.mutants,
|
|
17463
|
-
sandbox: raw.sandbox,
|
|
17464
|
-
concurrency: {
|
|
17465
|
-
testRunners: raw.concurrency.testRunners,
|
|
17466
|
-
checkers: raw.concurrency.checkers
|
|
17467
|
-
}
|
|
17468
|
-
}));
|
|
17469
17448
|
const withInstrumentedFiles = (project, instrumented) => Arr.reduce([...instrumented], project, (current, { name, content }) => Option$1.getOrElse(Option$1.map(MutableHashMap.get(current.files, name), (existing) => mergeInstrumentedFile({
|
|
17470
17449
|
project: current,
|
|
17471
17450
|
file: {
|
|
@@ -17473,9 +17452,7 @@ const withInstrumentedFiles = (project, instrumented) => Arr.reduce([...instrume
|
|
|
17473
17452
|
content
|
|
17474
17453
|
}
|
|
17475
17454
|
})), () => current));
|
|
17476
|
-
const
|
|
17477
|
-
yield* Scope.Scope;
|
|
17478
|
-
const env = yield* RunEnvironment;
|
|
17455
|
+
const instrumentFiles = Effect$1.fnUntraced(function* (command) {
|
|
17479
17456
|
const files = yield* ProjectFiles;
|
|
17480
17457
|
const filesToMutate = yield* Effect$1.map(files.readAll(MutableHashMap.values(command.project.filesToMutate)), (readFiles) => readFiles.map(([file, content]) => ({
|
|
17481
17458
|
content,
|
|
@@ -17497,7 +17474,39 @@ const readInstrument = Effect$1.fn(SpanTaxonomy_exports.Spans.instrumentGather.n
|
|
|
17497
17474
|
reason: "Instrumenter failed",
|
|
17498
17475
|
cause
|
|
17499
17476
|
})));
|
|
17500
|
-
|
|
17477
|
+
return {
|
|
17478
|
+
filesToMutate,
|
|
17479
|
+
instrumentResult,
|
|
17480
|
+
instrumentedProject: withInstrumentedFiles(command.project, instrumentResult.files)
|
|
17481
|
+
};
|
|
17482
|
+
});
|
|
17483
|
+
const enteringInstrumentPhase = dual(2, (fileCount, body) => withPhaseSpan(SpanTaxonomy_exports.Spans.instrumentPhase, { fileCount }, () => Effect$1.andThen(phaseEntered("instrument"), body)));
|
|
17484
|
+
//#endregion
|
|
17485
|
+
//#region src/run/instrument.cell.ts
|
|
17486
|
+
const sandboxDirectoriesOf = (input) => Option$1.getOrElse(Option$1.map(Option$1.filter(Option$1.some(input), () => input.command.options.inPlace), (inPlace) => ({
|
|
17487
|
+
workingDirectory: inPlace.basePath,
|
|
17488
|
+
backupDirectory: inPlace.command.temporaryDirectoryPath
|
|
17489
|
+
})), () => ({
|
|
17490
|
+
workingDirectory: input.command.temporaryDirectoryPath,
|
|
17491
|
+
backupDirectory: ""
|
|
17492
|
+
}));
|
|
17493
|
+
const writeInstrument = (raw) => enteringInstrumentPhase(raw.filesToMutate.length, Effect$1.as(offerSkipsIfAny({
|
|
17494
|
+
skipped: raw.instrumentResult.skipped,
|
|
17495
|
+
claimants: raw.prev.frameworkClaimants
|
|
17496
|
+
}), {
|
|
17497
|
+
...raw.prev,
|
|
17498
|
+
project: raw.instrumentedProject,
|
|
17499
|
+
mutants: raw.instrumentResult.mutants,
|
|
17500
|
+
sandbox: raw.sandbox,
|
|
17501
|
+
concurrency: {
|
|
17502
|
+
testRunners: raw.concurrency.testRunners,
|
|
17503
|
+
checkers: raw.concurrency.checkers
|
|
17504
|
+
}
|
|
17505
|
+
}));
|
|
17506
|
+
const readInstrument = Effect$1.fn(SpanTaxonomy_exports.Spans.instrumentGather.name)(function* (command) {
|
|
17507
|
+
yield* Scope.Scope;
|
|
17508
|
+
const env = yield* RunEnvironment;
|
|
17509
|
+
const { filesToMutate, instrumentResult, instrumentedProject } = yield* instrumentFiles(command);
|
|
17501
17510
|
const directories = sandboxDirectoriesOf({
|
|
17502
17511
|
command,
|
|
17503
17512
|
basePath: env.basePath
|
|
@@ -18174,7 +18183,7 @@ const closureAnalysisOf = (input) => Effect$1.option(analyzeImportClosure({
|
|
|
18174
18183
|
rootDir: input.basePath,
|
|
18175
18184
|
projectFiles: Arr.dedupe([...MutableHashMap.keys(input.project.files), ...input.project.testFiles]),
|
|
18176
18185
|
testFiles: [...input.project.testFiles],
|
|
18177
|
-
globalInputs: input.globalTestInputs.map((file) =>
|
|
18186
|
+
globalInputs: input.globalTestInputs.map((file) => input.originalFileOf(file))
|
|
18178
18187
|
}).pipe(Effect$1.tapCause((cause) => Effect$1.logWarning(`Import closure analysis failed; refusing to reuse prior verdicts: ${Cause.pretty(cause)}`))));
|
|
18179
18188
|
const closureDigestsOf = (input) => Effect$1.map(closureAnalysisOf(input), (analysis) => Option$1.match(analysis, {
|
|
18180
18189
|
onNone: () => ({
|
|
@@ -19221,7 +19230,7 @@ const proceedPipeline = Effect$1.fnUntraced(function* (raw) {
|
|
|
19221
19230
|
force: prev.options.force,
|
|
19222
19231
|
options: prev.options,
|
|
19223
19232
|
globalTestInputs: prev.dryRunResult.globalTestInputs ?? [],
|
|
19224
|
-
|
|
19233
|
+
originalFileOf: (file) => originalFileFor(prev.sandbox, file)
|
|
19225
19234
|
});
|
|
19226
19235
|
const rememberedResults = reuse.rememberedResults;
|
|
19227
19236
|
yield* Queue.offer(progressQueue, RunEvent_exports.ReuseReported.make({
|
|
@@ -19376,6 +19385,156 @@ const mutationTestCell$1 = Sandwich.named(SpanTaxonomy_exports.Spans.mutationTes
|
|
|
19376
19385
|
}))
|
|
19377
19386
|
});
|
|
19378
19387
|
//#endregion
|
|
19388
|
+
//#region src/reporter-wiring.service.ts
|
|
19389
|
+
const spawnPluginReporterFactory = Effect$1.fn(SpanTaxonomy_exports.Spans.reporterWiringSpawnPluginReporterFactory.name)(function* (name, loaded, projectBasePath, options) {
|
|
19390
|
+
const entry = yield* Effect$1.mapError(Effect$1.fromResult(resolveConfiguredPlugin(WorkerSpawnCommand.make({
|
|
19391
|
+
sources: loaded.pluginSources,
|
|
19392
|
+
kind: "Reporter",
|
|
19393
|
+
configured: ConfiguredPluginName.make({ name })
|
|
19394
|
+
}))), (missing) => StageError.make({
|
|
19395
|
+
stage: "prepare",
|
|
19396
|
+
reason: missing.reason,
|
|
19397
|
+
cause: PluginNotFoundError.make({ descriptor: missing.descriptor })
|
|
19398
|
+
}));
|
|
19399
|
+
const client = yield* spawnReporterWorker({
|
|
19400
|
+
entrypoint: entry.entrypoint,
|
|
19401
|
+
projectBasePath,
|
|
19402
|
+
execArgv: [],
|
|
19403
|
+
options,
|
|
19404
|
+
tempDirPrefix: "stryker-reporter-"
|
|
19405
|
+
}).pipe(Effect$1.mapError((cause) => StageError.make({
|
|
19406
|
+
stage: "prepare",
|
|
19407
|
+
reason: `Failed to start the reporter worker "${name}"`,
|
|
19408
|
+
cause
|
|
19409
|
+
})));
|
|
19410
|
+
return reporterWorkerFactory(client);
|
|
19411
|
+
});
|
|
19412
|
+
const selectReporterChoices = (names, choicesByName) => Arr.map(Arr.reduce(names, Arr.empty(), (chosen, name) => Option$1.match(HashMap.get(choicesByName, name.toLowerCase()), {
|
|
19413
|
+
onNone: () => chosen,
|
|
19414
|
+
onSome: (choice) => Option$1.match(Arr.findFirst(chosen, ([key]) => key === name.toLowerCase()), {
|
|
19415
|
+
onNone: () => [...chosen, [name.toLowerCase(), choice]],
|
|
19416
|
+
onSome: () => chosen
|
|
19417
|
+
})
|
|
19418
|
+
})), ([, choice]) => choice);
|
|
19419
|
+
const reporterInputsOf = dual(5, (names, choicesByName, loaded, projectBasePath, options) => Effect$1.forEach(selectReporterChoices(names, choicesByName), (choice) => Option$1.match(choice.builtinFactory, {
|
|
19420
|
+
onSome: (builtin) => Effect$1.succeed({
|
|
19421
|
+
name: choice.name,
|
|
19422
|
+
factory: builtin
|
|
19423
|
+
}),
|
|
19424
|
+
onNone: () => Effect$1.map(spawnPluginReporterFactory(choice.name, loaded, projectBasePath, options), (factory) => ({
|
|
19425
|
+
name: choice.name,
|
|
19426
|
+
factory
|
|
19427
|
+
}))
|
|
19428
|
+
}), { concurrency: 1 }));
|
|
19429
|
+
//#endregion
|
|
19430
|
+
//#region src/keep-temp-dir.workflow.ts
|
|
19431
|
+
const KeepTempDirTypeId = Symbol.for("@systemfsoftware/stryker-js/KeepTempDir");
|
|
19432
|
+
const CleanTempDirOption = S.Literals([
|
|
19433
|
+
"always",
|
|
19434
|
+
false,
|
|
19435
|
+
true
|
|
19436
|
+
]);
|
|
19437
|
+
var TempDirKept = class extends S.TaggedClass()("TempDirKept", {}) {
|
|
19438
|
+
[KeepTempDirTypeId] = KeepTempDirTypeId;
|
|
19439
|
+
};
|
|
19440
|
+
var TempDirRemoved = class extends S.TaggedClass()("TempDirRemoved", {}) {
|
|
19441
|
+
[KeepTempDirTypeId] = KeepTempDirTypeId;
|
|
19442
|
+
};
|
|
19443
|
+
var KeepTempDirCommand = class extends S.TaggedClass()("KeepTempDirCommand", {
|
|
19444
|
+
cleanTempDir: CleanTempDirOption,
|
|
19445
|
+
failed: S.Boolean
|
|
19446
|
+
}) {
|
|
19447
|
+
static [Workflow.InstrumentationBrand] = {};
|
|
19448
|
+
};
|
|
19449
|
+
const keptIff = (kept) => Match$1.value(kept).pipe(Match$1.when(true, () => TempDirKept.make({})), Match$1.when(false, () => TempDirRemoved.make({})), Match$1.exhaustive);
|
|
19450
|
+
const decide$1 = (command) => Match$1.value(command.cleanTempDir).pipe(Match$1.when(false, () => TempDirKept.make({})), Match$1.when(true, () => keptIff(command.failed)), Match$1.when("always", () => TempDirRemoved.make({})), Match$1.exhaustive, Result.succeed);
|
|
19451
|
+
const keepTempDir = Workflow.make({
|
|
19452
|
+
command: KeepTempDirCommand,
|
|
19453
|
+
decision: S.Union([TempDirKept, TempDirRemoved]),
|
|
19454
|
+
error: S.Never,
|
|
19455
|
+
decide: decide$1
|
|
19456
|
+
});
|
|
19457
|
+
//#endregion
|
|
19458
|
+
//#region src/Sandbox.service.ts
|
|
19459
|
+
const removesTempDir = (exit, cleanTempDir) => Result.match(keepTempDir(KeepTempDirCommand.make({
|
|
19460
|
+
cleanTempDir,
|
|
19461
|
+
failed: Exit.isFailure(exit)
|
|
19462
|
+
})), {
|
|
19463
|
+
onFailure: () => false,
|
|
19464
|
+
onSuccess: (decision) => Match$1.value(decision).pipe(Match$1.tag("TempDirRemoved", () => true), Match$1.tag("TempDirKept", () => false), Match$1.exhaustive)
|
|
19465
|
+
});
|
|
19466
|
+
const removeEmptyParentDirectory = Effect$1.fn(SpanTaxonomy_exports.Spans.sandboxRemoveEmptyParent.name)(function* (parent, fs) {
|
|
19467
|
+
const siblings = yield* fs.readDirectory(parent);
|
|
19468
|
+
yield* Boolean$1.match(siblings.length === 0, {
|
|
19469
|
+
onTrue: () => fs.remove(parent, {
|
|
19470
|
+
recursive: true,
|
|
19471
|
+
force: true
|
|
19472
|
+
}),
|
|
19473
|
+
onFalse: () => Effect$1.void
|
|
19474
|
+
});
|
|
19475
|
+
});
|
|
19476
|
+
const removeTempDirectory = Effect$1.fn(SpanTaxonomy_exports.Spans.sandboxRemoveTempDir.name)(function* (tmp, parent, fs) {
|
|
19477
|
+
yield* Effect$1.logDebug(`Deleting stryker temp directory ${tmp}`);
|
|
19478
|
+
yield* fs.remove(tmp, {
|
|
19479
|
+
recursive: true,
|
|
19480
|
+
force: true
|
|
19481
|
+
});
|
|
19482
|
+
const parentExists = yield* fs.exists(parent);
|
|
19483
|
+
yield* Boolean$1.match(parentExists, {
|
|
19484
|
+
onTrue: () => removeEmptyParentDirectory(parent, fs),
|
|
19485
|
+
onFalse: () => Effect$1.void
|
|
19486
|
+
});
|
|
19487
|
+
});
|
|
19488
|
+
const makeTemporaryDirectory = Effect$1.fn(SpanTaxonomy_exports.Spans.sandboxMakeTempDir.name)(function* (options) {
|
|
19489
|
+
const fs = yield* FileSystem.FileSystem;
|
|
19490
|
+
const parent = (yield* Path.Path).resolve(options.tempDirName);
|
|
19491
|
+
yield* fs.makeDirectory(parent, { recursive: true });
|
|
19492
|
+
const prefix = Boolean$1.match(options.inPlace, {
|
|
19493
|
+
onTrue: () => "backup-",
|
|
19494
|
+
onFalse: () => "sandbox-"
|
|
19495
|
+
});
|
|
19496
|
+
const tmp = yield* fs.makeTempDirectory({
|
|
19497
|
+
directory: parent,
|
|
19498
|
+
prefix
|
|
19499
|
+
});
|
|
19500
|
+
yield* Effect$1.logDebug(`Using temp directory "${tmp}"`);
|
|
19501
|
+
yield* Effect$1.addFinalizer((exit) => Boolean$1.match(removesTempDir(exit, options.cleanTempDir), {
|
|
19502
|
+
onTrue: () => removeTempDirectory(tmp, parent, fs),
|
|
19503
|
+
onFalse: () => Effect$1.logDebug(`Keeping stryker temp directory ${tmp}`)
|
|
19504
|
+
}).pipe(Effect$1.orDie));
|
|
19505
|
+
return { path: tmp };
|
|
19506
|
+
});
|
|
19507
|
+
var TemporaryDirectory = class TemporaryDirectory extends Context.Service()("@systemfsoftware/stryker-js/Sandbox.service/TemporaryDirectory") {
|
|
19508
|
+
static layer(options) {
|
|
19509
|
+
return Layer.effect(TemporaryDirectory, makeTemporaryDirectory(options));
|
|
19510
|
+
}
|
|
19511
|
+
};
|
|
19512
|
+
//#endregion
|
|
19513
|
+
//#region src/run/plan-prepare.workflow.ts
|
|
19514
|
+
const PrepareDecisionTypeId = Symbol.for("@systemfsoftware/stryker-js/PrepareDecision");
|
|
19515
|
+
var PrepareDecoded = class extends S.Class("PrepareDecoded")({
|
|
19516
|
+
mode: S.Literals(["human", "machine"]),
|
|
19517
|
+
reporters: S.Array(S.String),
|
|
19518
|
+
fileCount: S.Finite
|
|
19519
|
+
}) {
|
|
19520
|
+
static [Workflow.InstrumentationBrand] = {
|
|
19521
|
+
mode: "stryker.prepare.mode",
|
|
19522
|
+
fileCount: "stryker.prepare.file_count"
|
|
19523
|
+
};
|
|
19524
|
+
};
|
|
19525
|
+
var HumanReporters$1 = class extends S.TaggedClass()("HumanReporters", { reporters: S.Array(S.String) }) {
|
|
19526
|
+
[PrepareDecisionTypeId] = PrepareDecisionTypeId;
|
|
19527
|
+
};
|
|
19528
|
+
var MachineReporters$1 = class extends S.TaggedClass()("MachineReporters", { reporters: S.Array(S.String) }) {
|
|
19529
|
+
[PrepareDecisionTypeId] = PrepareDecisionTypeId;
|
|
19530
|
+
};
|
|
19531
|
+
const planPrepare = Workflow.make({
|
|
19532
|
+
command: PrepareDecoded,
|
|
19533
|
+
decision: S.Union([HumanReporters$1, MachineReporters$1]),
|
|
19534
|
+
error: S.Never,
|
|
19535
|
+
decide: (decoded) => Match$1.value(decoded.mode).pipe(Match$1.when("human", () => Result.succeed(HumanReporters$1.make({ reporters: decoded.reporters }))), Match$1.when("machine", () => Result.succeed(MachineReporters$1.make({ reporters: decoded.reporters }))), Match$1.exhaustive)
|
|
19536
|
+
});
|
|
19537
|
+
//#endregion
|
|
19379
19538
|
//#region src/plan-mutator-catalogs.workflow.ts
|
|
19380
19539
|
const STOCK_NAMESPACE = "stryker";
|
|
19381
19540
|
const CatalogEntrySchema = S.Struct({
|
|
@@ -19528,7 +19687,7 @@ const optInRefusalOf = (index, command) => Option$1.match(refusedNameIn(index.op
|
|
|
19528
19687
|
name
|
|
19529
19688
|
}))
|
|
19530
19689
|
});
|
|
19531
|
-
const decide
|
|
19690
|
+
const decide = (command) => {
|
|
19532
19691
|
const index = indexOf(command.catalogs);
|
|
19533
19692
|
return Result.map(Result.flatMap(excludedRefusalOf(index, command), () => optInRefusalOf(index, command)), () => MutatorSelectionDecoded.make({
|
|
19534
19693
|
excludedMutations: [...command.excludedMutations],
|
|
@@ -19539,7 +19698,7 @@ const decodeMutatorSelection = Workflow.make({
|
|
|
19539
19698
|
command: DecodeMutatorSelectionCommand,
|
|
19540
19699
|
decision: MutatorSelectionDecoded,
|
|
19541
19700
|
error: MutatorSelectionRefused,
|
|
19542
|
-
decide
|
|
19701
|
+
decide
|
|
19543
19702
|
});
|
|
19544
19703
|
//#endregion
|
|
19545
19704
|
//#region src/framework-claimant.service.ts
|
|
@@ -20012,131 +20171,6 @@ const pluginUrlsFromOptions = (options) => [
|
|
|
20012
20171
|
...options.checkers.map((checker) => checker.plugin)
|
|
20013
20172
|
];
|
|
20014
20173
|
//#endregion
|
|
20015
|
-
//#region src/reporter-wiring.service.ts
|
|
20016
|
-
const spawnPluginReporterFactory = Effect$1.fn(SpanTaxonomy_exports.Spans.reporterWiringSpawnPluginReporterFactory.name)(function* (name, loaded, projectBasePath, options) {
|
|
20017
|
-
const entry = yield* Effect$1.mapError(Effect$1.fromResult(resolveConfiguredPlugin(WorkerSpawnCommand.make({
|
|
20018
|
-
sources: loaded.pluginSources,
|
|
20019
|
-
kind: "Reporter",
|
|
20020
|
-
configured: ConfiguredPluginName.make({ name })
|
|
20021
|
-
}))), (missing) => StageError.make({
|
|
20022
|
-
stage: "prepare",
|
|
20023
|
-
reason: missing.reason,
|
|
20024
|
-
cause: PluginNotFoundError.make({ descriptor: missing.descriptor })
|
|
20025
|
-
}));
|
|
20026
|
-
const client = yield* spawnReporterWorker({
|
|
20027
|
-
entrypoint: entry.entrypoint,
|
|
20028
|
-
projectBasePath,
|
|
20029
|
-
execArgv: [],
|
|
20030
|
-
options,
|
|
20031
|
-
tempDirPrefix: "stryker-reporter-"
|
|
20032
|
-
}).pipe(Effect$1.mapError((cause) => StageError.make({
|
|
20033
|
-
stage: "prepare",
|
|
20034
|
-
reason: `Failed to start the reporter worker "${name}"`,
|
|
20035
|
-
cause
|
|
20036
|
-
})));
|
|
20037
|
-
return reporterWorkerFactory(client);
|
|
20038
|
-
});
|
|
20039
|
-
const selectReporterChoices = (names, choicesByName) => Arr.map(Arr.reduce(names, Arr.empty(), (chosen, name) => Option$1.match(HashMap.get(choicesByName, name.toLowerCase()), {
|
|
20040
|
-
onNone: () => chosen,
|
|
20041
|
-
onSome: (choice) => Option$1.match(Arr.findFirst(chosen, ([key]) => key === name.toLowerCase()), {
|
|
20042
|
-
onNone: () => [...chosen, [name.toLowerCase(), choice]],
|
|
20043
|
-
onSome: () => chosen
|
|
20044
|
-
})
|
|
20045
|
-
})), ([, choice]) => choice);
|
|
20046
|
-
const reporterInputsOf = dual(5, (names, choicesByName, loaded, projectBasePath, options) => Effect$1.forEach(selectReporterChoices(names, choicesByName), (choice) => Option$1.match(choice.builtinFactory, {
|
|
20047
|
-
onSome: (builtin) => Effect$1.succeed({
|
|
20048
|
-
name: choice.name,
|
|
20049
|
-
factory: builtin
|
|
20050
|
-
}),
|
|
20051
|
-
onNone: () => Effect$1.map(spawnPluginReporterFactory(choice.name, loaded, projectBasePath, options), (factory) => ({
|
|
20052
|
-
name: choice.name,
|
|
20053
|
-
factory
|
|
20054
|
-
}))
|
|
20055
|
-
}), { concurrency: 1 }));
|
|
20056
|
-
//#endregion
|
|
20057
|
-
//#region src/keep-temp-dir.workflow.ts
|
|
20058
|
-
const KeepTempDirTypeId = Symbol.for("@systemfsoftware/stryker-js/KeepTempDir");
|
|
20059
|
-
const CleanTempDirOption = S.Literals([
|
|
20060
|
-
"always",
|
|
20061
|
-
false,
|
|
20062
|
-
true
|
|
20063
|
-
]);
|
|
20064
|
-
var TempDirKept = class extends S.TaggedClass()("TempDirKept", {}) {
|
|
20065
|
-
[KeepTempDirTypeId] = KeepTempDirTypeId;
|
|
20066
|
-
};
|
|
20067
|
-
var TempDirRemoved = class extends S.TaggedClass()("TempDirRemoved", {}) {
|
|
20068
|
-
[KeepTempDirTypeId] = KeepTempDirTypeId;
|
|
20069
|
-
};
|
|
20070
|
-
var KeepTempDirCommand = class extends S.TaggedClass()("KeepTempDirCommand", {
|
|
20071
|
-
cleanTempDir: CleanTempDirOption,
|
|
20072
|
-
failed: S.Boolean
|
|
20073
|
-
}) {
|
|
20074
|
-
static [Workflow.InstrumentationBrand] = {};
|
|
20075
|
-
};
|
|
20076
|
-
const keptIff = (kept) => Match$1.value(kept).pipe(Match$1.when(true, () => TempDirKept.make({})), Match$1.when(false, () => TempDirRemoved.make({})), Match$1.exhaustive);
|
|
20077
|
-
const decide = (command) => Match$1.value(command.cleanTempDir).pipe(Match$1.when(false, () => TempDirKept.make({})), Match$1.when(true, () => keptIff(command.failed)), Match$1.when("always", () => TempDirRemoved.make({})), Match$1.exhaustive, Result.succeed);
|
|
20078
|
-
const keepTempDir = Workflow.make({
|
|
20079
|
-
command: KeepTempDirCommand,
|
|
20080
|
-
decision: S.Union([TempDirKept, TempDirRemoved]),
|
|
20081
|
-
error: S.Never,
|
|
20082
|
-
decide
|
|
20083
|
-
});
|
|
20084
|
-
//#endregion
|
|
20085
|
-
//#region src/Sandbox.service.ts
|
|
20086
|
-
const removesTempDir = (exit, cleanTempDir) => Result.match(keepTempDir(KeepTempDirCommand.make({
|
|
20087
|
-
cleanTempDir,
|
|
20088
|
-
failed: Exit.isFailure(exit)
|
|
20089
|
-
})), {
|
|
20090
|
-
onFailure: () => false,
|
|
20091
|
-
onSuccess: (decision) => Match$1.value(decision).pipe(Match$1.tag("TempDirRemoved", () => true), Match$1.tag("TempDirKept", () => false), Match$1.exhaustive)
|
|
20092
|
-
});
|
|
20093
|
-
const removeEmptyParentDirectory = Effect$1.fn(SpanTaxonomy_exports.Spans.sandboxRemoveEmptyParent.name)(function* (parent, fs) {
|
|
20094
|
-
const siblings = yield* fs.readDirectory(parent);
|
|
20095
|
-
yield* Boolean$1.match(siblings.length === 0, {
|
|
20096
|
-
onTrue: () => fs.remove(parent, {
|
|
20097
|
-
recursive: true,
|
|
20098
|
-
force: true
|
|
20099
|
-
}),
|
|
20100
|
-
onFalse: () => Effect$1.void
|
|
20101
|
-
});
|
|
20102
|
-
});
|
|
20103
|
-
const removeTempDirectory = Effect$1.fn(SpanTaxonomy_exports.Spans.sandboxRemoveTempDir.name)(function* (tmp, parent, fs) {
|
|
20104
|
-
yield* Effect$1.logDebug(`Deleting stryker temp directory ${tmp}`);
|
|
20105
|
-
yield* fs.remove(tmp, {
|
|
20106
|
-
recursive: true,
|
|
20107
|
-
force: true
|
|
20108
|
-
});
|
|
20109
|
-
const parentExists = yield* fs.exists(parent);
|
|
20110
|
-
yield* Boolean$1.match(parentExists, {
|
|
20111
|
-
onTrue: () => removeEmptyParentDirectory(parent, fs),
|
|
20112
|
-
onFalse: () => Effect$1.void
|
|
20113
|
-
});
|
|
20114
|
-
});
|
|
20115
|
-
const makeTemporaryDirectory = Effect$1.fn(SpanTaxonomy_exports.Spans.sandboxMakeTempDir.name)(function* (options) {
|
|
20116
|
-
const fs = yield* FileSystem.FileSystem;
|
|
20117
|
-
const parent = (yield* Path.Path).resolve(options.tempDirName);
|
|
20118
|
-
yield* fs.makeDirectory(parent, { recursive: true });
|
|
20119
|
-
const prefix = Boolean$1.match(options.inPlace, {
|
|
20120
|
-
onTrue: () => "backup-",
|
|
20121
|
-
onFalse: () => "sandbox-"
|
|
20122
|
-
});
|
|
20123
|
-
const tmp = yield* fs.makeTempDirectory({
|
|
20124
|
-
directory: parent,
|
|
20125
|
-
prefix
|
|
20126
|
-
});
|
|
20127
|
-
yield* Effect$1.logDebug(`Using temp directory "${tmp}"`);
|
|
20128
|
-
yield* Effect$1.addFinalizer((exit) => Boolean$1.match(removesTempDir(exit, options.cleanTempDir), {
|
|
20129
|
-
onTrue: () => removeTempDirectory(tmp, parent, fs),
|
|
20130
|
-
onFalse: () => Effect$1.logDebug(`Keeping stryker temp directory ${tmp}`)
|
|
20131
|
-
}).pipe(Effect$1.orDie));
|
|
20132
|
-
return { path: tmp };
|
|
20133
|
-
});
|
|
20134
|
-
var TemporaryDirectory = class TemporaryDirectory extends Context.Service()("@systemfsoftware/stryker-js/Sandbox.service/TemporaryDirectory") {
|
|
20135
|
-
static layer(options) {
|
|
20136
|
-
return Layer.effect(TemporaryDirectory, makeTemporaryDirectory(options));
|
|
20137
|
-
}
|
|
20138
|
-
};
|
|
20139
|
-
//#endregion
|
|
20140
20174
|
//#region src/run/admit-non-empty-project.workflow.ts
|
|
20141
20175
|
const NonEmptyProjectTypeId = Symbol.for("@systemfsoftware/stryker-js/NonEmptyProjectDecision");
|
|
20142
20176
|
var NonEmptyProjectCommand = class extends S.TaggedClass()("NonEmptyProjectCommand", { fileCount: S.Int }) {
|
|
@@ -20159,31 +20193,6 @@ const admitNonEmptyProject = Workflow.make({
|
|
|
20159
20193
|
}))
|
|
20160
20194
|
});
|
|
20161
20195
|
//#endregion
|
|
20162
|
-
//#region src/run/plan-prepare.workflow.ts
|
|
20163
|
-
const PrepareDecisionTypeId = Symbol.for("@systemfsoftware/stryker-js/PrepareDecision");
|
|
20164
|
-
var PrepareDecoded = class extends S.Class("PrepareDecoded")({
|
|
20165
|
-
mode: S.Literals(["human", "machine"]),
|
|
20166
|
-
reporters: S.Array(S.String),
|
|
20167
|
-
fileCount: S.Finite
|
|
20168
|
-
}) {
|
|
20169
|
-
static [Workflow.InstrumentationBrand] = {
|
|
20170
|
-
mode: "stryker.prepare.mode",
|
|
20171
|
-
fileCount: "stryker.prepare.file_count"
|
|
20172
|
-
};
|
|
20173
|
-
};
|
|
20174
|
-
var HumanReporters$1 = class extends S.TaggedClass()("HumanReporters", { reporters: S.Array(S.String) }) {
|
|
20175
|
-
[PrepareDecisionTypeId] = PrepareDecisionTypeId;
|
|
20176
|
-
};
|
|
20177
|
-
var MachineReporters$1 = class extends S.TaggedClass()("MachineReporters", { reporters: S.Array(S.String) }) {
|
|
20178
|
-
[PrepareDecisionTypeId] = PrepareDecisionTypeId;
|
|
20179
|
-
};
|
|
20180
|
-
const planPrepare = Workflow.make({
|
|
20181
|
-
command: PrepareDecoded,
|
|
20182
|
-
decision: S.Union([HumanReporters$1, MachineReporters$1]),
|
|
20183
|
-
error: S.Never,
|
|
20184
|
-
decide: (decoded) => Match$1.value(decoded.mode).pipe(Match$1.when("human", () => Result.succeed(HumanReporters$1.make({ reporters: decoded.reporters }))), Match$1.when("machine", () => Result.succeed(MachineReporters$1.make({ reporters: decoded.reporters }))), Match$1.exhaustive)
|
|
20185
|
-
});
|
|
20186
|
-
//#endregion
|
|
20187
20196
|
//#region src/run/plan-reporters.workflow.ts
|
|
20188
20197
|
const ReporterPlanTypeId = Symbol.for("@systemfsoftware/stryker-js/ReporterPlanDecision");
|
|
20189
20198
|
const STREAM_REPORTER = StreamReporterSchema.literal;
|
|
@@ -20224,7 +20233,7 @@ const planReporters = Workflow.make({
|
|
|
20224
20233
|
decide: (command) => Match$1.value(command.mode).pipe(Match$1.when("human", () => Result.succeed(HumanReporters.make({ reporters: [...humanReportersFrom(command.configured)] }))), Match$1.when("machine", () => Result.succeed(MachineReporters.make({ reporters: [...machineReportersFrom(command.configured)] }))), Match$1.exhaustive)
|
|
20225
20234
|
});
|
|
20226
20235
|
//#endregion
|
|
20227
|
-
//#region src/run/prepare.
|
|
20236
|
+
//#region src/run/prepare.ts
|
|
20228
20237
|
const announceSummary = Effect$1.fn(SpanTaxonomy_exports.Spans.prepareAnnounceSummary.name)(function* (input) {
|
|
20229
20238
|
yield* Match$1.value(input.env.resolvedMode.mode).pipe(Match$1.when("human", () => Boolean$1.match(input.env.allowConsoleColors, {
|
|
20230
20239
|
onTrue: () => Console.log(`${AnsiCode.fields.green.literal}${input.summary}${AnsiCode.fields.reset.literal}`),
|
|
@@ -20337,7 +20346,7 @@ const readPrepare = Effect$1.fn(SpanTaxonomy_exports.Spans.prepareGather.name)(f
|
|
|
20337
20346
|
frameworkClaimants
|
|
20338
20347
|
};
|
|
20339
20348
|
});
|
|
20340
|
-
const
|
|
20349
|
+
const admitPreparedProject = (raw) => Effect$1.gen(function* () {
|
|
20341
20350
|
const mutateCount = pipe(raw.project.filesToMutate, MutableHashMap.size);
|
|
20342
20351
|
yield* announceSummary({
|
|
20343
20352
|
env: raw.env,
|
|
@@ -20358,7 +20367,12 @@ const applyPrepare = Effect$1.fn(SpanTaxonomy_exports.Spans.prepareApply.name)(f
|
|
|
20358
20367
|
reason: "No input files found."
|
|
20359
20368
|
})
|
|
20360
20369
|
}))), () => Result.succeed(void 0));
|
|
20361
|
-
yield* Effect$1.fromResult(emptyProjectGuard);
|
|
20370
|
+
return yield* Effect$1.fromResult(emptyProjectGuard);
|
|
20371
|
+
});
|
|
20372
|
+
//#endregion
|
|
20373
|
+
//#region src/run/prepare.cell.ts
|
|
20374
|
+
const applyPrepare = Effect$1.fn(SpanTaxonomy_exports.Spans.prepareApply.name)(function* (span, reporters, raw) {
|
|
20375
|
+
yield* admitPreparedProject(raw);
|
|
20362
20376
|
const temporaryDirectoryPath = yield* Effect$1.map(Layer.build(TemporaryDirectory.layer(raw.options)), (temporaryDirectory) => Context.get(temporaryDirectory, TemporaryDirectory).path).pipe(Effect$1.mapError((cause) => StageError.make({
|
|
20363
20377
|
stage: "prepare",
|
|
20364
20378
|
reason: "Failed to create temporary directory",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@systemfsoftware/stryker-js",
|
|
3
|
-
"version": "17.0.
|
|
3
|
+
"version": "17.0.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/systemfsoftware/stryker-js-effect.git",
|
|
@@ -72,14 +72,14 @@
|
|
|
72
72
|
"vitest": "^5",
|
|
73
73
|
"@systemfsoftware/stryker-config": "^0.1.0",
|
|
74
74
|
"@systemfsoftware/stryker-framework-interface": "^0.0.0",
|
|
75
|
+
"@systemfsoftware/stryker-js-cli-contract": "^0.3.1",
|
|
75
76
|
"@systemfsoftware/stryker-ignorer-interface": "^0.1.1",
|
|
76
77
|
"@systemfsoftware/stryker-js-html-reporter": "^6.0.2",
|
|
77
|
-
"@systemfsoftware/stryker-js-plugin-runtime": "^7.0.2",
|
|
78
78
|
"@systemfsoftware/stryker-js-plugin-interface": "^14.0.0",
|
|
79
79
|
"@systemfsoftware/stryker-js-instrumenter": "^12.1.1",
|
|
80
|
-
"@systemfsoftware/stryker-js-
|
|
81
|
-
"@systemfsoftware/
|
|
82
|
-
"@systemfsoftware/
|
|
80
|
+
"@systemfsoftware/stryker-js-plugin-runtime": "^7.0.2",
|
|
81
|
+
"@systemfsoftware/tsdown-config": "^0.1.0",
|
|
82
|
+
"@systemfsoftware/vitest-config": "^0.1.0"
|
|
83
83
|
},
|
|
84
84
|
"publishConfig": {
|
|
85
85
|
"access": "public",
|