@smoothbricks/nx-plugin 0.6.1 → 0.6.3-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +264 -55
- package/dist/.build-inputs.json +21 -15
- package/dist/bin/smoo-nx-publish.d.ts +3 -0
- package/dist/bin/smoo-nx-publish.d.ts.map +1 -0
- package/dist/bin/smoo-nx-publish.js +3 -0
- package/dist/cargo-retention-hook.d.ts +14 -3
- package/dist/cargo-retention-hook.d.ts.map +1 -1
- package/dist/cargo-retention-hook.js +25 -8
- package/dist/eslint-file-set.d.ts +4 -1
- package/dist/eslint-file-set.d.ts.map +1 -1
- package/dist/eslint-sources.d.ts +25 -0
- package/dist/eslint-sources.d.ts.map +1 -0
- package/dist/eslint-sources.js +99 -0
- package/dist/executors/all-verdicts/executor.d.ts +2 -1
- package/dist/executors/all-verdicts/executor.d.ts.map +1 -1
- package/dist/executors/all-verdicts/executor.js +48 -2
- package/dist/executors/all-verdicts/schema.d.ts +13 -0
- package/dist/executors/all-verdicts/schema.d.ts.map +1 -1
- package/dist/executors/all-verdicts/schema.js +7 -0
- package/dist/executors/bounded-exec/bounds.d.ts +57 -8
- package/dist/executors/bounded-exec/bounds.d.ts.map +1 -1
- package/dist/executors/bounded-exec/bounds.js +100 -11
- package/dist/executors/bounded-exec/executor.d.ts +2 -1
- package/dist/executors/bounded-exec/executor.d.ts.map +1 -1
- package/dist/executors/bounded-exec/executor.js +270 -27
- package/dist/executors/bounded-exec/hang-diagnostics.d.ts +2 -0
- package/dist/executors/bounded-exec/hang-diagnostics.d.ts.map +1 -1
- package/dist/executors/bounded-exec/hang-diagnostics.js +27 -3
- package/dist/executors/bounded-exec/mbx-pool.d.ts +20 -3
- package/dist/executors/bounded-exec/mbx-pool.d.ts.map +1 -1
- package/dist/executors/bounded-exec/mbx-pool.js +84 -4
- package/dist/executors/bounded-exec/mbx-queue.d.ts +30 -0
- package/dist/executors/bounded-exec/mbx-queue.d.ts.map +1 -0
- package/dist/executors/bounded-exec/mbx-queue.js +229 -0
- package/dist/executors/bounded-exec/progress.d.ts +9 -2
- package/dist/executors/bounded-exec/progress.d.ts.map +1 -1
- package/dist/executors/bounded-exec/progress.js +148 -22
- package/dist/executors/bounded-exec/test-result-writer.d.ts +30 -0
- package/dist/executors/bounded-exec/test-result-writer.d.ts.map +1 -0
- package/dist/executors/bounded-exec/test-result-writer.js +126 -0
- package/dist/executors/bounded-exec/test-results.d.ts +33 -0
- package/dist/executors/bounded-exec/test-results.d.ts.map +1 -0
- package/dist/executors/bounded-exec/test-results.js +33 -0
- package/dist/executors/bounded-exec/verdict.d.ts +20 -2
- package/dist/executors/bounded-exec/verdict.d.ts.map +1 -1
- package/dist/executors/bounded-exec/verdict.js +102 -4
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +67 -65
- package/dist/managed-files/files.d.ts.map +1 -1
- package/dist/managed-files/files.js +6 -0
- package/dist/nx-publish.d.ts +24 -0
- package/dist/nx-publish.d.ts.map +1 -0
- package/dist/nx-publish.js +150 -0
- package/dist/runtime-input-policy.d.ts +14 -0
- package/dist/runtime-input-policy.d.ts.map +1 -1
- package/dist/runtime-input-policy.js +1 -1
- package/dist/tool-bins.d.ts +6 -8
- package/dist/tool-bins.d.ts.map +1 -1
- package/dist/tool-bins.js +7 -5
- package/dist/workspace-index.d.ts +7 -0
- package/dist/workspace-index.d.ts.map +1 -1
- package/dist/workspace-index.js +11 -0
- package/executors.json +1 -1
- package/managed/raw/envrc +15 -0
- package/managed/raw/patches/ttsc@0.34.1.patch +75 -0
- package/managed/raw/tooling/devenv +1 -2
- package/managed/raw/tooling/direnv/developer-links.ts +15 -1
- package/managed/raw/tooling/direnv/devenv.smoo.nix +45 -13
- package/managed/raw/tooling/direnv/github-actions-bootstrap.sh +20 -10
- package/managed/raw/tooling/direnv/linked-snapshots.ts +50 -13
- package/managed/raw/tooling/direnv/setup-environment.ts +36 -9
- package/managed/raw/tooling/direnv/ttsc-env.sh +8 -6
- package/managed/raw/tooling/git-hooks/pre-push.sh +4 -1
- package/managed/raw/tooling/git-reword-commit +151 -0
- package/managed/templates/github/actions/cache-node-modules/action.yml +1 -1
- package/managed/templates/github/actions/cache-ttsc-plugins/action.yml +12 -11
- package/package.json +226 -10
- package/runtime/nx-publish/cache_adapter.js +45 -0
- package/runtime/nx-publish/nx_publish.js +60 -0
- package/runtime-input.sh +12 -3
- package/src/bin/smoo-nx-publish.ts +4 -0
- package/src/cargo-retention-hook.ts +28 -11
- package/src/eslint-file-set.ts +4 -1
- package/src/eslint-sources.ts +134 -0
- package/src/executors/all-verdicts/executor.ts +58 -3
- package/src/executors/all-verdicts/schema.json +4 -0
- package/src/executors/all-verdicts/schema.ts +14 -0
- package/src/executors/bounded-exec/bounds.ts +132 -15
- package/src/executors/bounded-exec/executor.ts +303 -27
- package/src/executors/bounded-exec/hang-diagnostics.ts +31 -3
- package/src/executors/bounded-exec/mbx-pool.ts +82 -5
- package/src/executors/bounded-exec/mbx-queue.ts +170 -0
- package/src/executors/bounded-exec/progress.ts +168 -15
- package/src/executors/bounded-exec/test-result-writer.ts +152 -0
- package/src/executors/bounded-exec/test-results.ts +39 -0
- package/src/executors/bounded-exec/verdict.ts +108 -5
- package/src/index.ts +74 -70
- package/src/managed-files/files.ts +6 -0
- package/src/nx-publish.ts +157 -0
- package/src/runtime-input-policy.ts +1 -1
- package/src/tool-bins.ts +13 -9
- package/src/workspace-index.ts +12 -0
- package/test-timings.json +8 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { StringDecoder } from 'node:string_decoder';
|
|
1
2
|
import typia from 'typia';
|
|
2
3
|
import { invocationSpan, withInvocationFlag } from './runner-sizing.js';
|
|
3
4
|
import { BUN_TEST, GO_TEST, NEXTEST_RUN } from './verdict.js';
|
|
@@ -6,7 +7,6 @@ const ANSI = new RegExp(`${String.fromCharCode(27)}\\[[0-9;]*[A-Za-z]`, 'g');
|
|
|
6
7
|
const FINISHED = [
|
|
7
8
|
/^\s*(?:[A-Z0-9][A-Z0-9-]*\s+)+\[\s*[0-9.]+s\]\s+\(\s*\d+\/\d+\)\s+(\S.*)$/,
|
|
8
9
|
/^test (\S+) \.\.\. (?:ok|FAILED|ignored)\b/,
|
|
9
|
-
/^\((?:pass|fail|skip|todo)\) (.+)$/,
|
|
10
10
|
/^\s*[✓×]\s+(\S.*?)\s+\d+ms\b/,
|
|
11
11
|
/^\s*❯\s+(\S.*?)\s+\(\d+ tests?(?: \| \d+ (?:failed|skipped|todo))*\)\s+\d+ms\b/,
|
|
12
12
|
/^\s*↓\s+(\S.*?)\s+\(\d+ tests?(?: \| \d+ (?:skipped|todo))+\)(?:\s+\d+ms\b|$)/,
|
|
@@ -17,37 +17,55 @@ const RUNNING = [
|
|
|
17
17
|
/^test (\S+) has been running for over \d+ seconds$/,
|
|
18
18
|
];
|
|
19
19
|
const DOTS = /^\.+$/;
|
|
20
|
-
const
|
|
20
|
+
const BUN_RESULT = /^(?:\((?<status>pass|fail|skip|todo|pending)\)|(?<symbol>✓|✗|×|»|✎|…))\s+(?<name>.+?)(?: \[(?<duration>\d+(?:\.\d+)?)ms\])?$/;
|
|
21
|
+
const UNCAPTURED_NEXTEST = /(?<![\w-])--(?:no-?capture|debugger|tracer)(?=[=\s]|$)/;
|
|
22
|
+
const isNativeTestEvent = (() => {
|
|
21
23
|
const _ip0 = input => "string" === typeof input["Package"];
|
|
22
24
|
const _ip1 = input => undefined === input["Test"] || "string" === typeof input["Test"];
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
25
|
+
const _ip2 = input => "test" === input["type"];
|
|
26
|
+
const _ip3 = input => "string" === typeof input["name"];
|
|
27
|
+
const _io0 = input => "suite" === input.type && ("failed" === input.event || "ok" === input.event || "started" === input.event);
|
|
28
|
+
const _io1 = input => "start" === input.Action && _ip0(input);
|
|
29
|
+
const _io2 = input => ("cont" === input.Action || "pause" === input.Action || "run" === input.Action) && _ip0(input) && "string" === typeof input.Test;
|
|
30
|
+
const _io3 = input => ("bench" === input.Action || "fail" === input.Action || "pass" === input.Action || "skip" === input.Action) && _ip0(input) && _ip1(input) && (undefined === input.Elapsed || "number" === typeof input.Elapsed);
|
|
31
|
+
const _io4 = input => "output" === input.Action && _ip0(input) && "string" === typeof input.Output && _ip1(input);
|
|
32
|
+
const _io5 = input => _ip2(input) && ("ignored" === input.event || "started" === input.event) && _ip3(input);
|
|
33
|
+
const _io6 = input => _ip2(input) && ("failed" === input.event || "ok" === input.event) && _ip3(input) && ("number" === typeof input.exec_time && 0 <= input.exec_time) && (undefined === input.stdout || "string" === typeof input.stdout) && (undefined === input.reason || "string" === typeof input.reason);
|
|
27
34
|
const _iu0 = input => (() => {
|
|
28
|
-
if ("
|
|
35
|
+
if ("suite" === input.type)
|
|
29
36
|
return _io0(input);
|
|
30
|
-
else if ("
|
|
31
|
-
return _io2(input);
|
|
32
|
-
else if ("cont" === input.Action || "pause" === input.Action || "run" === input.Action)
|
|
37
|
+
else if ("start" === input.Action)
|
|
33
38
|
return _io1(input);
|
|
34
|
-
else if ("
|
|
39
|
+
else if ("cont" === input.Action || "pause" === input.Action || "run" === input.Action)
|
|
40
|
+
return _io2(input);
|
|
41
|
+
else if ("bench" === input.Action || "fail" === input.Action || "pass" === input.Action || "skip" === input.Action)
|
|
35
42
|
return _io3(input);
|
|
43
|
+
else if ("output" === input.Action)
|
|
44
|
+
return _io4(input);
|
|
45
|
+
else if (undefined !== input.exec_time)
|
|
46
|
+
return _io6(input);
|
|
36
47
|
else
|
|
37
|
-
return
|
|
48
|
+
return _io5(input);
|
|
38
49
|
})();
|
|
39
50
|
return input => "object" === typeof input && null !== input && _iu0(input);
|
|
40
51
|
})();
|
|
41
|
-
function
|
|
52
|
+
function nativeTestEvent(text, invalid) {
|
|
42
53
|
if (!text.startsWith('{'))
|
|
43
54
|
return null;
|
|
44
55
|
try {
|
|
45
56
|
const event = JSON.parse(text);
|
|
46
|
-
|
|
57
|
+
if (isNativeTestEvent(event))
|
|
58
|
+
return event;
|
|
59
|
+
if (typeof event === 'object' && event !== null && 'type' in event && event.type === 'test') {
|
|
60
|
+
invalid?.(`invalid native test record: ${text}`);
|
|
61
|
+
}
|
|
62
|
+
return null;
|
|
47
63
|
}
|
|
48
64
|
catch (error) {
|
|
49
|
-
if (error instanceof SyntaxError)
|
|
65
|
+
if (error instanceof SyntaxError) {
|
|
66
|
+
invalid?.(`invalid native test JSON: ${error.message}`);
|
|
50
67
|
return null;
|
|
68
|
+
}
|
|
51
69
|
throw error;
|
|
52
70
|
}
|
|
53
71
|
}
|
|
@@ -65,18 +83,37 @@ function onlyGoTests(command) {
|
|
|
65
83
|
}
|
|
66
84
|
return false;
|
|
67
85
|
}
|
|
68
|
-
export function createRunProgress(command = '') {
|
|
86
|
+
export function createRunProgress(command = '', closed) {
|
|
69
87
|
const goLifecycle = onlyGoTests(command);
|
|
88
|
+
const goResults = command.search(GO_TEST) !== -1;
|
|
70
89
|
const streams = {
|
|
71
90
|
stdout: { partial: '', countedDots: 0 },
|
|
72
91
|
stderr: { partial: '', countedDots: 0 },
|
|
73
92
|
};
|
|
74
93
|
const running = new Set();
|
|
75
94
|
const packages = new Map();
|
|
95
|
+
const goOutput = new Map();
|
|
96
|
+
const decoders = {
|
|
97
|
+
stdout: new StringDecoder('utf8'),
|
|
98
|
+
stderr: new StringDecoder('utf8'),
|
|
99
|
+
};
|
|
100
|
+
const nextestStarted = new Set();
|
|
101
|
+
const nextestJson = /--message-format(?:=|\s+)libtest-json-plus(?=\s|$)/.test(command) && !UNCAPTURED_NEXTEST.test(command);
|
|
102
|
+
let failure = null;
|
|
103
|
+
const bunResults = command.search(BUN_TEST) !== -1 && command.search(NEXTEST_RUN) === -1;
|
|
104
|
+
let bunFile = '';
|
|
105
|
+
let bunSummary = false;
|
|
106
|
+
const bunDiagnostics = { stdout: [], stderr: [] };
|
|
76
107
|
// One complete line, ANSI stripped, that is not a line of dots: true when it names a finished test.
|
|
77
|
-
const finishedLine = (text) => {
|
|
78
|
-
const event =
|
|
79
|
-
|
|
108
|
+
const finishedLine = (text, stream) => {
|
|
109
|
+
const event = stream === 'stdout'
|
|
110
|
+
? nativeTestEvent(text, nextestJson
|
|
111
|
+
? (detail) => {
|
|
112
|
+
failure ??= detail;
|
|
113
|
+
}
|
|
114
|
+
: undefined)
|
|
115
|
+
: null;
|
|
116
|
+
if (event !== null && 'Action' in event) {
|
|
80
117
|
switch (event.Action) {
|
|
81
118
|
case 'start':
|
|
82
119
|
packages.set(event.Package, new Set());
|
|
@@ -90,17 +127,82 @@ export function createRunProgress(command = '') {
|
|
|
90
127
|
case 'bench':
|
|
91
128
|
if (event.Test === undefined)
|
|
92
129
|
packages.delete(event.Package);
|
|
93
|
-
else
|
|
130
|
+
else {
|
|
94
131
|
packages.get(event.Package)?.delete(event.Test);
|
|
132
|
+
const id = `${event.Package}::${event.Test}`;
|
|
133
|
+
if (event.Action !== 'bench' && goResults)
|
|
134
|
+
closed?.({
|
|
135
|
+
id,
|
|
136
|
+
status: event.Action,
|
|
137
|
+
source: 'native',
|
|
138
|
+
durationMs: event.Elapsed === undefined ? null : event.Elapsed * 1000,
|
|
139
|
+
sourceRef: null,
|
|
140
|
+
failureOutput: event.Action === 'fail' ? (goOutput.get(id)?.join('') ?? null) : null,
|
|
141
|
+
});
|
|
142
|
+
goOutput.delete(id);
|
|
143
|
+
}
|
|
95
144
|
return true;
|
|
96
145
|
case 'pause':
|
|
97
146
|
case 'cont':
|
|
147
|
+
return false;
|
|
98
148
|
case 'output':
|
|
149
|
+
if (goResults && closed !== undefined && event.Test !== undefined) {
|
|
150
|
+
const id = `${event.Package}::${event.Test}`;
|
|
151
|
+
const output = goOutput.get(id) ?? [];
|
|
152
|
+
output.push(event.Output);
|
|
153
|
+
goOutput.set(id, output);
|
|
154
|
+
}
|
|
99
155
|
return false;
|
|
100
156
|
}
|
|
101
157
|
}
|
|
158
|
+
if (nextestJson && event !== null && 'type' in event && event.type === 'test') {
|
|
159
|
+
if (event.event === 'started') {
|
|
160
|
+
nextestStarted.add(event.name);
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
// nextest appends #N only after retries; a literal #N in the original name stays intact.
|
|
164
|
+
const name = nextestStarted.has(event.name) ? event.name : event.name.replace(/#\d+$/, '');
|
|
165
|
+
nextestStarted.delete(name);
|
|
166
|
+
const split = name.indexOf('$');
|
|
167
|
+
if (nextestJson && split !== -1)
|
|
168
|
+
closed?.({
|
|
169
|
+
id: `${name.slice(0, split)}::${name.slice(split + 1)}`,
|
|
170
|
+
status: event.event === 'ok' ? 'pass' : event.event === 'failed' ? 'fail' : 'skip',
|
|
171
|
+
source: 'native',
|
|
172
|
+
durationMs: 'exec_time' in event ? event.exec_time * 1000 : null,
|
|
173
|
+
sourceRef: null,
|
|
174
|
+
failureOutput: event.event === 'failed' ? (event.stdout ?? event.reason ?? null) : null,
|
|
175
|
+
});
|
|
176
|
+
return true;
|
|
177
|
+
}
|
|
102
178
|
if (goLifecycle)
|
|
103
179
|
return false;
|
|
180
|
+
const bun = BUN_RESULT.exec(text)?.groups;
|
|
181
|
+
if (!bunSummary &&
|
|
182
|
+
bun !== undefined &&
|
|
183
|
+
bun.name !== undefined &&
|
|
184
|
+
((bunResults && stream === 'stderr') || (bun.status !== undefined && bun.status !== 'pending'))) {
|
|
185
|
+
const status = bun.status === 'fail' ||
|
|
186
|
+
bun.status === 'pending' ||
|
|
187
|
+
bun.symbol === '…' ||
|
|
188
|
+
bun.symbol === '✗' ||
|
|
189
|
+
bun.symbol === '×'
|
|
190
|
+
? 'fail'
|
|
191
|
+
: bun.status === 'skip' || bun.status === 'todo' || bun.symbol === '»' || bun.symbol === '✎'
|
|
192
|
+
? 'skip'
|
|
193
|
+
: 'pass';
|
|
194
|
+
if (bunResults && stream === 'stderr')
|
|
195
|
+
closed?.({
|
|
196
|
+
id: `${bunFile}::${bun.name}`,
|
|
197
|
+
status,
|
|
198
|
+
source: 'progress',
|
|
199
|
+
durationMs: bun.duration === undefined ? null : Number(bun.duration),
|
|
200
|
+
sourceRef: null,
|
|
201
|
+
failureOutput: status === 'fail' ? bunDiagnostics[stream].join('') : null,
|
|
202
|
+
});
|
|
203
|
+
bunDiagnostics[stream] = [];
|
|
204
|
+
return true;
|
|
205
|
+
}
|
|
104
206
|
for (const pattern of FINISHED) {
|
|
105
207
|
const name = pattern.exec(text)?.[1];
|
|
106
208
|
if (name !== undefined) {
|
|
@@ -120,19 +222,31 @@ export function createRunProgress(command = '') {
|
|
|
120
222
|
return {
|
|
121
223
|
scan(stream, chunk) {
|
|
122
224
|
const state = streams[stream];
|
|
123
|
-
const
|
|
225
|
+
const decoded = typeof chunk === 'string' ? chunk : decoders[stream].write(chunk);
|
|
226
|
+
const lines = (state.partial + decoded).split('\n');
|
|
124
227
|
const rest = lines.pop() ?? '';
|
|
125
228
|
let progressed = false;
|
|
126
229
|
// The first complete line continues the partial one, whose dots were counted as they came.
|
|
127
230
|
let counted = state.countedDots;
|
|
128
231
|
for (const raw of lines) {
|
|
129
232
|
const text = raw.replace(ANSI, '').trimEnd();
|
|
233
|
+
if (bunResults && stream === 'stderr' && closed !== undefined) {
|
|
234
|
+
const header = /^(?:::group::)?(\S.*\.[cm]?[jt]sx?):(?: \(run #\d+\))?$/.exec(text)?.[1];
|
|
235
|
+
if (header !== undefined) {
|
|
236
|
+
bunFile = header.replace(/^\.\//, '');
|
|
237
|
+
bunSummary = false;
|
|
238
|
+
}
|
|
239
|
+
if (/^\s*\d+ tests (?:skipped|todo|failed):$/.test(text))
|
|
240
|
+
bunSummary = true;
|
|
241
|
+
if (!bunSummary)
|
|
242
|
+
bunDiagnostics[stream].push(`${raw}\n`);
|
|
243
|
+
}
|
|
130
244
|
if (DOTS.test(text)) {
|
|
131
245
|
if (!goLifecycle && DOTS.test(text)) {
|
|
132
246
|
progressed ||= text.length > counted;
|
|
133
247
|
}
|
|
134
248
|
}
|
|
135
|
-
else if (finishedLine(text)) {
|
|
249
|
+
else if (finishedLine(text, stream)) {
|
|
136
250
|
progressed = true;
|
|
137
251
|
}
|
|
138
252
|
counted = 0;
|
|
@@ -144,12 +258,24 @@ export function createRunProgress(command = '') {
|
|
|
144
258
|
state.countedDots = dots;
|
|
145
259
|
return progressed;
|
|
146
260
|
},
|
|
261
|
+
error: () => failure,
|
|
147
262
|
inFlight: () => [
|
|
148
263
|
...running,
|
|
149
264
|
...[...packages].flatMap(([name, tests]) => tests.size === 0 ? [name] : [...tests].map((test) => `${name} ${test}`)),
|
|
150
265
|
],
|
|
151
266
|
};
|
|
152
267
|
}
|
|
268
|
+
/** JSON-plus 0.1 flushes each closed result; plain libtest-json buffers a whole binary. */
|
|
269
|
+
export function withTestResultReport(command) {
|
|
270
|
+
if ((command.match(NEXTEST_RUN)?.length ?? 0) !== 1 ||
|
|
271
|
+
command.search(BUN_TEST) !== -1 ||
|
|
272
|
+
command.search(GO_TEST) !== -1 ||
|
|
273
|
+
UNCAPTURED_NEXTEST.test(command))
|
|
274
|
+
return { command, env: {} };
|
|
275
|
+
let reported = withInvocationFlag(command, NEXTEST_RUN, /(?<![\w-])--message-format(?:=|\s+)(?:"[^"]*"|'[^']*'|[^\s]+)/g, '--message-format=libtest-json-plus', true);
|
|
276
|
+
reported = withInvocationFlag(reported, NEXTEST_RUN, /(?<![\w-])--message-format-version(?:=|\s+)(?:"[^"]*"|'[^']*'|[^\s]+)/g, '--message-format-version=0.1', true);
|
|
277
|
+
return { command: reported, env: { NEXTEST_EXPERIMENTAL_LIBTEST_JSON: '1' } };
|
|
278
|
+
}
|
|
153
279
|
/**
|
|
154
280
|
* `command` with its one `bun test` asked for a line of dots, one per finished test: the only per-test report bun
|
|
155
281
|
* prints whoever runs it. A command that runs no bun, more than one runner, or already chose bun's dots is returned
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type ClosedTestResult } from './test-results.js';
|
|
2
|
+
export { taskDirectory } from './verdict.js';
|
|
3
|
+
/** A runner's closed observation, before the artifact writer assigns its references. */
|
|
4
|
+
export interface NativeTestResult {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly status: ClosedTestResult['status'];
|
|
7
|
+
readonly source: ClosedTestResult['source'];
|
|
8
|
+
readonly contradictsCursor?: number;
|
|
9
|
+
readonly durationMs: number | null;
|
|
10
|
+
readonly sourceRef: string | null;
|
|
11
|
+
readonly failureOutput: string | null;
|
|
12
|
+
}
|
|
13
|
+
export interface TestResultWriter {
|
|
14
|
+
/** Completes the evidence write before publishing its referring JSONL record. */
|
|
15
|
+
append(result: NativeTestResult): string | null;
|
|
16
|
+
reconcile(results: readonly NativeTestResult[]): string | null;
|
|
17
|
+
close(): Promise<string | null>;
|
|
18
|
+
}
|
|
19
|
+
/** A new inode and UUID identify a replacement run, even when it has the same byte length. */
|
|
20
|
+
export declare function createTestResultWriter(directory: string, sourceRoot: {
|
|
21
|
+
readonly cwd: string;
|
|
22
|
+
readonly root: string;
|
|
23
|
+
}): Promise<{
|
|
24
|
+
readonly ok: true;
|
|
25
|
+
readonly writer: TestResultWriter;
|
|
26
|
+
} | {
|
|
27
|
+
readonly ok: false;
|
|
28
|
+
readonly error: string;
|
|
29
|
+
}>;
|
|
30
|
+
//# sourceMappingURL=test-result-writer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-result-writer.d.ts","sourceRoot":"","sources":["../../../src/executors/bounded-exec/test-result-writer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAA6D,MAAM,mBAAmB,CAAC;AAErH,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAM7C,wFAAwF;AACxF,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC5C,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC5C,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CACvC;AAED,MAAM,WAAW,gBAAgB;IAC/B,iFAAiF;IACjF,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,GAAG,IAAI,CAAC;IAChD,SAAS,CAAC,OAAO,EAAE,SAAS,gBAAgB,EAAE,GAAG,MAAM,GAAG,IAAI,CAAC;IAC/D,KAAK,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CACjC;AA6BD,8FAA8F;AAC9F,wBAAsB,sBAAsB,CAC1C,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC1D,OAAO,CAAC;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAA;CAAE,GAAG;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CA8FpH"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { parseTestSourceRef, TEST_FAILURES_FILE, TEST_RESULTS_FILE } from './test-results.js';
|
|
2
|
+
export { taskDirectory } from './verdict.js';
|
|
3
|
+
import { randomUUID } from 'node:crypto';
|
|
4
|
+
import { appendFileSync } from 'node:fs';
|
|
5
|
+
import { open, rename, rm } from 'node:fs/promises';
|
|
6
|
+
import { join, relative, resolve, sep } from 'node:path';
|
|
7
|
+
/** The cursor includes its own decimal digits: converge on their width before publishing. */
|
|
8
|
+
function resultLine(result, offset) {
|
|
9
|
+
let cursor = offset;
|
|
10
|
+
for (;;) {
|
|
11
|
+
const line = `${JSON.stringify({ ...result, cursor })}\n`;
|
|
12
|
+
const next = offset + Buffer.byteLength(line);
|
|
13
|
+
if (next === cursor)
|
|
14
|
+
return { line, cursor };
|
|
15
|
+
cursor = next;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function normalizeSourceRef(sourceRef, sourceRoot) {
|
|
19
|
+
const location = parseTestSourceRef(sourceRef);
|
|
20
|
+
if (location === null)
|
|
21
|
+
return null;
|
|
22
|
+
return `${relative(sourceRoot.root, resolve(sourceRoot.cwd, location.path)).split(sep).join('/')}:${location.line}`;
|
|
23
|
+
}
|
|
24
|
+
async function closeResultFiles(files, stagedPaths = []) {
|
|
25
|
+
const results = await Promise.allSettled([
|
|
26
|
+
...files.map((file) => file.close()),
|
|
27
|
+
...stagedPaths.map((path) => rm(path, { force: true })),
|
|
28
|
+
]);
|
|
29
|
+
const failures = results.flatMap((result) => (result.status === 'rejected' ? [String(result.reason)] : []));
|
|
30
|
+
return failures.length === 0 ? null : `closing test result artifacts: ${failures.join('; ')}`;
|
|
31
|
+
}
|
|
32
|
+
/** A new inode and UUID identify a replacement run, even when it has the same byte length. */
|
|
33
|
+
export async function createTestResultWriter(directory, sourceRoot) {
|
|
34
|
+
const runId = randomUUID();
|
|
35
|
+
const target = join(directory, TEST_RESULTS_FILE);
|
|
36
|
+
const staged = `${target}.${runId}`;
|
|
37
|
+
const causePath = join(directory, TEST_FAILURES_FILE);
|
|
38
|
+
const stagedCauses = `${causePath}.${runId}`;
|
|
39
|
+
const [records, causes] = await Promise.allSettled([open(staged, 'ax'), open(stagedCauses, 'ax')]);
|
|
40
|
+
if (records.status !== 'fulfilled' || causes.status !== 'fulfilled') {
|
|
41
|
+
const cleanup = await closeResultFiles([
|
|
42
|
+
...(records.status === 'fulfilled' ? [records.value] : []),
|
|
43
|
+
...(causes.status === 'fulfilled' ? [causes.value] : []),
|
|
44
|
+
], [staged, stagedCauses]);
|
|
45
|
+
const failures = [records, causes].flatMap((result) => result.status === 'rejected' ? [String(result.reason)] : []);
|
|
46
|
+
return {
|
|
47
|
+
ok: false,
|
|
48
|
+
error: `initializing test result stream ${target}: ${failures.join('; ')}${cleanup === null ? '' : `; ${cleanup}`}`,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
try {
|
|
52
|
+
await rename(stagedCauses, causePath);
|
|
53
|
+
await rename(staged, target);
|
|
54
|
+
}
|
|
55
|
+
catch (cause) {
|
|
56
|
+
const cleanup = await closeResultFiles([records.value, causes.value], [staged, stagedCauses]);
|
|
57
|
+
return {
|
|
58
|
+
ok: false,
|
|
59
|
+
error: `initializing test result stream ${target}: ${String(cause)}${cleanup === null ? '' : `; ${cleanup}`}`,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
let offset = 0;
|
|
63
|
+
let causeOffset = 0;
|
|
64
|
+
let failure = null;
|
|
65
|
+
let closing = null;
|
|
66
|
+
const provisional = new Map();
|
|
67
|
+
return {
|
|
68
|
+
ok: true,
|
|
69
|
+
writer: {
|
|
70
|
+
append(result) {
|
|
71
|
+
if (failure !== null)
|
|
72
|
+
return failure;
|
|
73
|
+
if (closing !== null)
|
|
74
|
+
return `appending test result ${result.id} to ${target}: stream is closed`;
|
|
75
|
+
try {
|
|
76
|
+
let causeRef = null;
|
|
77
|
+
if (result.status === 'fail' && result.failureOutput !== null) {
|
|
78
|
+
const endByte = causeOffset + Buffer.byteLength(result.failureOutput);
|
|
79
|
+
appendFileSync(causes.value.fd, result.failureOutput);
|
|
80
|
+
causeRef = { path: TEST_FAILURES_FILE, startByte: causeOffset, endByte };
|
|
81
|
+
causeOffset = endByte;
|
|
82
|
+
}
|
|
83
|
+
const { line, cursor } = resultLine({
|
|
84
|
+
runId,
|
|
85
|
+
id: result.id,
|
|
86
|
+
status: result.status,
|
|
87
|
+
source: result.source,
|
|
88
|
+
...(result.contradictsCursor === undefined ? {} : { contradictsCursor: result.contradictsCursor }),
|
|
89
|
+
durationMs: result.durationMs,
|
|
90
|
+
sourceRef: normalizeSourceRef(result.sourceRef, sourceRoot),
|
|
91
|
+
causeRef,
|
|
92
|
+
}, offset);
|
|
93
|
+
// appendFileSync has no user-space buffering: each LF is visible before append returns.
|
|
94
|
+
appendFileSync(records.value.fd, line);
|
|
95
|
+
offset = cursor;
|
|
96
|
+
if (result.source === 'progress')
|
|
97
|
+
provisional.set(result.id, { status: result.status, cursor });
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
catch (cause) {
|
|
101
|
+
failure = `appending test result ${result.id} to ${target}: ${String(cause)}`;
|
|
102
|
+
return failure;
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
reconcile(results) {
|
|
106
|
+
for (const result of results) {
|
|
107
|
+
const prior = provisional.get(result.id);
|
|
108
|
+
if (prior !== undefined && prior.status === result.status)
|
|
109
|
+
continue;
|
|
110
|
+
const error = this.append({
|
|
111
|
+
...result,
|
|
112
|
+
source: 'junit',
|
|
113
|
+
...(prior === undefined ? {} : { contradictsCursor: prior.cursor }),
|
|
114
|
+
});
|
|
115
|
+
if (error !== null)
|
|
116
|
+
return error;
|
|
117
|
+
}
|
|
118
|
+
return null;
|
|
119
|
+
},
|
|
120
|
+
close() {
|
|
121
|
+
closing ??= closeResultFiles([records.value, causes.value]);
|
|
122
|
+
return closing;
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
};
|
|
126
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type tags } from 'typia';
|
|
2
|
+
export declare const TEST_RESULTS_FILE = "test-results.jsonl";
|
|
3
|
+
export declare const TEST_FAILURES_FILE = "test-failures.log";
|
|
4
|
+
type ByteOffset = number & tags.Type<'uint64'> & tags.Maximum<9007199254740991>;
|
|
5
|
+
/** Live observations, not gate evidence: report.xml and verdict.json remain authoritative. */
|
|
6
|
+
export interface ClosedTestResult {
|
|
7
|
+
readonly runId: string & tags.Format<'uuid'>;
|
|
8
|
+
readonly id: string;
|
|
9
|
+
readonly status: 'pass' | 'fail' | 'skip';
|
|
10
|
+
readonly source: 'native' | 'progress' | 'junit';
|
|
11
|
+
/** Set only on a terminal JUnit correction of a provisional progress observation. */
|
|
12
|
+
readonly contradictsCursor?: ByteOffset;
|
|
13
|
+
/** Null when the native runner reports no duration (for example a skipped test). */
|
|
14
|
+
readonly durationMs: (number & tags.Minimum<0>) | null;
|
|
15
|
+
/** Native file:line, never a location inferred from human output. */
|
|
16
|
+
readonly sourceRef: string | null;
|
|
17
|
+
/** UTF-8 byte range [startByte, endByte), relative to the task artifact directory. */
|
|
18
|
+
readonly causeRef: {
|
|
19
|
+
readonly path: typeof TEST_FAILURES_FILE;
|
|
20
|
+
readonly startByte: ByteOffset;
|
|
21
|
+
readonly endByte: ByteOffset;
|
|
22
|
+
} | null;
|
|
23
|
+
/** Next UTF-8 byte offset in test-results.jsonl, including this record's LF. */
|
|
24
|
+
readonly cursor: ByteOffset;
|
|
25
|
+
}
|
|
26
|
+
export declare const isClosedTestResult: (input: unknown) => input is ClosedTestResult;
|
|
27
|
+
/** A producer-normalized workspace-relative declaration location, never inferred from a test name. */
|
|
28
|
+
export declare function parseTestSourceRef(sourceRef: string | null): {
|
|
29
|
+
path: string;
|
|
30
|
+
line: number;
|
|
31
|
+
} | null;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=test-results.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-results.d.ts","sourceRoot":"","sources":["../../../src/executors/bounded-exec/test-results.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,IAAI,EAAE,MAAM,OAAO,CAAC;AAEzC,eAAO,MAAM,iBAAiB,uBAAuB,CAAC;AACtD,eAAO,MAAM,kBAAkB,sBAAsB,CAAC;AAEtD,KAAK,UAAU,GAAG,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,C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|
+
export const TEST_RESULTS_FILE = 'test-results.jsonl';
|
|
5
|
+
export const TEST_FAILURES_FILE = 'test-failures.log';
|
|
6
|
+
export const isClosedTestResult = (() => {
|
|
7
|
+
const _io0 = (input, _exceptionable = true) => "string" === typeof input.runId && _isFormatUuid_1._isFormatUuid(input.runId) && "string" === typeof input.id && ("fail" === input.status || "pass" === input.status || "skip" === input.status) && ("junit" === input.source || "native" === input.source || "progress" === input.source) && (undefined === input.contradictsCursor || "number" === typeof input.contradictsCursor && (_isTypeUint64_1._isTypeUint64(input.contradictsCursor) && input.contradictsCursor <= 9007199254740991)) && (null === input.durationMs || "number" === typeof input.durationMs && 0 <= input.durationMs) && (null === input.sourceRef || "string" === typeof input.sourceRef) && (null === input.causeRef || "object" === typeof input.causeRef && null !== input.causeRef && _io1(input.causeRef, true && _exceptionable)) && ("number" === typeof input.cursor && (_isTypeUint64_1._isTypeUint64(input.cursor) && input.cursor <= 9007199254740991)) && (8 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
8
|
+
if (["runId", "id", "status", "source", "contradictsCursor", "durationMs", "sourceRef", "causeRef", "cursor"].some(prop => key === prop))
|
|
9
|
+
return true;
|
|
10
|
+
const value = input[key];
|
|
11
|
+
if (undefined === value)
|
|
12
|
+
return true;
|
|
13
|
+
return false;
|
|
14
|
+
}));
|
|
15
|
+
const _io1 = (input, _exceptionable = true) => "test-failures.log" === input.path && ("number" === typeof input.startByte && (_isTypeUint64_1._isTypeUint64(input.startByte) && input.startByte <= 9007199254740991)) && ("number" === typeof input.endByte && (_isTypeUint64_1._isTypeUint64(input.endByte) && input.endByte <= 9007199254740991)) && (3 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
16
|
+
if (["path", "startByte", "endByte"].some(prop => key === prop))
|
|
17
|
+
return true;
|
|
18
|
+
const value = input[key];
|
|
19
|
+
if (undefined === value)
|
|
20
|
+
return true;
|
|
21
|
+
return false;
|
|
22
|
+
}));
|
|
23
|
+
return (input, _exceptionable = true) => "object" === typeof input && null !== input && _io0(input, true);
|
|
24
|
+
})();
|
|
25
|
+
/** A producer-normalized workspace-relative declaration location, never inferred from a test name. */
|
|
26
|
+
export function parseTestSourceRef(sourceRef) {
|
|
27
|
+
if (sourceRef === null)
|
|
28
|
+
return null;
|
|
29
|
+
const match = /^(.+):([1-9]\d*)$/.exec(sourceRef);
|
|
30
|
+
const path = match?.[1];
|
|
31
|
+
const line = Number(match?.[2]);
|
|
32
|
+
return path !== undefined && Number.isSafeInteger(line) ? { path, line } : null;
|
|
33
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { CpuWaitRow } from './lease-wait.js';
|
|
2
2
|
import { type LockWait } from './lock-wait.js';
|
|
3
|
+
import type { MbxQueuedRequest } from './mbx-queue.js';
|
|
4
|
+
import type { NativeTestResult } from './test-result-writer.js';
|
|
3
5
|
/**
|
|
4
6
|
* Why one bounded run ended, recorded per Nx task so a caller can tell a load-sensitive bound
|
|
5
7
|
* from a real failure without reading the run's output.
|
|
@@ -18,12 +20,17 @@ import { type LockWait } from './lock-wait.js';
|
|
|
18
20
|
* - `no-space`: the run failed and its output said a write found no space (ENOSPC). Whatever its tests then reported,
|
|
19
21
|
* they failed on the disk, not on their own: the verdict names the line that said so and, when the task held one,
|
|
20
22
|
* its RAM temp volume as it stood when that line arrived.
|
|
23
|
+
* - `queued`: the command failed before any admission after a live task PID was explicitly seen waiting in mbx.
|
|
24
|
+
* Its observed wait and public queue positions describe admission pressure, never a wedged test.
|
|
21
25
|
* - `failed`: anything else that did not pass. That includes an assertion named in the report,
|
|
22
26
|
* or a non-zero exit with no report to say why.
|
|
23
27
|
*/
|
|
24
28
|
export type BoundedExecVerdict = {
|
|
25
29
|
readonly outcome: 'passed';
|
|
26
|
-
} | {
|
|
30
|
+
} | ({
|
|
31
|
+
readonly outcome: 'queued';
|
|
32
|
+
readonly exitCode: number;
|
|
33
|
+
} & AdmissionQueueWait) | {
|
|
27
34
|
readonly outcome: 'bound';
|
|
28
35
|
readonly bound: 'total' | 'fixture';
|
|
29
36
|
readonly limitMs: number;
|
|
@@ -48,6 +55,11 @@ export type BoundedExecVerdict = {
|
|
|
48
55
|
readonly exitCode: number;
|
|
49
56
|
readonly tests: readonly string[];
|
|
50
57
|
};
|
|
58
|
+
/** Observed admission wait, supplied only while the command has never received a grant. */
|
|
59
|
+
export interface AdmissionQueueWait {
|
|
60
|
+
readonly waitedMs: number;
|
|
61
|
+
readonly requests: readonly MbxQueuedRequest[];
|
|
62
|
+
}
|
|
51
63
|
/**
|
|
52
64
|
* The task's RAM temp volume, read when a line saying ENOSPC arrived: the writer's own lease and the space left on the
|
|
53
65
|
* volume it was taken on (`measured`), or why there was none to measure: the lease was no longer on that volume
|
|
@@ -113,6 +125,8 @@ export interface JunitFailures {
|
|
|
113
125
|
* Retry elements (`flakyFailure`, `rerunFailure`, ...) describe attempts, not the verdict.
|
|
114
126
|
*/
|
|
115
127
|
export declare function junitFailures(xml: string): JunitFailures;
|
|
128
|
+
/** Bun's nested suites carry the describe chain; testcase.classname is in the reverse order. */
|
|
129
|
+
export declare function bunJunitResults(xml: string): NativeTestResult[];
|
|
116
130
|
/** One test case of a JUnit report: nextest's binary id (its `classname`), the test's name and its seconds. */
|
|
117
131
|
export interface JunitCaseTime {
|
|
118
132
|
readonly binary: string;
|
|
@@ -152,6 +166,8 @@ export interface RunEnd {
|
|
|
152
166
|
readonly noSpace: NoSpaceSighting | null;
|
|
153
167
|
/** The lock waits the expiry's snapshot named; empty when none, or when that capture did not complete. */
|
|
154
168
|
readonly lockWaits: readonly LockWait[];
|
|
169
|
+
/** Explicit observed queue evidence before first admission; absent after any grant. */
|
|
170
|
+
readonly admissionQueue?: AdmissionQueueWait | null;
|
|
155
171
|
}
|
|
156
172
|
/**
|
|
157
173
|
* Judge a run. A run that failed after its output said ENOSPC failed on the disk: that is read first, ahead of the
|
|
@@ -201,7 +217,7 @@ export declare function writeRecord(directory: string, record: BoundedExecRecord
|
|
|
201
217
|
/** The record in `directory`, or `null` when there is none. A malformed record throws. */
|
|
202
218
|
export declare function readRecord(directory: string): Promise<BoundedExecRecord | null>;
|
|
203
219
|
/** The JUnit report a command wrote into `directory`, or `null` when it wrote none. */
|
|
204
|
-
export declare function readJunitReport(directory: string): Promise<JunitFailures | null>;
|
|
220
|
+
export declare function readJunitReport(directory: string, bunClosed?: (results: readonly NativeTestResult[]) => void): Promise<JunitFailures | null>;
|
|
205
221
|
/** A failed task of an Nx run, and whether its bounded-exec record shows only a bound. */
|
|
206
222
|
export type FailedTask = {
|
|
207
223
|
readonly task: string;
|
|
@@ -220,6 +236,8 @@ export type FailedTask = {
|
|
|
220
236
|
* with no record, or a record from another hash, is not a bound; nothing is assumed.
|
|
221
237
|
*/
|
|
222
238
|
export declare function failedTasksOfRun(runJson: unknown, workspaceData: string): Promise<FailedTask[]>;
|
|
239
|
+
/** The same honest admission diagnostic in live output and a terminal verdict. */
|
|
240
|
+
export declare function describeAdmissionQueue(wait: AdmissionQueueWait): string;
|
|
223
241
|
export declare function describeVerdict(verdict: BoundedExecVerdict): string;
|
|
224
242
|
/**
|
|
225
243
|
* What a run's output said about a write that found no space, and where the run's temp files lived then. The free
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verdict.d.ts","sourceRoot":"","sources":["../../../src/executors/bounded-exec/verdict.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"verdict.d.ts","sourceRoot":"","sources":["../../../src/executors/bounded-exec/verdict.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAmB,KAAK,QAAQ,EAAe,MAAM,gBAAgB,CAAC;AAC7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAGhE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,kBAAkB,GAC1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