@overkill-dev/run 0.0.59 → 0.0.61
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/engine/coverage-artifact.d.ts +36 -0
- package/engine/coverage-artifact.d.ts.map +1 -0
- package/engine/execution-options.d.ts +4 -1
- package/engine/execution-options.d.ts.map +1 -1
- package/engine/execution-options.js.map +1 -1
- package/engine/execution-supervision-state.d.ts +30 -0
- package/engine/execution-supervision-state.d.ts.map +1 -0
- package/engine/execution-supervision-state.js +25 -0
- package/engine/execution-supervision-state.js.map +1 -0
- package/engine/execution-supervision.d.ts +5 -25
- package/engine/execution-supervision.d.ts.map +1 -1
- package/engine/execution-supervision.js +9 -19
- package/engine/execution-supervision.js.map +1 -1
- package/engine/execution-test-plan-cases.js +108 -71
- package/engine/execution-test-plan-cases.js.map +1 -1
- package/engine/identity.d.ts +2 -0
- package/engine/identity.d.ts.map +1 -1
- package/engine/identity.js +2 -1
- package/engine/identity.js.map +1 -1
- package/engine/reporter-event-queue.js +1 -1
- package/engine/reporter-event-queue.js.map +1 -1
- package/engine/run-result.d.ts +12 -5
- package/engine/run-result.d.ts.map +1 -1
- package/engine/run-result.js.map +1 -1
- package/engine/run-timings.d.ts +1 -1
- package/engine/run-timings.d.ts.map +1 -1
- package/engine/run-timings.js +3 -0
- package/engine/run-timings.js.map +1 -1
- package/engine/test-body-resource-attachment.d.ts +1 -0
- package/engine/test-body-resource-attachment.d.ts.map +1 -1
- package/engine/test-body-resource-attachment.js +1 -0
- package/engine/test-body-resource-attachment.js.map +1 -1
- package/engine/test-plan.d.ts +1 -1
- package/engine/test-plan.d.ts.map +1 -1
- package/package.json +11 -3
- package/packages/engine/engine.entry-point.d.ts +2 -1
- package/packages/engine/engine.entry-point.d.ts.map +1 -1
- package/packages/engine/engine.entry-point.js.map +1 -1
- package/packages/run/filters.entry-point.d.ts +2 -2
- package/packages/run/filters.entry-point.d.ts.map +1 -1
- package/packages/run/filters.entry-point.js +1 -1
- package/packages/run/filters.entry-point.js.map +1 -1
- package/packages/run/run.entry-point.d.ts +7 -4
- package/packages/run/run.entry-point.d.ts.map +1 -1
- package/packages/run/run.entry-point.js +3 -9
- package/packages/run/run.entry-point.js.map +1 -1
- package/readme.md +35 -6
- package/reporters/human-reporter-rendering.js +16 -1
- package/reporters/human-reporter-rendering.js.map +1 -1
- package/reporters/line-reporter.js +9 -0
- package/reporters/line-reporter.js.map +1 -1
- package/resources/resource-graph.d.ts +1 -0
- package/resources/resource-graph.d.ts.map +1 -1
- package/resources/resource-graph.js +2 -2
- package/resources/resource-graph.js.map +1 -1
- package/resources/resources.d.ts +1 -0
- package/resources/resources.d.ts.map +1 -1
- package/resources/resources.js.map +1 -1
- package/resources/runtime-definition.d.ts +2 -0
- package/resources/runtime-definition.d.ts.map +1 -1
- package/resources/runtime-definition.js +1 -0
- package/resources/runtime-definition.js.map +1 -1
- package/run/collected-run-plan.js +13 -0
- package/run/collected-run-plan.js.map +1 -1
- package/run/command-line-runner.d.ts.map +1 -1
- package/run/command-line-runner.js +2 -0
- package/run/command-line-runner.js.map +1 -1
- package/run/coverage-reporting.js +142 -0
- package/run/coverage-reporting.js.map +1 -0
- package/run/coverage-session.js +8 -0
- package/run/coverage-session.js.map +1 -0
- package/run/current-process-run-orchestrator.d.ts +2 -1
- package/run/current-process-run-orchestrator.d.ts.map +1 -1
- package/run/current-process-run-orchestrator.js +30 -1
- package/run/current-process-run-orchestrator.js.map +1 -1
- package/run/direct-entrypoint-collection.js +27 -0
- package/run/direct-entrypoint-collection.js.map +1 -0
- package/run/duration-history-schema.d.ts +251 -0
- package/run/duration-history-schema.d.ts.map +1 -0
- package/run/duration-history-schema.js +121 -0
- package/run/duration-history-schema.js.map +1 -0
- package/run/duration-history.d.ts +2 -2
- package/run/duration-history.d.ts.map +1 -1
- package/run/duration-history.js +3 -82
- package/run/duration-history.js.map +1 -1
- package/run/execution-plan-resolution.js +356 -0
- package/run/execution-plan-resolution.js.map +1 -0
- package/run/path-containment.js +2 -0
- package/run/path-containment.js.map +1 -0
- package/run/permission-denial-runtime-policy.js +12 -2
- package/run/permission-denial-runtime-policy.js.map +1 -1
- package/run/profile-file-glob.js +18 -0
- package/run/profile-file-glob.js.map +1 -1
- package/run/resource-lifecycle-boundaries.js +28 -9
- package/run/resource-lifecycle-boundaries.js.map +1 -1
- package/run/resource-lifecycle-cache-identity.js +4 -0
- package/run/resource-lifecycle-cache-identity.js.map +1 -1
- package/run/resource-lifecycle-composition.d.ts +1 -1
- package/run/resource-lifecycle-composition.d.ts.map +1 -1
- package/run/resource-lifecycle-composition.js +4 -4
- package/run/resource-lifecycle-composition.js.map +1 -1
- package/run/resource-lifecycle-state.d.ts +9 -1
- package/run/resource-lifecycle-state.d.ts.map +1 -1
- package/run/resource-lifecycle-state.js.map +1 -1
- package/run/resource-lifecycle.js +37 -5
- package/run/resource-lifecycle.js.map +1 -1
- package/run/resource-ownership-plan.d.ts +30 -0
- package/run/resource-ownership-plan.d.ts.map +1 -0
- package/run/run-collected-planning.js +9 -1
- package/run/run-collected-planning.js.map +1 -1
- package/run/run-collection-source-types.d.ts +12 -0
- package/run/run-collection-source-types.d.ts.map +1 -0
- package/run/run-collection-source.d.ts +9 -0
- package/run/run-collection-source.d.ts.map +1 -0
- package/run/run-collection-source.js +9 -0
- package/run/run-collection-source.js.map +1 -0
- package/run/run-config-defaults.js +13 -4
- package/run/run-config-defaults.js.map +1 -1
- package/run/run-config-schema.d.ts +12 -0
- package/run/run-config-schema.d.ts.map +1 -1
- package/run/run-config-schema.js +5 -0
- package/run/run-config-schema.js.map +1 -1
- package/run/run-config.d.ts +1 -1
- package/run/run-config.d.ts.map +1 -1
- package/run/run-config.js +4 -9
- package/run/run-config.js.map +1 -1
- package/run/run-coverage.js +36 -0
- package/run/run-coverage.js.map +1 -0
- package/run/run-discovery.js +1 -2
- package/run/run-discovery.js.map +1 -1
- package/run/run-empty-shard.js +3 -4
- package/run/run-empty-shard.js.map +1 -1
- package/run/run-engine-selection.d.ts +1 -1
- package/run/run-engine-selection.d.ts.map +1 -1
- package/run/run-errors.d.ts +54 -0
- package/run/run-errors.d.ts.map +1 -1
- package/run/run-errors.js +61 -0
- package/run/run-errors.js.map +1 -1
- package/run/run-execution-config.d.ts +28 -0
- package/run/run-execution-config.d.ts.map +1 -0
- package/run/run-facts.js +2 -0
- package/run/run-facts.js.map +1 -1
- package/run/run-filter-grammar.d.ts +1 -1
- package/run/run-filter-grammar.d.ts.map +1 -1
- package/run/run-if-main-options.d.ts +0 -5
- package/run/run-if-main-options.d.ts.map +1 -1
- package/run/run-if-main-options.js +0 -16
- package/run/run-if-main-options.js.map +1 -1
- package/run/run-if-main-profile.d.ts.map +1 -1
- package/run/run-if-main-profile.js +0 -10
- package/run/run-if-main-profile.js.map +1 -1
- package/run/run-if-main.d.ts +2 -10
- package/run/run-if-main.d.ts.map +1 -1
- package/run/run-if-main.js +56 -62
- package/run/run-if-main.js.map +1 -1
- package/run/run-in-process-execution.js +3 -3
- package/run/run-in-process-execution.js.map +1 -1
- package/run/run-input-resolution.js +11 -2
- package/run/run-input-resolution.js.map +1 -1
- package/run/run-isolated-command.js +46 -20
- package/run/run-isolated-command.js.map +1 -1
- package/run/run-isolated-process.js +68 -101
- package/run/run-isolated-process.js.map +1 -1
- package/run/run-local-command.js +131 -0
- package/run/run-local-command.js.map +1 -0
- package/run/run-local-execution.js +7 -10
- package/run/run-local-execution.js.map +1 -1
- package/run/run-local-resolution.js +10 -5
- package/run/run-local-resolution.js.map +1 -1
- package/run/run-local-test-plan.js +6 -1
- package/run/run-local-test-plan.js.map +1 -1
- package/run/run-orchestrator.d.ts +6 -0
- package/run/run-orchestrator.d.ts.map +1 -1
- package/run/run-orchestrator.entry-point.d.ts +1 -2
- package/run/run-orchestrator.entry-point.d.ts.map +1 -1
- package/run/run-orchestrator.entry-point.js +4 -4
- package/run/run-orchestrator.entry-point.js.map +1 -1
- package/run/run-orchestrator.js +11 -4
- package/run/run-orchestrator.js.map +1 -1
- package/run/run-ordering.js +36 -0
- package/run/run-ordering.js.map +1 -0
- package/run/run-request-types.d.ts +89 -0
- package/run/run-request-types.d.ts.map +1 -0
- package/run/run-selection-filters.d.ts +7 -2
- package/run/run-selection-filters.d.ts.map +1 -1
- package/run/run-selection-filters.js +114 -15
- package/run/run-selection-filters.js.map +1 -1
- package/run/run-selection.js +10 -50
- package/run/run-selection.js.map +1 -1
- package/run/run-supervised-process.js +108 -0
- package/run/run-supervised-process.js.map +1 -0
- package/run/run-support.js +9 -0
- package/run/run-support.js.map +1 -1
- package/run/run-test-plan.js +13 -5
- package/run/run-test-plan.js.map +1 -1
- package/run/run-types.d.ts +12 -95
- package/run/run-types.d.ts.map +1 -1
- package/run/run-types.js +0 -19
- package/run/run-types.js.map +1 -1
- package/run/run-validation.js +1 -1
- package/run/run-validation.js.map +1 -1
- package/run/run.d.ts +10 -0
- package/run/run.d.ts.map +1 -0
- package/run/run.js +27 -54
- package/run/run.js.map +1 -1
- package/run/runtime-matrix-expansion.js +7 -0
- package/run/runtime-matrix-expansion.js.map +1 -1
- package/run/supervised-child-process.d.ts +24 -2
- package/run/supervised-child-process.d.ts.map +1 -1
- package/run/supervised-child-process.js +40 -1
- package/run/supervised-child-process.js.map +1 -1
- package/run/supervised-child-test-plan.js +1 -0
- package/run/supervised-child-test-plan.js.map +1 -1
- package/run/supervised-child.js +2 -5
- package/run/supervised-child.js.map +1 -1
- package/run/supervised-protocol.js +2 -7
- package/run/supervised-protocol.js.map +1 -1
- package/run/supervised-run-collection.js +2 -0
- package/run/supervised-run-collection.js.map +1 -1
- package/run/supervised-run-runtime.js +4 -105
- package/run/supervised-run-runtime.js.map +1 -1
- package/run/supervised-run-state.d.ts +4 -0
- package/run/supervised-run-state.d.ts.map +1 -1
- package/run/supervised-run-state.js +22 -0
- package/run/supervised-run-state.js.map +1 -1
- package/run/supervised-run.js +11 -79
- package/run/supervised-run.js.map +1 -1
- package/run/work-distribution-config.js +1 -1
- package/run/work-distribution-config.js.map +1 -1
- package/run/work-unit-planning.js +17 -4
- package/run/work-unit-planning.js.map +1 -1
- package/run/worker-pool-command.js +3 -0
- package/run/worker-pool-command.js.map +1 -1
- package/run/worker-pool-execution.js +15 -19
- package/run/worker-pool-execution.js.map +1 -1
- package/run/worker-pool-hedged-arbitration.js +25 -7
- package/run/worker-pool-hedged-arbitration.js.map +1 -1
- package/run/worker-pool-host-protocol.js.map +1 -1
- package/run/worker-pool-host-task.js +9 -0
- package/run/worker-pool-host-task.js.map +1 -1
- package/run/worker-pool-host.entry-point.js +13 -13
- package/run/worker-pool-host.entry-point.js.map +1 -1
- package/run/worker-pool-lanes.js +16 -9
- package/run/worker-pool-lanes.js.map +1 -1
- package/run/worker-pool-placement-planning.js +24 -3
- package/run/worker-pool-placement-planning.js.map +1 -1
- package/run/worker-pool-protocol.js +19 -0
- package/run/worker-pool-protocol.js.map +1 -1
- package/run/worker-pool-resource-lifecycle-execution.js +143 -12
- package/run/worker-pool-resource-lifecycle-execution.js.map +1 -1
- package/run/worker-pool-routing.js +13 -1
- package/run/worker-pool-routing.js.map +1 -1
- package/run/worker-pool-runtime.js +12 -16
- package/run/worker-pool-runtime.js.map +1 -1
- package/run/worker-pool-task-events.js +13 -6
- package/run/worker-pool-task-events.js.map +1 -1
- package/run/worker-pool-task-validation.js +1 -0
- package/run/worker-pool-task-validation.js.map +1 -1
- package/run/worker-pool-worker-plan.js +1 -0
- package/run/worker-pool-worker-plan.js.map +1 -1
- package/run/worker-pool-worker-resources.js +9 -2
- package/run/worker-pool-worker-resources.js.map +1 -1
- package/run/worker-pool-worker.js +11 -6
- package/run/worker-pool-worker.js.map +1 -1
- package/sbom.cdx.json +72 -4
- package/run/default-run-engine.d.ts +0 -3
- package/run/default-run-engine.d.ts.map +0 -1
- package/run/direct-runtime-policy.js +0 -24
- package/run/direct-runtime-policy.js.map +0 -1
- package/run/resource-usage.d.ts +0 -17
- package/run/resource-usage.d.ts.map +0 -1
- package/run/run-if-main-facts.js +0 -95
- package/run/run-if-main-facts.js.map +0 -1
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { glob, readFile } from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { CoverageReport } from 'monocart-coverage-reports';
|
|
5
|
+
import { transform } from 'sucrase';
|
|
6
|
+
import { isPathInside } from "./path-containment.js";
|
|
7
|
+
const supportedSourceExtensions = new Set(['.cjs', '.cts', '.js', '.mjs', '.mts', '.ts']);
|
|
8
|
+
const typeScriptSourceExtensions = new Set(['.cts', '.mts', '.ts']);
|
|
9
|
+
function entryFilePath(url) {
|
|
10
|
+
if (!url.startsWith('file:')) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
return path.resolve(fileURLToPath(url));
|
|
14
|
+
}
|
|
15
|
+
function sourceFilePath(sourcePath, projectRoot) {
|
|
16
|
+
return path.resolve(projectRoot, sourcePath);
|
|
17
|
+
}
|
|
18
|
+
function includedProjectFile(filePath, projectRoot, excludedFiles) {
|
|
19
|
+
const resolvedPath = path.resolve(filePath);
|
|
20
|
+
return isPathInside(projectRoot, resolvedPath) &&
|
|
21
|
+
!resolvedPath.split(path.sep).includes('node_modules') &&
|
|
22
|
+
!excludedFiles.has(resolvedPath);
|
|
23
|
+
}
|
|
24
|
+
function matchesSourcePatterns(filePath, projectRoot, include, exclude) {
|
|
25
|
+
const relativePath = path.relative(projectRoot, filePath).split(path.sep).join('/');
|
|
26
|
+
return include.some(function matchesInclude(pattern) {
|
|
27
|
+
return path.matchesGlob(relativePath, pattern);
|
|
28
|
+
}) && exclude.every(function matchesExclude(pattern) {
|
|
29
|
+
return !path.matchesGlob(relativePath, pattern);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function includedSourceFile(filePath, request) {
|
|
33
|
+
if (!includedProjectFile(filePath, request.projectRoot, request.sourceScope.excludedFiles)) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
return request.sourceScope.kind === 'loaded' || matchesSourcePatterns(filePath, request.projectRoot, request.sourceScope.include, request.sourceScope.exclude);
|
|
37
|
+
}
|
|
38
|
+
function entryIncluded(entry, request) {
|
|
39
|
+
const filePath = entryFilePath(entry.url);
|
|
40
|
+
return filePath !== null && includedSourceFile(filePath, request);
|
|
41
|
+
}
|
|
42
|
+
function sourceIncluded(sourcePath, request) {
|
|
43
|
+
return includedSourceFile(sourceFilePath(sourcePath, request.projectRoot), request);
|
|
44
|
+
}
|
|
45
|
+
function transformedTypeScript(source, filePath) {
|
|
46
|
+
const result = transform(source, {
|
|
47
|
+
filePath,
|
|
48
|
+
sourceMapOptions: {
|
|
49
|
+
compiledFilename: filePath.replace(/\.[cm]?ts$/u, '.js')
|
|
50
|
+
},
|
|
51
|
+
transforms: ['typescript']
|
|
52
|
+
});
|
|
53
|
+
return {
|
|
54
|
+
source: result.code,
|
|
55
|
+
sourceMap: { ...result.sourceMap, sourcesContent: [source] }
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function hasRuntimeTypeScript(source) {
|
|
59
|
+
return source
|
|
60
|
+
.replace(/^export \{\};?\s*$/mu, '')
|
|
61
|
+
.replace(/^\/\/# sourceMappingURL=.*$/mu, '')
|
|
62
|
+
.trim() !== '';
|
|
63
|
+
}
|
|
64
|
+
async function isRuntimeSourceFile(filePath, request) {
|
|
65
|
+
const extension = path.extname(filePath);
|
|
66
|
+
if (!supportedSourceExtensions.has(extension) || !includedSourceFile(filePath, request)) {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
if (!typeScriptSourceExtensions.has(extension)) {
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
const transformed = transformedTypeScript(await readFile(filePath, 'utf8'), filePath);
|
|
73
|
+
return hasRuntimeTypeScript(transformed.source);
|
|
74
|
+
}
|
|
75
|
+
async function allRuntimeFiles(request, sourceScope) {
|
|
76
|
+
const runtimeFiles = new Set();
|
|
77
|
+
const matchedFiles = glob(sourceScope.include, {
|
|
78
|
+
cwd: request.projectRoot,
|
|
79
|
+
exclude: sourceScope.exclude
|
|
80
|
+
});
|
|
81
|
+
for await (const relativePath of matchedFiles) {
|
|
82
|
+
const filePath = path.resolve(request.projectRoot, relativePath);
|
|
83
|
+
if (await isRuntimeSourceFile(filePath, request)) {
|
|
84
|
+
runtimeFiles.add(filePath);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return runtimeFiles;
|
|
88
|
+
}
|
|
89
|
+
async function allFilesOptions(request) {
|
|
90
|
+
const { sourceScope } = request;
|
|
91
|
+
if (sourceScope.kind === 'loaded') {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
const runtimeFiles = await allRuntimeFiles(request, sourceScope);
|
|
95
|
+
return {
|
|
96
|
+
dir: request.projectRoot,
|
|
97
|
+
filter(filePath) {
|
|
98
|
+
const resolvedPath = path.resolve(filePath);
|
|
99
|
+
return runtimeFiles.has(resolvedPath);
|
|
100
|
+
},
|
|
101
|
+
async transformer(entry) {
|
|
102
|
+
if (typeScriptSourceExtensions.has(path.extname(entry.url))) {
|
|
103
|
+
Object.assign(entry, transformedTypeScript(entry.source, entry.url));
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
function metric(results, name) {
|
|
109
|
+
const value = results.summary[name];
|
|
110
|
+
return { covered: value.covered, total: value.total };
|
|
111
|
+
}
|
|
112
|
+
export async function generateCoverageReports(request) {
|
|
113
|
+
const all = await allFilesOptions(request);
|
|
114
|
+
const report = new CoverageReport({
|
|
115
|
+
...all === null ? {} : { all },
|
|
116
|
+
baseDir: request.projectRoot,
|
|
117
|
+
clean: false,
|
|
118
|
+
entryFilter(entry) {
|
|
119
|
+
return entryIncluded(entry, request);
|
|
120
|
+
},
|
|
121
|
+
logging: 'off',
|
|
122
|
+
outputDir: request.coverageDirectory,
|
|
123
|
+
reports: [
|
|
124
|
+
['v8', { inline: true, outputFile: 'v8/index.html' }],
|
|
125
|
+
['lcovonly', { file: 'lcov.info', projectRoot: request.projectRoot }]
|
|
126
|
+
],
|
|
127
|
+
sourceFilter(sourcePath) {
|
|
128
|
+
return sourceIncluded(sourcePath, request);
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
await report.addFromDir(request.rawDataDirectory);
|
|
132
|
+
const results = await report.generate();
|
|
133
|
+
if (results === undefined) {
|
|
134
|
+
throw new Error('Coverage backend produced no result.');
|
|
135
|
+
}
|
|
136
|
+
return {
|
|
137
|
+
branches: metric(results, 'branches'),
|
|
138
|
+
functions: metric(results, 'functions'),
|
|
139
|
+
lines: metric(results, 'lines')
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=coverage-reporting.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coverage-reporting.js","sourceRoot":"","sources":["../../../../source/run/coverage-reporting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EACH,cAAc,EAGjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAMpC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AA8BrD,MAAM,yBAAyB,GAAG,IAAI,GAAG,CAAC,CAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAE,CAAC,CAAC;AAC5F,MAAM,0BAA0B,GAAG,IAAI,GAAG,CAAC,CAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAE,CAAC,CAAC;AAEtE,SAAS,aAAa,CAAC,GAAW;IAC9B,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3B,OAAO,I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AK;YACb,OAAO,aAAa,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACzC,CAAC;QACD,OAAO,EAAE,KAAK;QACd,SAAS,EAAE,OAAO,CAAC,iBAAiB;QACpC,OAAO,EAAE;YACL,CAAE,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,eAAe,EAAE,CAAE;YACvD,CAAE,UAAU,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,CAAE;SAC1E;QACD,YAAY,CAAC,UAAU;YACnB,OAAO,cAAc,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QAC/C,CAAC;KACJ,CAAC,CAAC;IAEH,MAAM,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAClD,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,QAAQ,EAAE,CAAC;IAExC,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;IAC5D,CAAC;IAED,OAAO;QACH,QAAQ,EAAE,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC;QACrC,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,WAAW,CAAC;QACvC,KAAK,EAAE,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC;KAClC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coverage-session.js","sourceRoot":"","sources":["../../../../source/run/coverage-session.ts"],"names":[],"mappings":"AAAA,OAA2C,kBAAkB,CAAC;AAC9D,OAAuC,gBAAgB,CAAC;AACxD,OAAiB,WAAW,CAAC;AAC7B,OAAqB,MAAM,CAAC;AAO5B,OAGO,4BAA4B,CAAC;AAEpC,OAAkE,yBAAyB,CAAC;AAC5F,OAA6B,uBAAuB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Engine } from '../engine/engine.ts';
|
|
2
|
-
import { type NodeRunOrchestratorInput } from './run-orchestrator.ts';
|
|
2
|
+
import { type NodeRunCoordinator, type NodeRunOrchestratorInput } from './run-orchestrator.ts';
|
|
3
3
|
import type { RunOrchestrator } from './run-types.ts';
|
|
4
4
|
export type CurrentProcessRunOrchestratorDependencies = {
|
|
5
5
|
readonly discoverRunFilesWithProjectRoot: NodeRunOrchestratorInput['discoverRunFilesWithProjectRoot'];
|
|
@@ -9,4 +9,5 @@ export type CurrentProcessRunOrchestratorDependencies = {
|
|
|
9
9
|
readonly startWorkerPoolHost: NodeRunOrchestratorInput['startWorkerPoolHost'];
|
|
10
10
|
};
|
|
11
11
|
export declare function createCurrentProcessRunOrchestrator(defaultEngine: Engine, dependencies: CurrentProcessRunOrchestratorDependencies): RunOrchestrator;
|
|
12
|
+
export declare function createCurrentProcessRunCoordinator(defaultEngine: Engine, dependencies: CurrentProcessRunOrchestratorDependencies): NodeRunCoordinator;
|
|
12
13
|
//# sourceMappingURL=current-process-run-orchestrator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"current-process-run-orchestrator.d.ts","sourceRoot":"","sources":["../../../../source/run/current-process-run-orchestrator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAMlD,OAAO,
|
|
1
|
+
{"version":3,"file":"current-process-run-orchestrator.d.ts","sourceRoot":"","sources":["../../../../source/run/current-process-run-orchestrator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAMlD,OAAO,EAGH,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAChC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,MAAM,MAAM,yCAAyC,GAAG;IACpD,QAAQ,CAAC,+BAA+B,EAAE,wBAAwB,CAAC,iCAAiC,CAAC,CAAC;IACtG,QAAQ,CAAC,mBAAmB,EAAE,wBAAwB,CAAC,qBAAqB,CAAC,CAAC;IAC9E,QAAQ,CAAC,kBAAkB,EAAE,wBAAwB,CAAC,oBAAoB,CAAC,CAAC;IAC5E,QAAQ,CAAC,oBAAoB,EAAE,wBAAwB,CAAC,sBAAsB,CAAC,CAAC;IAChF,QAAQ,CAAC,mBAAmB,EAAE,wBAAwB,CAAC,qBAAqB,CAAC,CAAC;CACjF,CAAC;AAkBF,wBAAgB,mCAAmC,CAC/C,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,yCAAyC,GACxD,eAAe,CA4BjB;AAED,wBAAgB,kCAAkC,CAC9C,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,yCAAyC,GACxD,kBAAkB,CA4BpB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { installIpcRestriction as installProcessIpcRestriction, installProcessExecutionRestriction as installNodeProcessExecutionRestriction } from "./node-process-capability-restrictions.js";
|
|
2
2
|
import { readProcessEnvironment, readWebStorage } from "./node-host-readers.js";
|
|
3
|
-
import { createNodeRunOrchestrator } from "./run-orchestrator.js";
|
|
3
|
+
import { createNodeRunCoordinator, createNodeRunOrchestrator } from "./run-orchestrator.js";
|
|
4
4
|
function writeStdoutLine(line) {
|
|
5
5
|
process.stdout.write(`${line}\n`);
|
|
6
6
|
}
|
|
@@ -42,4 +42,33 @@ export function createCurrentProcessRunOrchestrator(defaultEngine, dependencies)
|
|
|
42
42
|
stdout: { write: writeStdout, writeLine: writeStdoutLine }
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
+
export function createCurrentProcessRunCoordinator(defaultEngine, dependencies) {
|
|
46
|
+
return createNodeRunCoordinator({
|
|
47
|
+
defaultEngine,
|
|
48
|
+
discoverRunFilesWithProjectRoot: dependencies.discoverRunFilesWithProjectRoot,
|
|
49
|
+
loadRunEngineModule: dependencies.loadRunEngineModule,
|
|
50
|
+
loadRunTestModules: dependencies.loadRunTestModules,
|
|
51
|
+
startSupervisedChild: dependencies.startSupervisedChild,
|
|
52
|
+
startWorkerPoolHost: dependencies.startWorkerPoolHost,
|
|
53
|
+
installIpcRestriction(record) {
|
|
54
|
+
return installProcessIpcRestriction(process, record);
|
|
55
|
+
},
|
|
56
|
+
installProcessExecutionRestriction(record) {
|
|
57
|
+
return installNodeProcessExecutionRestriction(process, record);
|
|
58
|
+
},
|
|
59
|
+
node: {
|
|
60
|
+
arch: process.arch,
|
|
61
|
+
platform: process.platform,
|
|
62
|
+
version: process.versions.node
|
|
63
|
+
},
|
|
64
|
+
readEnvironment() {
|
|
65
|
+
return readProcessEnvironment(process);
|
|
66
|
+
},
|
|
67
|
+
readStorage(name) {
|
|
68
|
+
return readWebStorage(globalThis, name);
|
|
69
|
+
},
|
|
70
|
+
stderr: { write: writeStderr, writeLine: writeStderrLine },
|
|
71
|
+
stdout: { write: writeStdout, writeLine: writeStdoutLine }
|
|
72
|
+
});
|
|
73
|
+
}
|
|
45
74
|
//# sourceMappingURL=current-process-run-orchestrator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"current-process-run-orchestrator.js","sourceRoot":"","sources":["../../../../source/run/current-process-run-orchestrator.ts"],"names":[],"mappings":"AACA,OAAO,EACH,qBAAqB,IAAI,4BAA4B,EACrD,kCAAkC,IAAI,sCAAsC,EAC/E,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EACH,yBAAyB,
|
|
1
|
+
{"version":3,"file":"current-process-run-orchestrator.js","sourceRoot":"","sources":["../../../../source/run/current-process-run-orchestrator.ts"],"names":[],"mappings":"AACA,OAAO,EACH,qBAAqB,IAAI,4BAA4B,EACrD,kCAAkC,IAAI,sCAAsC,EAC/E,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EACH,wB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ues } from "../compare/comparison.js";
|
|
2
|
+
import { collectedRunPlanFromTestPlan } from "./collected-run-plan.js";
|
|
3
|
+
import { RunCollectionError } from "./run-errors.js";
|
|
4
|
+
function differencePath(expected, actual) {
|
|
5
|
+
const comparison = compareDeepValues(actual, expected);
|
|
6
|
+
return JSON.stringify(comparison.path);
|
|
7
|
+
}
|
|
8
|
+
function normalizedCollectedPlan(plan) {
|
|
9
|
+
return {
|
|
10
|
+
defined: plan.defined,
|
|
11
|
+
discoveredFiles: structuredClone(plan.discoveredFiles),
|
|
12
|
+
files: structuredClone(plan.files),
|
|
13
|
+
orphans: structuredClone(plan.orphans),
|
|
14
|
+
root: structuredClone(plan.root)
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export function assertDirectEntrypointCollectionMatches(expectedTestPlan, actual) {
|
|
18
|
+
const expected = normalizedCollectedPlan(collectedRunPlanFromTestPlan(expectedTestPlan));
|
|
19
|
+
const normalizedActual = normalizedCollectedPlan(actual);
|
|
20
|
+
const comparison = compareDeepValues(normalizedActual, expected);
|
|
21
|
+
if (comparison.passed) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const path = differencePath(expected, normalizedActual);
|
|
25
|
+
throw new RunCollectionError(`runIfMain() argument does not match the module's exported testNode at ${path}.`, { cause: null }, 'loader');
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=direct-entrypoint-collection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"direct-entrypoint-collection.js","sourceRoot":"","sources":["../../../../source/run/direct-entrypoint-collection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAGrD,SAAS,cAAc,CAAC,QAA0B,EAAE,MAAwB;IACxE,MAAM,UAAU,GAAG,iBAAiB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAEvD,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AAC3C,CAAC;AAED,SAAS,uBAAuB,CAAC,IAAsB;IACnD,OAAO;QACH,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,eAAe,EAAE,eAAe,CAAC,IAAI,CAAC,eAAe,CAAC;QACtD,KAAK,EAAE,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC;QAClC,OAAO,EAAE,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC;QACtC,IAAI,EAAE,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC;KACnC,CAAC;AACN,CAAC;AAED,MAAM,UAAU,uCAAuC,CACnD,gBAA0B,EAC1B,MAAwB;IAExB,MAAM,QAAQ,GAAG,uBAAuB,CAAC,4BAA4B,CAAC,gBAAgB,CAAC,CAAC,CAAC;IACzF,MAAM,gBAAgB,GAAG,uBAAuB,CAAC,MAAM,CAAC,CAAC;IAEzD,MAAM,UAAU,GAAG,iBAAiB,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;IAEjE,IAAI,UAAU,CAAC,MAAM,EAAE,CAAC;QACpB,OAAO;IACX,CAAC;IAED,MAAM,IAAI,GAAG,cAAc,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;IAExD,MAAM,IAAI,kBAAkB,CACxB,yEAAyE,IAAI,GAAG,EAChF,EAAE,KAAK,EAAE,IAAI,EAAE,EACf,QAAQ,CACX,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const durationHistoryIndexVersion = 2;
|
|
3
|
+
declare const entrySchema: z.ZodReadonly<z.ZodObject<{
|
|
4
|
+
observations: z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
|
|
5
|
+
durationMicroseconds: z.ZodNumber;
|
|
6
|
+
metadata: z.ZodReadonly<z.ZodObject<{
|
|
7
|
+
processModel: z.ZodUnion<readonly [z.ZodLiteral<"in-process">, z.ZodLiteral<"supervised-process">, z.ZodLiteral<"worker-pool">]>;
|
|
8
|
+
profile: z.ZodString;
|
|
9
|
+
scheduling: z.ZodUnion<readonly [z.ZodLiteral<"concurrent">, z.ZodLiteral<"serial">]>;
|
|
10
|
+
testFamily: z.ZodUnion<readonly [z.ZodLiteral<"integration">, z.ZodLiteral<"microtest">]>;
|
|
11
|
+
workerLifecycle: z.ZodNullable<z.ZodUnion<readonly [z.ZodLiteral<"fresh-worker-per-unit">, z.ZodLiteral<"reuse">]>>;
|
|
12
|
+
}, z.core.$strict>>;
|
|
13
|
+
observedAt: z.ZodISODateTime;
|
|
14
|
+
}, z.core.$strict>>, z.ZodPipe<z.ZodReadonly<z.ZodObject<{
|
|
15
|
+
durationMilliseconds: z.ZodNumber;
|
|
16
|
+
metadata: z.ZodReadonly<z.ZodObject<{
|
|
17
|
+
processModel: z.ZodUnion<readonly [z.ZodLiteral<"in-process">, z.ZodLiteral<"supervised-process">, z.ZodLiteral<"worker-pool">]>;
|
|
18
|
+
profile: z.ZodString;
|
|
19
|
+
scheduling: z.ZodUnion<readonly [z.ZodLiteral<"concurrent">, z.ZodLiteral<"serial">]>;
|
|
20
|
+
testFamily: z.ZodUnion<readonly [z.ZodLiteral<"integration">, z.ZodLiteral<"microtest">]>;
|
|
21
|
+
workerLifecycle: z.ZodNullable<z.ZodUnion<readonly [z.ZodLiteral<"fresh-worker-per-unit">, z.ZodLiteral<"reuse">]>>;
|
|
22
|
+
}, z.core.$strict>>;
|
|
23
|
+
observedAt: z.ZodISODateTime;
|
|
24
|
+
}, z.core.$strict>>, z.ZodTransform<{
|
|
25
|
+
durationMicroseconds: number;
|
|
26
|
+
metadata: Readonly<{
|
|
27
|
+
processModel: "in-process" | "supervised-process" | "worker-pool";
|
|
28
|
+
profile: string;
|
|
29
|
+
scheduling: "serial" | "concurrent";
|
|
30
|
+
testFamily: "integration" | "microtest";
|
|
31
|
+
workerLifecycle: "fresh-worker-per-unit" | "reuse" | null;
|
|
32
|
+
}>;
|
|
33
|
+
observedAt: string;
|
|
34
|
+
}, Readonly<{
|
|
35
|
+
durationMilliseconds: number;
|
|
36
|
+
metadata: Readonly<{
|
|
37
|
+
processModel: "in-process" | "supervised-process" | "worker-pool";
|
|
38
|
+
profile: string;
|
|
39
|
+
scheduling: "serial" | "concurrent";
|
|
40
|
+
testFamily: "integration" | "microtest";
|
|
41
|
+
workerLifecycle: "fresh-worker-per-unit" | "reuse" | null;
|
|
42
|
+
}>;
|
|
43
|
+
observedAt: string;
|
|
44
|
+
}>>>]>>>;
|
|
45
|
+
work: z.ZodReadonly<z.ZodObject<{
|
|
46
|
+
case: z.ZodReadonly<z.ZodObject<{
|
|
47
|
+
file: z.ZodNullable<z.ZodString>;
|
|
48
|
+
params: z.ZodNullable<z.ZodString>;
|
|
49
|
+
suite: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
50
|
+
title: z.ZodString;
|
|
51
|
+
}, z.core.$strict>>;
|
|
52
|
+
runtimes: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
53
|
+
dimensions: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
54
|
+
name: z.ZodString;
|
|
55
|
+
scenarios: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
56
|
+
variantId: z.ZodNullable<z.ZodString>;
|
|
57
|
+
}, z.core.$strict>>>>;
|
|
58
|
+
workload: z.ZodNullable<z.ZodReadonly<z.ZodObject<{
|
|
59
|
+
name: z.ZodString;
|
|
60
|
+
params: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
61
|
+
}, z.core.$strict>>>;
|
|
62
|
+
}, z.core.$strict>>;
|
|
63
|
+
}, z.core.$strict>>;
|
|
64
|
+
type CurrentDurationHistoryIndex = {
|
|
65
|
+
readonly entries: readonly z.output<typeof entrySchema>[];
|
|
66
|
+
readonly updatedAt: string;
|
|
67
|
+
readonly version: typeof durationHistoryIndexVersion;
|
|
68
|
+
};
|
|
69
|
+
export declare const durationHistoryIndexSchema: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
|
|
70
|
+
entries: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
71
|
+
observations: z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
|
|
72
|
+
durationMicroseconds: z.ZodNumber;
|
|
73
|
+
metadata: z.ZodReadonly<z.ZodObject<{
|
|
74
|
+
processModel: z.ZodUnion<readonly [z.ZodLiteral<"in-process">, z.ZodLiteral<"supervised-process">, z.ZodLiteral<"worker-pool">]>;
|
|
75
|
+
profile: z.ZodString;
|
|
76
|
+
scheduling: z.ZodUnion<readonly [z.ZodLiteral<"concurrent">, z.ZodLiteral<"serial">]>;
|
|
77
|
+
testFamily: z.ZodUnion<readonly [z.ZodLiteral<"integration">, z.ZodLiteral<"microtest">]>;
|
|
78
|
+
workerLifecycle: z.ZodNullable<z.ZodUnion<readonly [z.ZodLiteral<"fresh-worker-per-unit">, z.ZodLiteral<"reuse">]>>;
|
|
79
|
+
}, z.core.$strict>>;
|
|
80
|
+
observedAt: z.ZodISODateTime;
|
|
81
|
+
}, z.core.$strict>>, z.ZodPipe<z.ZodReadonly<z.ZodObject<{
|
|
82
|
+
durationMilliseconds: z.ZodNumber;
|
|
83
|
+
metadata: z.ZodReadonly<z.ZodObject<{
|
|
84
|
+
processModel: z.ZodUnion<readonly [z.ZodLiteral<"in-process">, z.ZodLiteral<"supervised-process">, z.ZodLiteral<"worker-pool">]>;
|
|
85
|
+
profile: z.ZodString;
|
|
86
|
+
scheduling: z.ZodUnion<readonly [z.ZodLiteral<"concurrent">, z.ZodLiteral<"serial">]>;
|
|
87
|
+
testFamily: z.ZodUnion<readonly [z.ZodLiteral<"integration">, z.ZodLiteral<"microtest">]>;
|
|
88
|
+
workerLifecycle: z.ZodNullable<z.ZodUnion<readonly [z.ZodLiteral<"fresh-worker-per-unit">, z.ZodLiteral<"reuse">]>>;
|
|
89
|
+
}, z.core.$strict>>;
|
|
90
|
+
observedAt: z.ZodISODateTime;
|
|
91
|
+
}, z.core.$strict>>, z.ZodTransform<{
|
|
92
|
+
durationMicroseconds: number;
|
|
93
|
+
metadata: Readonly<{
|
|
94
|
+
processModel: "in-process" | "supervised-process" | "worker-pool";
|
|
95
|
+
profile: string;
|
|
96
|
+
scheduling: "serial" | "concurrent";
|
|
97
|
+
testFamily: "integration" | "microtest";
|
|
98
|
+
workerLifecycle: "fresh-worker-per-unit" | "reuse" | null;
|
|
99
|
+
}>;
|
|
100
|
+
observedAt: string;
|
|
101
|
+
}, Readonly<{
|
|
102
|
+
durationMilliseconds: number;
|
|
103
|
+
metadata: Readonly<{
|
|
104
|
+
processModel: "in-process" | "supervised-process" | "worker-pool";
|
|
105
|
+
profile: string;
|
|
106
|
+
scheduling: "serial" | "concurrent";
|
|
107
|
+
testFamily: "integration" | "microtest";
|
|
108
|
+
workerLifecycle: "fresh-worker-per-unit" | "reuse" | null;
|
|
109
|
+
}>;
|
|
110
|
+
observedAt: string;
|
|
111
|
+
}>>>]>>>;
|
|
112
|
+
work: z.ZodReadonly<z.ZodObject<{
|
|
113
|
+
case: z.ZodReadonly<z.ZodObject<{
|
|
114
|
+
file: z.ZodNullable<z.ZodString>;
|
|
115
|
+
params: z.ZodNullable<z.ZodString>;
|
|
116
|
+
suite: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
117
|
+
title: z.ZodString;
|
|
118
|
+
}, z.core.$strict>>;
|
|
119
|
+
runtimes: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
120
|
+
dimensions: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
121
|
+
name: z.ZodString;
|
|
122
|
+
scenarios: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
123
|
+
variantId: z.ZodNullable<z.ZodString>;
|
|
124
|
+
}, z.core.$strict>>>>;
|
|
125
|
+
workload: z.ZodNullable<z.ZodReadonly<z.ZodObject<{
|
|
126
|
+
name: z.ZodString;
|
|
127
|
+
params: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
128
|
+
}, z.core.$strict>>>;
|
|
129
|
+
}, z.core.$strict>>;
|
|
130
|
+
}, z.core.$strict>>>>;
|
|
131
|
+
updatedAt: z.ZodISODateTime;
|
|
132
|
+
version: z.ZodLiteral<2>;
|
|
133
|
+
}, z.core.$strict>>, z.ZodPipe<z.ZodReadonly<z.ZodObject<{
|
|
134
|
+
entries: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
135
|
+
observations: z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
|
|
136
|
+
durationMicroseconds: z.ZodNumber;
|
|
137
|
+
metadata: z.ZodReadonly<z.ZodObject<{
|
|
138
|
+
processModel: z.ZodUnion<readonly [z.ZodLiteral<"in-process">, z.ZodLiteral<"supervised-process">, z.ZodLiteral<"worker-pool">]>;
|
|
139
|
+
profile: z.ZodString;
|
|
140
|
+
scheduling: z.ZodUnion<readonly [z.ZodLiteral<"concurrent">, z.ZodLiteral<"serial">]>;
|
|
141
|
+
testFamily: z.ZodUnion<readonly [z.ZodLiteral<"integration">, z.ZodLiteral<"microtest">]>;
|
|
142
|
+
workerLifecycle: z.ZodNullable<z.ZodUnion<readonly [z.ZodLiteral<"fresh-worker-per-unit">, z.ZodLiteral<"reuse">]>>;
|
|
143
|
+
}, z.core.$strict>>;
|
|
144
|
+
observedAt: z.ZodISODateTime;
|
|
145
|
+
}, z.core.$strict>>, z.ZodPipe<z.ZodReadonly<z.ZodObject<{
|
|
146
|
+
durationMilliseconds: z.ZodNumber;
|
|
147
|
+
metadata: z.ZodReadonly<z.ZodObject<{
|
|
148
|
+
processModel: z.ZodUnion<readonly [z.ZodLiteral<"in-process">, z.ZodLiteral<"supervised-process">, z.ZodLiteral<"worker-pool">]>;
|
|
149
|
+
profile: z.ZodString;
|
|
150
|
+
scheduling: z.ZodUnion<readonly [z.ZodLiteral<"concurrent">, z.ZodLiteral<"serial">]>;
|
|
151
|
+
testFamily: z.ZodUnion<readonly [z.ZodLiteral<"integration">, z.ZodLiteral<"microtest">]>;
|
|
152
|
+
workerLifecycle: z.ZodNullable<z.ZodUnion<readonly [z.ZodLiteral<"fresh-worker-per-unit">, z.ZodLiteral<"reuse">]>>;
|
|
153
|
+
}, z.core.$strict>>;
|
|
154
|
+
observedAt: z.ZodISODateTime;
|
|
155
|
+
}, z.core.$strict>>, z.ZodTransform<{
|
|
156
|
+
durationMicroseconds: number;
|
|
157
|
+
metadata: Readonly<{
|
|
158
|
+
processModel: "in-process" | "supervised-process" | "worker-pool";
|
|
159
|
+
profile: string;
|
|
160
|
+
scheduling: "serial" | "concurrent";
|
|
161
|
+
testFamily: "integration" | "microtest";
|
|
162
|
+
workerLifecycle: "fresh-worker-per-unit" | "reuse" | null;
|
|
163
|
+
}>;
|
|
164
|
+
observedAt: string;
|
|
165
|
+
}, Readonly<{
|
|
166
|
+
durationMilliseconds: number;
|
|
167
|
+
metadata: Readonly<{
|
|
168
|
+
processModel: "in-process" | "supervised-process" | "worker-pool";
|
|
169
|
+
profile: string;
|
|
170
|
+
scheduling: "serial" | "concurrent";
|
|
171
|
+
testFamily: "integration" | "microtest";
|
|
172
|
+
workerLifecycle: "fresh-worker-per-unit" | "reuse" | null;
|
|
173
|
+
}>;
|
|
174
|
+
observedAt: string;
|
|
175
|
+
}>>>]>>>;
|
|
176
|
+
work: z.ZodReadonly<z.ZodObject<{
|
|
177
|
+
case: z.ZodReadonly<z.ZodObject<{
|
|
178
|
+
file: z.ZodNullable<z.ZodString>;
|
|
179
|
+
params: z.ZodNullable<z.ZodString>;
|
|
180
|
+
suite: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
181
|
+
title: z.ZodString;
|
|
182
|
+
}, z.core.$strict>>;
|
|
183
|
+
runtimes: z.ZodReadonly<z.ZodArray<z.ZodPipe<z.ZodReadonly<z.ZodObject<{
|
|
184
|
+
dimensions: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
185
|
+
name: z.ZodString;
|
|
186
|
+
variantId: z.ZodNullable<z.ZodString>;
|
|
187
|
+
}, z.core.$strict>>, z.ZodTransform<{
|
|
188
|
+
scenarios: {};
|
|
189
|
+
dimensions: Readonly<Record<string, string>>;
|
|
190
|
+
name: string;
|
|
191
|
+
variantId: string | null;
|
|
192
|
+
}, Readonly<{
|
|
193
|
+
dimensions: Readonly<Record<string, string>>;
|
|
194
|
+
name: string;
|
|
195
|
+
variantId: string | null;
|
|
196
|
+
}>>>>>;
|
|
197
|
+
workload: z.ZodNullable<z.ZodReadonly<z.ZodObject<{
|
|
198
|
+
name: z.ZodString;
|
|
199
|
+
params: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
200
|
+
}, z.core.$strict>>>;
|
|
201
|
+
}, z.core.$strict>>;
|
|
202
|
+
}, z.core.$strict>>>>;
|
|
203
|
+
updatedAt: z.ZodISODateTime;
|
|
204
|
+
version: z.ZodLiteral<1>;
|
|
205
|
+
}, z.core.$strict>>, z.ZodTransform<CurrentDurationHistoryIndex, Readonly<{
|
|
206
|
+
entries: readonly Readonly<{
|
|
207
|
+
observations: readonly ({
|
|
208
|
+
durationMicroseconds: number;
|
|
209
|
+
metadata: Readonly<{
|
|
210
|
+
processModel: "in-process" | "supervised-process" | "worker-pool";
|
|
211
|
+
profile: string;
|
|
212
|
+
scheduling: "serial" | "concurrent";
|
|
213
|
+
testFamily: "integration" | "microtest";
|
|
214
|
+
workerLifecycle: "fresh-worker-per-unit" | "reuse" | null;
|
|
215
|
+
}>;
|
|
216
|
+
observedAt: string;
|
|
217
|
+
} | Readonly<{
|
|
218
|
+
durationMicroseconds: number;
|
|
219
|
+
metadata: Readonly<{
|
|
220
|
+
processModel: "in-process" | "supervised-process" | "worker-pool";
|
|
221
|
+
profile: string;
|
|
222
|
+
scheduling: "serial" | "concurrent";
|
|
223
|
+
testFamily: "integration" | "microtest";
|
|
224
|
+
workerLifecycle: "fresh-worker-per-unit" | "reuse" | null;
|
|
225
|
+
}>;
|
|
226
|
+
observedAt: string;
|
|
227
|
+
}>)[];
|
|
228
|
+
work: Readonly<{
|
|
229
|
+
case: Readonly<{
|
|
230
|
+
file: string | null;
|
|
231
|
+
params: string | null;
|
|
232
|
+
suite: readonly string[];
|
|
233
|
+
title: string;
|
|
234
|
+
}>;
|
|
235
|
+
runtimes: readonly {
|
|
236
|
+
scenarios: {};
|
|
237
|
+
dimensions: Readonly<Record<string, string>>;
|
|
238
|
+
name: string;
|
|
239
|
+
variantId: string | null;
|
|
240
|
+
}[];
|
|
241
|
+
workload: Readonly<{
|
|
242
|
+
name: string;
|
|
243
|
+
params: Readonly<Record<string, string>>;
|
|
244
|
+
}> | null;
|
|
245
|
+
}>;
|
|
246
|
+
}>[];
|
|
247
|
+
updatedAt: string;
|
|
248
|
+
version: 1;
|
|
249
|
+
}>>>]>;
|
|
250
|
+
export {};
|
|
251
|
+
//# sourceMappingURL=duration-history-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duration-history-schema.d.ts","sourceRoot":"","sources":["../../../../source/run/duration-history-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,2BAA2B,IAAI,CAAC;AAsF7C,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAKF,CAAC;AAOhB,KAAK,2BAA2B,GAAG;IAC/B,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,WAAW,CAAC,EAAE,CAAC;IAC1D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,OAAO,2BAA2B,CAAC;CACxD,CAAC;AAwBF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAqD,CAAC"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const durationHistoryIndexVersion = 2;
|
|
3
|
+
const legacyDurationHistoryIndexVersion = 1;
|
|
4
|
+
const microsecondsPerMillisecond = 1000;
|
|
5
|
+
const stringRecordSchema = z.record(z.string(), z.string()).readonly();
|
|
6
|
+
const caseIdSchema = z
|
|
7
|
+
.strictObject({
|
|
8
|
+
file: z.string().nullable(),
|
|
9
|
+
params: z.string().nullable(),
|
|
10
|
+
suite: z.array(z.string()).readonly(),
|
|
11
|
+
title: z.string()
|
|
12
|
+
})
|
|
13
|
+
.readonly();
|
|
14
|
+
const runtimeIdSchema = z
|
|
15
|
+
.strictObject({
|
|
16
|
+
dimensions: stringRecordSchema,
|
|
17
|
+
name: z.string(),
|
|
18
|
+
scenarios: stringRecordSchema,
|
|
19
|
+
variantId: z.string().nullable()
|
|
20
|
+
})
|
|
21
|
+
.readonly();
|
|
22
|
+
const legacyRuntimeIdSchema = z
|
|
23
|
+
.strictObject({
|
|
24
|
+
dimensions: stringRecordSchema,
|
|
25
|
+
name: z.string(),
|
|
26
|
+
variantId: z.string().nullable()
|
|
27
|
+
})
|
|
28
|
+
.readonly()
|
|
29
|
+
.transform(function addScenarioBindings(runtime) {
|
|
30
|
+
return { ...runtime, scenarios: {} };
|
|
31
|
+
});
|
|
32
|
+
const workloadIdSchema = z
|
|
33
|
+
.strictObject({
|
|
34
|
+
name: z.string(),
|
|
35
|
+
params: stringRecordSchema
|
|
36
|
+
})
|
|
37
|
+
.readonly();
|
|
38
|
+
const metadataSchema = z
|
|
39
|
+
.strictObject({
|
|
40
|
+
processModel: z.union([
|
|
41
|
+
z.literal('in-process'),
|
|
42
|
+
z.literal('supervised-process'),
|
|
43
|
+
z.literal('worker-pool')
|
|
44
|
+
]),
|
|
45
|
+
profile: z.string(),
|
|
46
|
+
scheduling: z.union([z.literal('concurrent'), z.literal('serial')]),
|
|
47
|
+
testFamily: z.union([z.literal('integration'), z.literal('microtest')]),
|
|
48
|
+
workerLifecycle: z.union([z.literal('fresh-worker-per-unit'), z.literal('reuse')]).nullable()
|
|
49
|
+
})
|
|
50
|
+
.readonly();
|
|
51
|
+
const currentObservationSchema = z
|
|
52
|
+
.strictObject({
|
|
53
|
+
durationMicroseconds: z.number().check(z.nonnegative()),
|
|
54
|
+
metadata: metadataSchema,
|
|
55
|
+
observedAt: z.iso.datetime({ offset: true })
|
|
56
|
+
})
|
|
57
|
+
.readonly();
|
|
58
|
+
const legacyObservationSchema = z
|
|
59
|
+
.strictObject({
|
|
60
|
+
durationMilliseconds: z.number().check(z.nonnegative()),
|
|
61
|
+
metadata: metadataSchema,
|
|
62
|
+
observedAt: z.iso.datetime({ offset: true })
|
|
63
|
+
})
|
|
64
|
+
.readonly()
|
|
65
|
+
.transform(function toMicrosecondObservation(observation) {
|
|
66
|
+
return {
|
|
67
|
+
durationMicroseconds: observation.durationMilliseconds * microsecondsPerMillisecond,
|
|
68
|
+
metadata: observation.metadata,
|
|
69
|
+
observedAt: observation.observedAt
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
const observationSchema = z.union([currentObservationSchema, legacyObservationSchema]);
|
|
73
|
+
const workIdSchema = z
|
|
74
|
+
.strictObject({
|
|
75
|
+
case: caseIdSchema,
|
|
76
|
+
runtimes: z.array(runtimeIdSchema).readonly(),
|
|
77
|
+
workload: workloadIdSchema.nullable()
|
|
78
|
+
})
|
|
79
|
+
.readonly();
|
|
80
|
+
const legacyWorkIdSchema = z
|
|
81
|
+
.strictObject({
|
|
82
|
+
case: caseIdSchema,
|
|
83
|
+
runtimes: z.array(legacyRuntimeIdSchema).readonly(),
|
|
84
|
+
workload: workloadIdSchema.nullable()
|
|
85
|
+
})
|
|
86
|
+
.readonly();
|
|
87
|
+
const entrySchema = z
|
|
88
|
+
.strictObject({
|
|
89
|
+
observations: z.array(observationSchema).readonly(),
|
|
90
|
+
work: workIdSchema
|
|
91
|
+
})
|
|
92
|
+
.readonly();
|
|
93
|
+
const legacyEntrySchema = z
|
|
94
|
+
.strictObject({
|
|
95
|
+
observations: z.array(observationSchema).readonly(),
|
|
96
|
+
work: legacyWorkIdSchema
|
|
97
|
+
})
|
|
98
|
+
.readonly();
|
|
99
|
+
const currentIndexSchema = z
|
|
100
|
+
.strictObject({
|
|
101
|
+
entries: z.array(entrySchema).readonly(),
|
|
102
|
+
updatedAt: z.iso.datetime({ offset: true }),
|
|
103
|
+
version: z.literal(durationHistoryIndexVersion)
|
|
104
|
+
})
|
|
105
|
+
.readonly();
|
|
106
|
+
const legacyIndexSchema = z
|
|
107
|
+
.strictObject({
|
|
108
|
+
entries: z.array(legacyEntrySchema).readonly(),
|
|
109
|
+
updatedAt: z.iso.datetime({ offset: true }),
|
|
110
|
+
version: z.literal(legacyDurationHistoryIndexVersion)
|
|
111
|
+
})
|
|
112
|
+
.readonly()
|
|
113
|
+
.transform(function migrateIndex(index) {
|
|
114
|
+
return {
|
|
115
|
+
entries: index.entries,
|
|
116
|
+
updatedAt: index.updatedAt,
|
|
117
|
+
version: durationHistoryIndexVersion
|
|
118
|
+
};
|
|
119
|
+
});
|
|
120
|
+
export const durationHistoryIndexSchema = z.union([currentIndexSchema, legacyIndexSchema]);
|
|
121
|
+
//# sourceMappingURL=duration-history-schema.js.map
|