@systemfsoftware/stryker-js 17.0.1 → 17.0.2

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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # @systemfsoftware/stryker-js
2
2
 
3
+ ## 17.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - A shard plan now prices only the mutants a run will actually execute: mutants the incremental cache will reuse are planned at zero cost instead of their previous run time, so an unchanged project plans a single shard with zero predicted seconds. The plan still lists every mutant, so sharded runs keep reporting the full mutant set.
8
+
9
+ - A merged shard report now carries the cost record of every shard, so a later plan sees measured timings for all mutants. Previously only the first shard's costs survived the merge, and the mutants of every other shard fell back to their predicted cost whenever the next plan was derived.
10
+
3
11
  ## 17.0.1
4
12
 
5
13
  ### Patch 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-CpYiJ2Mz.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-DnDU_wrY.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.1";
76757
+ var version = "17.0.2";
76758
76758
  //#endregion
76759
76759
  //#region ../../node_modules/.pnpm/effect@4.0.0/node_modules/effect/dist/cli/CliOutput.js
76760
76760
  /**
@@ -89280,7 +89280,7 @@ const mutantCostModelOf = (input, results) => ({
89280
89280
  priorActualMsByMutantId: Object.fromEntries(flatMap$7(Object.entries(priorCostsOf(input.project.incrementalReport)), priorEntryOf)),
89281
89281
  fixedOverheadMs: input.timeOverheadMs
89282
89282
  });
89283
- const costsOf = (input, results) => mutantCostsOf(mutantCostModelOf(input, results));
89283
+ const costsOf$1 = (input, results) => mutantCostsOf(mutantCostModelOf(input, results));
89284
89284
  const writeIncrementalReport = fn(SpanTaxonomy_exports.Spans.mutationReportingWriteIncrementalReport.name)(function* (deps, input, report, identities) {
89285
89285
  const runInputsDigest = yield* runInputsDigestOf(deps.fs, deps.path, input.basePath, input.options);
89286
89286
  const json = yield* encodeEffect(fromJsonString(Unknown, { space: 2 }))({
@@ -89290,7 +89290,7 @@ const writeIncrementalReport = fn(SpanTaxonomy_exports.Spans.mutationReportingWr
89290
89290
  runInputsDigest,
89291
89291
  ...report,
89292
89292
  files: stampFileIdentities(stampClosureDigests(report.files, input.closureDigestsByMutantId), identities),
89293
- costs: costsOf(input, input.results),
89293
+ costs: costsOf$1(input, input.results),
89294
89294
  ...dryRunCoverageFieldOf(input.testCoverage)
89295
89295
  }).pipe(orDie);
89296
89296
  yield* writeFileAtomic(deps, input.options.incrementalFile, json);
@@ -89341,7 +89341,7 @@ const slimIncrementalReport = fn(SpanTaxonomy_exports.Spans.mutationReportingSli
89341
89341
  schemaVersion: Report_exports.WrittenSchemaVersion.literal,
89342
89342
  thresholds: input.options.thresholds,
89343
89343
  files: stampFileIdentities(stampClosureDigests(files, input.closureDigestsByMutantId), identities),
89344
- costs: costsOf(input, results),
89344
+ costs: costsOf$1(input, results),
89345
89345
  testFiles,
89346
89346
  budget: budgetOf$1({
89347
89347
  results,
@@ -111926,7 +111926,7 @@ const planProject = (request, channel, labelBase, directory) => gen(function* ()
111926
111926
  onSome: reusedTestCoverage
111927
111927
  });
111928
111928
  const reportCosts = reportCostsOf(texts);
111929
- const mutants = (yield* readIncrementalReuse({
111929
+ const reuse = yield* readIncrementalReuse({
111930
111930
  project: done.project,
111931
111931
  currentMutants: [...done.mutants],
111932
111932
  testCoverage,
@@ -111935,10 +111935,14 @@ const planProject = (request, channel, labelBase, directory) => gen(function* ()
111935
111935
  options: done.options,
111936
111936
  globalTestInputs: map$13(coverage, (present) => [...present.globalTestInputs]).pipe(getOrElse$1(() => [])),
111937
111937
  originalFileOf: (file) => path.resolve(file)
111938
- })).mutants.map((mutant) => ({
111938
+ });
111939
+ const mutants = [...reuse.mutants.map((mutant) => ({
111939
111940
  id: mutant.id,
111940
111941
  costMs: costOf(mutant.id, reportCosts, coverage, testCoverage)
111941
- }));
111942
+ })), ...reuse.rememberedResults.map((mutant) => ({
111943
+ id: mutant.id,
111944
+ costMs: 0
111945
+ }))];
111942
111946
  return {
111943
111947
  label: labelOf$1(path, labelBase, project),
111944
111948
  mutants
@@ -112857,6 +112861,10 @@ const unionFileOf = (reports, name) => {
112857
112861
  };
112858
112862
  const unionFilesOf = (reports) => Object.fromEntries([...new Set(reports.flatMap((report) => Object.keys(filesOf(report))))].sort().map((name) => unionFileOf(reports, name)));
112859
112863
  const unionTestFilesOf = (reports) => Object.fromEntries(reports.flatMap((report) => Object.entries(objectOf(fieldOf(report, "testFiles")) ?? {})));
112864
+ const costsOf = (report) => getOrElse$1(fromUndefinedOr(objectOf(fieldOf(report, "costs"))), () => ({}));
112865
+ const hasActualMs = (entry) => getOrElse$1(map$13(flatMap$9(objectOptionOf(entry), (object) => fromUndefinedOr(fieldOf(object, "actualMs"))), (actualMs) => typeof actualMs === "number" && Number.isFinite(actualMs)), () => false);
112866
+ const preferMeasuredCost = (left, right) => getOrElse$1(orElse$3(orElse$3(filter$7(fromUndefinedOr(left), hasActualMs), () => filter$7(fromUndefinedOr(right), hasActualMs)), () => fromUndefinedOr(left)), () => right);
112867
+ const unionCostsOf = (reports) => Object.fromEntries(reports.flatMap((report) => Object.entries(costsOf(report))).reduce((byMutantId, [mutantId, entry]) => byMutantId.set(mutantId, preferMeasuredCost(byMutantId.get(mutantId), entry)), /* @__PURE__ */ new Map()));
112860
112868
  const decodedReportOf = (text) => decodeOption(fromJsonString(Json))(text).pipe(flatMap$9(objectOptionOf));
112861
112869
  const unionIncrementalReports = (texts) => {
112862
112870
  const reports = texts.flatMap((text) => toArray(decodedReportOf(text)));
@@ -112865,6 +112873,7 @@ const unionIncrementalReports = (texts) => {
112865
112873
  const union = {
112866
112874
  ...first,
112867
112875
  files: unionFilesOf(reports),
112876
+ costs: unionCostsOf(reports),
112868
112877
  testFiles: unionTestFilesOf(reports)
112869
112878
  };
112870
112879
  return getOrUndefined$1(encodeOption(fromJsonString(Json, { space: 2 }))(union));
package/dist/promises.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { C as nodePlatformLayer, t as strykerCell } from "./run-stages-CpYiJ2Mz.mjs";
1
+ import { C as nodePlatformLayer, t as strykerCell } from "./run-stages-DnDU_wrY.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.1";
11349
+ var version = "17.0.2";
11350
11350
  //#endregion
11351
11351
  //#region src/stryker-package.schema.ts
11352
11352
  var StrykerPackage = class extends S.Class("StrykerPackage")({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@systemfsoftware/stryker-js",
3
- "version": "17.0.1",
3
+ "version": "17.0.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/systemfsoftware/stryker-js-effect.git",
@@ -72,12 +72,12 @@
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",
76
- "@systemfsoftware/stryker-ignorer-interface": "^0.1.1",
77
75
  "@systemfsoftware/stryker-js-html-reporter": "^6.0.2",
78
- "@systemfsoftware/stryker-js-plugin-interface": "^14.0.0",
76
+ "@systemfsoftware/stryker-ignorer-interface": "^0.1.1",
77
+ "@systemfsoftware/stryker-js-cli-contract": "^0.3.1",
79
78
  "@systemfsoftware/stryker-js-instrumenter": "^12.1.1",
80
79
  "@systemfsoftware/stryker-js-plugin-runtime": "^7.0.2",
80
+ "@systemfsoftware/stryker-js-plugin-interface": "^14.0.0",
81
81
  "@systemfsoftware/tsdown-config": "^0.1.0",
82
82
  "@systemfsoftware/vitest-config": "^0.1.0"
83
83
  },