@overkill-dev/stryker-runner 0.0.3 → 0.0.4
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/package.json +5 -2
- package/packages/stryker-runner/mutation-policy-process.entry-point.js +19 -0
- package/packages/stryker-runner/mutation-policy-process.entry-point.js.map +1 -0
- package/packages/stryker-runner/mutation-policy-process.js +64 -0
- package/packages/stryker-runner/mutation-policy-process.js.map +1 -0
- package/packages/stryker-runner/mutation-policy-protocol.js +20 -0
- package/packages/stryker-runner/mutation-policy-protocol.js.map +1 -0
- package/packages/stryker-runner/mutation-policy-resolver.js +72 -0
- package/packages/stryker-runner/mutation-policy-resolver.js.map +1 -0
- package/packages/stryker-runner/overkill-test-runner.js +15 -10
- package/packages/stryker-runner/overkill-test-runner.js.map +1 -1
- package/packages/stryker-runner/runner-options.d.ts +1 -0
- package/packages/stryker-runner/runner-options.d.ts.map +1 -1
- package/packages/stryker-runner/runner-options.js +2 -1
- package/packages/stryker-runner/runner-options.js.map +1 -1
- package/readme.md +22 -6
- package/sbom.cdx.json +9 -9
package/package.json
CHANGED
|
@@ -27,17 +27,20 @@
|
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"name": "@overkill-dev/stryker-runner",
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@overkill-dev/run": "0.0.
|
|
30
|
+
"@overkill-dev/run": "0.0.69"
|
|
31
31
|
},
|
|
32
32
|
"repository": {
|
|
33
33
|
"type": "git",
|
|
34
34
|
"url": "git+https://github.com/enormora/overkill.git"
|
|
35
35
|
},
|
|
36
36
|
"sideEffects": [
|
|
37
|
+
"./packages/stryker-runner/mutation-policy-process.entry-point.js",
|
|
38
|
+
"./packages/stryker-runner/mutation-policy-protocol.js",
|
|
39
|
+
"./packages/stryker-runner/mutation-policy-resolver.js",
|
|
37
40
|
"./packages/stryker-runner/overkill-test-runner.js",
|
|
38
41
|
"./packages/stryker-runner/runner-options.js",
|
|
39
42
|
"./packages/stryker-runner/stryker-runner.entry-point.js"
|
|
40
43
|
],
|
|
41
44
|
"type": "module",
|
|
42
|
-
"version": "0.0.
|
|
45
|
+
"version": "0.0.4"
|
|
43
46
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { INSTRUMENTER_CONSTANTS } from '@stryker-mutator/api/core';
|
|
2
|
+
export const mutationPolicyProcessUrl = import.meta.url;
|
|
3
|
+
export const mutationPolicyProcessArgument = '--overkill-mutation-policy-resolver';
|
|
4
|
+
const resolverExcludedVariables = new Set([
|
|
5
|
+
'NODE_OPTIONS',
|
|
6
|
+
'NODE_CONFIG',
|
|
7
|
+
'NODE_CHANNEL_FD',
|
|
8
|
+
'NODE_UNIQUE_ID',
|
|
9
|
+
INSTRUMENTER_CONSTANTS.ACTIVE_MUTANT_ENV_VARIABLE
|
|
10
|
+
]);
|
|
11
|
+
export function readMutationPolicyEnvironment() {
|
|
12
|
+
return Object.fromEntries(Object.entries(process.env).filter(function resolverVariable([name]) {
|
|
13
|
+
return !resolverExcludedVariables.has(name);
|
|
14
|
+
}));
|
|
15
|
+
}
|
|
16
|
+
if (process.argv.includes(mutationPolicyProcessArgument)) {
|
|
17
|
+
await import("./mutation-policy-resolver.js");
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=mutation-policy-process.entry-point.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutation-policy-process.entry-point.js","sourceRoot":"","sources":["../../../../../source/packages/stryker-runner/mutation-policy-process.entry-point.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;AACxD,MAAM,CAAC,MAAM,6BAA6B,GAAG,qCAAqC,CAAC;AAEnF,MAAM,yBAAyB,GAAG,IAAI,GAAG,CAAC;IACtC,cAAc;IACd,aAAa;IACb,iBAAiB;IACjB,gBAAgB;IAChB,sBAAsB,CAAC,0BAA0B;CACpD,CAAC,CAAC;AAEH,MAAM,UAAU,6BAA6B;IACzC,OAAO,MAAM,CAAC,WAAW,CACrB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,SAAS,gBAAgB,CAAC,CAAE,IAAI,CAAE;QACjE,OAAO,CAAC,yBAAyB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC,CAAC,CACL,CAAC;AACN,CAAC;AAED,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,6BAA6B,CAAC,EAAE,CAAC;IACvD,MAAM,MAAM,CAAC,+BAA+B,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { fork } from 'node:child_process';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
import { ConfigError } from "@overkill-dev/run";
|
|
4
|
+
import { RunResolutionError } from "@overkill-dev/run";
|
|
5
|
+
import { mutationPolicyProcessArgument, mutationPolicyProcessUrl, readMutationPolicyEnvironment } from "./mutation-policy-process.entry-point.js";
|
|
6
|
+
import { mutationPolicyResponseSchema } from "./mutation-policy-protocol.js";
|
|
7
|
+
function readPolicyResponse(message) {
|
|
8
|
+
const response = mutationPolicyResponseSchema.parse(message);
|
|
9
|
+
if (response.kind === 'policy') {
|
|
10
|
+
return response.policy;
|
|
11
|
+
}
|
|
12
|
+
if (response.kind === 'config-error') {
|
|
13
|
+
throw new ConfigError(response.message, {
|
|
14
|
+
cause: response.cause === null ? undefined : new Error(response.cause)
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
if (response.kind === 'resolution-error') {
|
|
18
|
+
throw new RunResolutionError(response.message, undefined, response.code);
|
|
19
|
+
}
|
|
20
|
+
throw new Error(response.message);
|
|
21
|
+
}
|
|
22
|
+
export async function initializeMutationPolicy(input) {
|
|
23
|
+
const child = fork(fileURLToPath(mutationPolicyProcessUrl), [mutationPolicyProcessArgument], {
|
|
24
|
+
cwd: input.cwd,
|
|
25
|
+
env: readMutationPolicyEnvironment(),
|
|
26
|
+
execArgv: [],
|
|
27
|
+
killSignal: 'SIGKILL',
|
|
28
|
+
signal: input.signal,
|
|
29
|
+
stdio: ['ignore', 'inherit', 'inherit', 'ipc']
|
|
30
|
+
});
|
|
31
|
+
const closed = new Promise(function observeResolverClose(resolve) {
|
|
32
|
+
child.once('close', function resolverClosed() {
|
|
33
|
+
resolve();
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
try {
|
|
37
|
+
return await new Promise(function receivePolicy(resolve, reject) {
|
|
38
|
+
child.once('error', reject);
|
|
39
|
+
child.once('exit', function resolverExited(code, signal) {
|
|
40
|
+
reject(new Error(`Mutation policy resolver exited without a result (${String(code)}, ${String(signal)}).`));
|
|
41
|
+
});
|
|
42
|
+
child.once('message', function decodePolicy(message) {
|
|
43
|
+
try {
|
|
44
|
+
resolve(readPolicyResponse(message));
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
reject(error instanceof Error
|
|
48
|
+
? error
|
|
49
|
+
: new Error('Invalid mutation policy response.', { cause: error }));
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
child.send({ kind: 'resolve-policy', cwd: input.cwd, settings: input.settings }, function policyRequestSent(error) {
|
|
53
|
+
if (error !== null) {
|
|
54
|
+
reject(error);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
finally {
|
|
60
|
+
child.kill('SIGKILL');
|
|
61
|
+
await closed;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=mutation-policy-process.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutation-policy-process.js","sourceRoot":"","sources":["../../../../../source/packages/stryker-runner/mutation-policy-process.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,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AAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,EACpE,SAAS,iBAAiB,CAAC,KAAK;gBAC5B,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;oBACjB,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;YACL,CAAC,CACJ,CAAC;QACN,CAAC,CAAC,CAAC;IACP,CAAC;YAAS,CAAC;QACP,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACtB,MAAM,MAAM,CAAC;IACjB,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
import { parseFrozenMicrotestPolicy } from "@overkill-dev/run";
|
|
3
|
+
export const mutationPolicyRequestSchema = z.strictObject({
|
|
4
|
+
kind: z.literal('resolve-policy'),
|
|
5
|
+
cwd: z.string(),
|
|
6
|
+
settings: z.unknown()
|
|
7
|
+
});
|
|
8
|
+
export const mutationPolicyResponseSchema = z.discriminatedUnion('kind', [
|
|
9
|
+
z.strictObject({ kind: z.literal('policy'), policy: z.unknown().transform(parseFrozenMicrotestPolicy) }).readonly(),
|
|
10
|
+
z.strictObject({ kind: z.literal('config-error'), message: z.string(), cause: z.string().nullable() }).readonly(),
|
|
11
|
+
z
|
|
12
|
+
.strictObject({
|
|
13
|
+
kind: z.literal('resolution-error'),
|
|
14
|
+
message: z.string(),
|
|
15
|
+
code: z.enum(['invalid-request', 'no-tests-collected', 'unsupported-request'])
|
|
16
|
+
})
|
|
17
|
+
.readonly(),
|
|
18
|
+
z.strictObject({ kind: z.literal('error'), message: z.string() }).readonly()
|
|
19
|
+
]);
|
|
20
|
+
//# sourceMappingURL=mutation-policy-protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutation-policy-protocol.js","sourceRoot":"","sources":["../../../../../source/packages/stryker-runner/mutation-policy-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CA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
|
+
import { ConfigError, loadConfig } from "@overkill-dev/run";
|
|
2
|
+
import { orchestrator, RunResolutionError } from "@overkill-dev/run";
|
|
3
|
+
import { selectMicrotestProfile } from "./microtest-profile.js";
|
|
4
|
+
import { createMutationRunCommand } from "./mutation-execution-policy.js";
|
|
5
|
+
import { mutationPolicyRequestSchema } from "./mutation-policy-protocol.js";
|
|
6
|
+
import { parseRunnerOptions } from "./runner-options.js";
|
|
7
|
+
async function readPolicyRequest() {
|
|
8
|
+
return new Promise(function receivePolicyRequest(resolve, reject) {
|
|
9
|
+
process.once('message', function decodePolicyRequest(message) {
|
|
10
|
+
try {
|
|
11
|
+
resolve(mutationPolicyRequestSchema.parse(message));
|
|
12
|
+
}
|
|
13
|
+
catch (error) {
|
|
14
|
+
reject(error instanceof Error ? error : new Error('Invalid mutation policy request.', { cause: error }));
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
async function createPolicy() {
|
|
20
|
+
const input = await readPolicyRequest();
|
|
21
|
+
const settings = parseRunnerOptions(input.settings);
|
|
22
|
+
const request = { configPath: settings.configPath, cwd: input.cwd };
|
|
23
|
+
const config = await loadConfig(request);
|
|
24
|
+
const selected = selectMicrotestProfile(config, settings.profile);
|
|
25
|
+
const command = createMutationRunCommand({ config, cwd: input.cwd, profile: selected.name });
|
|
26
|
+
const policy = await orchestrator.freezePolicy({
|
|
27
|
+
command: { ...command, request: { ...command.request, paths: settings.paths } },
|
|
28
|
+
source: { kind: 'config-file', request, resolvedPath: config.configPath }
|
|
29
|
+
});
|
|
30
|
+
return { kind: 'policy', policy };
|
|
31
|
+
}
|
|
32
|
+
function failureResponse(error) {
|
|
33
|
+
if (error instanceof ConfigError) {
|
|
34
|
+
return {
|
|
35
|
+
kind: 'config-error',
|
|
36
|
+
message: error.message,
|
|
37
|
+
cause: error.cause instanceof Error ? error.cause.message : null
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
if (error instanceof RunResolutionError) {
|
|
41
|
+
return { kind: 'resolution-error', message: error.message, code: error.code() };
|
|
42
|
+
}
|
|
43
|
+
return { kind: 'error', message: error instanceof Error ? error.message : String(error) };
|
|
44
|
+
}
|
|
45
|
+
async function policyResponse() {
|
|
46
|
+
try {
|
|
47
|
+
return await createPolicy();
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
return failureResponse(error);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
async function resolveMutationPolicy() {
|
|
54
|
+
const response = await policyResponse();
|
|
55
|
+
await new Promise(function deliverPolicy(resolve, reject) {
|
|
56
|
+
if (process.send === undefined) {
|
|
57
|
+
reject(new Error('Mutation policy resolver requires IPC.'));
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
process.send(response, function policyDelivered(error) {
|
|
61
|
+
if (error === null) {
|
|
62
|
+
resolve();
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
reject(error);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
process.disconnect?.();
|
|
70
|
+
}
|
|
71
|
+
await resolveMutationPolicy();
|
|
72
|
+
//# sourceMappingURL=mutation-policy-resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutation-policy-resolver.js","sourceRoot":"","sources":["../../../../../source/packages/stryker-runner/mutation-policy-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,mBAA8B,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAA2B,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,2BAA2B,EAA+B,MAAM,+BAA+B,CAAC;AACzG,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,KAA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AM,CAAC,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC,CAAC;YAC5D,OAAO;QACX,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,eAAe,CAAC,KAAK;YACjD,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;gBACjB,OAAO,EAAE,CAAC;YACd,CAAC;iBAAM,CAAC;gBACJ,MAAM,CAAC,KAAK,CAAC,CAAC;YAClB,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;AAC3B,CAAC;AAED,MAAM,qBAAqB,EAAE,CAAC"}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { commonTokens, tokens } from '@stryker-mutator/api/plugin';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { createMutationRunCommand } from "./mutation-execution-policy.js";
|
|
2
|
+
import { ConfigError } from "@overkill-dev/run";
|
|
3
|
+
import { initializeMutationPolicy } from "./mutation-policy-process.js";
|
|
5
4
|
import { parseRunnerOptions } from "./runner-options.js";
|
|
6
5
|
export function createOverkillTestRunner(options) {
|
|
7
6
|
let initialization = null;
|
|
8
|
-
|
|
7
|
+
const controller = new AbortController();
|
|
8
|
+
async function initializePolicy() {
|
|
9
9
|
const settings = parseRunnerOptions(options.overkill);
|
|
10
|
-
|
|
11
|
-
const config = await loadConfig({ configPath: settings.configPath, cwd });
|
|
12
|
-
const selected = selectMicrotestProfile(config, settings.profile);
|
|
13
|
-
return createMutationRunCommand({ config, cwd, profile: selected.name });
|
|
10
|
+
return await initializeMutationPolicy({ cwd: process.cwd(), settings, signal: controller.signal });
|
|
14
11
|
}
|
|
15
12
|
return {
|
|
16
13
|
capabilities() {
|
|
17
14
|
throw new Error('@overkill-dev/stryker-runner: capabilities() is not implemented.');
|
|
18
15
|
},
|
|
19
16
|
async init() {
|
|
20
|
-
|
|
17
|
+
if (controller.signal.aborted) {
|
|
18
|
+
throw new ConfigError('Stryker runner has been disposed.');
|
|
19
|
+
}
|
|
20
|
+
initialization = initialization ?? initializePolicy();
|
|
21
21
|
await initialization;
|
|
22
22
|
},
|
|
23
23
|
async dryRun() {
|
|
@@ -27,7 +27,12 @@ export function createOverkillTestRunner(options) {
|
|
|
27
27
|
throw new Error('@overkill-dev/stryker-runner: mutantRun() is not implemented.');
|
|
28
28
|
},
|
|
29
29
|
async dispose() {
|
|
30
|
-
|
|
30
|
+
controller.abort();
|
|
31
|
+
try {
|
|
32
|
+
await initialization;
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
}
|
|
31
36
|
}
|
|
32
37
|
};
|
|
33
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overkill-test-runner.js","sourceRoot":"","sources":["../../../../../source/packages/stryker-runner/overkill-test-runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAOnE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"overkill-test-runner.js","sourceRoot":"","sources":["../../../../../source/packages/stryker-runner/overkill-test-runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAOnE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAA8B,CAAC;AAE3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,UAAU,wBAAwB,CAAC,OAA0C;IAC/E,IAAI,cAAc,GAA0C,IAAI,CAAC;IACjE,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;IAEzC,KAAK,UAAU,gBAAgB;QAC3B,MAAM,QAAQ,GAAG,kBAAkB,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACtD,OAAO,MAAM,wBAAwB,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC;IACvG,CAAC;IAED,OAAO;QACH,YAAY;YACR,MAAM,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAC;QACxF,CAAC;QACD,KAAK,CAAC,IAAI;YACN,IAAI,UAAU,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;gBAC5B,MAAM,IAAI,WAAW,CAAC,mCAAmC,CAAC,CAAC;YAC/D,CAAC;YACD,cAAc,GAAG,cAAc,IAAI,gBAAgB,EAAE,CAAC;YACtD,MAAM,cAAc,CAAC;QACzB,CAAC;QACD,KAAK,CAAC,MAAM;YACR,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;QAClF,CAAC;QACD,KAAK,CAAC,SAAS;YACX,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;QACrF,CAAC;QACD,KAAK,CAAC,OAAO;YACT,UAAU,CAAC,KAAK,EAAE,CAAC;YACnB,IAAI,CAAC;gBACD,MAAM,cAAc,CAAC;YACzB,CAAC;YAAC,MAAM,CAAC;YACT,CAAC;QACL,CAAC;KACJ,CAAC;AACN,CAAC;AAED,wBAAwB,CAAC,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -4,6 +4,7 @@ export declare const strykerValidationSchema: {
|
|
|
4
4
|
properties: {
|
|
5
5
|
overkill: z.core.ZodStandardJSONSchemaPayload<z.ZodDefault<z.ZodReadonly<z.ZodObject<{
|
|
6
6
|
configPath: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
7
|
+
paths: z.ZodDefault<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
7
8
|
profile: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
8
9
|
}, z.core.$strict>>>>;
|
|
9
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner-options.d.ts","sourceRoot":"","sources":["../../../../../source/packages/stryker-runner/runner-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"runner-options.d.ts","sourceRoot":"","sources":["../../../../../source/packages/stryker-runner/runner-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;MAarB,SAEC,MAAM,uBAAuB;;;;;;;;;CAKnC,CAAC;AAEF"}
|
|
@@ -4,10 +4,11 @@ import { ConfigError } from "@overkill-dev/run";
|
|
|
4
4
|
const runnerOptionsSchema = z
|
|
5
5
|
.strictObject({
|
|
6
6
|
configPath: z.string().regex(/\S/u, 'must not be blank').nullable().default(null),
|
|
7
|
+
paths: z.array(z.string().regex(/\S/u, 'must not be blank')).readonly().default([]),
|
|
7
8
|
profile: z.string().nullable().default(null)
|
|
8
9
|
})
|
|
9
10
|
.readonly()
|
|
10
|
-
.default({ configPath: null, profile: null });
|
|
11
|
+
.default({ configPath: null, paths: [], profile: null });
|
|
11
12
|
export const strykerValidationSchema = {
|
|
12
13
|
type: 'object',
|
|
13
14
|
properties: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner-options.js","sourceRoot":"","sources":["../../../../../source/packages/stryker-runner/runner-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAA8B,CAAC;AAE3D,MAAM,mBAAmB,GAAG,CAAC;KACxB,YAAY,CAAC;IACV,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,mBAAmB,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IACjF,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CA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,CAAC,KAAc;IAC7C,IAAI,CAAC;QACD,OAAO,KAAK,CAAC,mBAAmB,EAAE,KAAK,CAAC,CAAC;IAC7C,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACtB,MAAM,IAAI,WAAW,CAAC,sCAAsC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IACnG,CAAC;AACL,CAAC"}
|
package/readme.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# `@overkill-dev/stryker-runner`
|
|
2
2
|
|
|
3
3
|
Optional first-party Stryker `TestRunner` plugin for Node microtest profiles.
|
|
4
|
-
Profile initialization
|
|
4
|
+
Profile initialization freezes the mutation execution policy. Dry runs, mutant
|
|
5
5
|
execution, and capability reporting are not implemented yet.
|
|
6
6
|
|
|
7
7
|
```js
|
|
@@ -10,7 +10,8 @@ export default {
|
|
|
10
10
|
plugins: [ '@overkill-dev/stryker-runner' ],
|
|
11
11
|
overkill: {
|
|
12
12
|
configPath: 'overkill.config.ts',
|
|
13
|
-
profile: 'unit-fast'
|
|
13
|
+
profile: 'unit-fast',
|
|
14
|
+
paths: []
|
|
14
15
|
}
|
|
15
16
|
};
|
|
16
17
|
```
|
|
@@ -21,19 +22,34 @@ microtest profile in the normalized registry. The built-in `microtest` fallback
|
|
|
21
22
|
counts: adding a custom microtest profile normally requires an explicit name.
|
|
22
23
|
An explicitly configured `microtest` profile replaces that fallback.
|
|
23
24
|
|
|
25
|
+
`paths` supplies explicit files or directory filters using ordinary runner
|
|
26
|
+
discovery rules. It defaults to `[]`. Initialization requires discovered files;
|
|
27
|
+
without a config discovery policy, provide explicit files through `paths`.
|
|
28
|
+
|
|
24
29
|
Unknown names, non-microtest profiles, absent eligible profiles, ambiguous
|
|
25
30
|
inference, and malformed settings fail before discovery or test imports.
|
|
26
31
|
Browser-oriented integration profiles and multi-profile selections are rejected.
|
|
27
32
|
Other profile families may coexist in the project registry. Profile names do not
|
|
28
33
|
determine eligibility. Incompatible test nodes are checked during collection.
|
|
29
34
|
|
|
30
|
-
Initialization
|
|
35
|
+
Initialization freezes a public runner policy with explicit serial scheduling,
|
|
31
36
|
ordinary V8 coverage disabled, and baseline updates disabled. Microtest profiles
|
|
32
37
|
have no Overkill retry policy. Discovery, loaders, capability restrictions,
|
|
33
38
|
resource policies, timeouts, and the configured process model are preserved.
|
|
34
39
|
The original profile remains unchanged; the command records the override as
|
|
35
40
|
`request.execution: { mode: 'serial' }`.
|
|
36
41
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
42
|
+
Each plugin worker resolves policy once in a fresh, unmutated process. That
|
|
43
|
+
process imports user configuration and its dependencies, discovers files, and
|
|
44
|
+
returns immutable policy data. It imports no tests or custom engines and is
|
|
45
|
+
terminated and reaped after success, failure, or disposal. User configuration
|
|
46
|
+
does not enter the plugin worker's execution graph during initialization.
|
|
47
|
+
Repeated initialization shares one result, including failures. Replacement
|
|
48
|
+
workers resolve independently; this is not shared campaign coordination.
|
|
49
|
+
|
|
50
|
+
Execution hosts revalidate file-backed configuration before collecting tests.
|
|
51
|
+
Changes to authoritative discovery, loader declarations, selection, permissions,
|
|
52
|
+
execution, or resources fail even when test identities would remain unchanged.
|
|
53
|
+
Reporters, valid unrelated profiles, disabled coverage settings, and overridden
|
|
54
|
+
scheduling do not affect the comparison. Invocation execution is not implemented
|
|
55
|
+
in this adapter yet.
|
package/sbom.cdx.json
CHANGED
|
@@ -16,24 +16,24 @@
|
|
|
16
16
|
"component": {
|
|
17
17
|
"type": "library",
|
|
18
18
|
"name": "@overkill-dev/stryker-runner",
|
|
19
|
-
"version": "0.0.
|
|
20
|
-
"bom-ref": "pkg:npm/@overkill-dev/stryker-runner@0.0.
|
|
21
|
-
"purl": "pkg:npm/@overkill-dev/stryker-runner@0.0.
|
|
19
|
+
"version": "0.0.4",
|
|
20
|
+
"bom-ref": "pkg:npm/@overkill-dev/stryker-runner@0.0.4",
|
|
21
|
+
"purl": "pkg:npm/@overkill-dev/stryker-runner@0.0.4"
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"components": [
|
|
25
25
|
{
|
|
26
26
|
"type": "library",
|
|
27
27
|
"name": "@overkill-dev/run",
|
|
28
|
-
"version": "0.0.
|
|
29
|
-
"bom-ref": "pkg:npm/@overkill-dev/run@0.0.
|
|
28
|
+
"version": "0.0.69",
|
|
29
|
+
"bom-ref": "pkg:npm/@overkill-dev/run@0.0.69",
|
|
30
30
|
"scope": "optional",
|
|
31
31
|
"licenses": [
|
|
32
32
|
{
|
|
33
33
|
"expression": "MIT"
|
|
34
34
|
}
|
|
35
35
|
],
|
|
36
|
-
"purl": "pkg:npm/@overkill-dev/run@0.0.
|
|
36
|
+
"purl": "pkg:npm/@overkill-dev/run@0.0.69"
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
"type": "library",
|
|
@@ -77,12 +77,12 @@
|
|
|
77
77
|
],
|
|
78
78
|
"dependencies": [
|
|
79
79
|
{
|
|
80
|
-
"ref": "pkg:npm/@overkill-dev/run@0.0.
|
|
80
|
+
"ref": "pkg:npm/@overkill-dev/run@0.0.69"
|
|
81
81
|
},
|
|
82
82
|
{
|
|
83
|
-
"ref": "pkg:npm/@overkill-dev/stryker-runner@0.0.
|
|
83
|
+
"ref": "pkg:npm/@overkill-dev/stryker-runner@0.0.4",
|
|
84
84
|
"dependsOn": [
|
|
85
|
-
"pkg:npm/@overkill-dev/run@0.0.
|
|
85
|
+
"pkg:npm/@overkill-dev/run@0.0.69",
|
|
86
86
|
"pkg:npm/@schema-hub/zod-error-formatter@0.0.19",
|
|
87
87
|
"pkg:npm/@stryker-mutator/api@10.0.0",
|
|
88
88
|
"pkg:npm/zod@4.6.5"
|